From e3918a1efdb895cf728adc9b95cd41096d0619f2 Mon Sep 17 00:00:00 2001 From: Vitalii Solodilov Date: Wed, 21 Mar 2018 20:51:49 +0400 Subject: [PATCH] Fixed the Mistral Docker build job Change-Id: I4d969d2a3b1c51dd1f2b55bf4d678e09c33e85f7 --- docker_image_build.sh | 16 ---------------- playbooks/docker-buildimage/run.yaml | 22 ++++++++++++++++++---- 2 files changed, 18 insertions(+), 20 deletions(-) delete mode 100755 docker_image_build.sh diff --git a/docker_image_build.sh b/docker_image_build.sh deleted file mode 100755 index f4d77da34..000000000 --- a/docker_image_build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -xe - -# TODO (akovi): This script is needed practically only for the CI builds. -# Should be moved to some other place - -# install docker -curl -fsSL https://get.docker.com/ | sh - -sudo service docker restart - -sudo -E docker pull ubuntu:14.04 - -# build image -sudo -E tools/docker/build.sh - -sudo -E docker save mistral-all | gzip > mistral-docker.tar.gz diff --git a/playbooks/docker-buildimage/run.yaml b/playbooks/docker-buildimage/run.yaml index 26cfc61bb..8184f36e5 100644 --- a/playbooks/docker-buildimage/run.yaml +++ b/playbooks/docker-buildimage/run.yaml @@ -1,6 +1,20 @@ - hosts: all + vars: + work_dir: '{{ ansible_user_dir }}/src/{{ zuul.project.canonical_name }}' tasks: - - shell: - cmd: | - ./docker_image_build.sh - chdir: '{{ ansible_user_dir }}/src/{{ zuul.project.canonical_name }}' + - name: Install Docker + shell: curl -fsSL https://get.docker.com/ | sh + args: + chdir: '{{ work_dir }}' + + - name: Restart Docker service + service: + name: docker + state: restarted + + - name: Build and archive a Mistral image + docker_image: + name: mistral + path: '{{ work_dir }}' + dockerfile: '{{ work_dir }}/tools/docker/Dockerfile' + archive_path: '{{ work_dir}}}/mistral-docker.tar.gz'