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'