Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 1 | --- |
| 2 | # xos-docker-images/tasks/main.yml |
| 3 | |
| 4 | - name: Build xos-base docker image |
| 5 | when: build_xos_base_image |
| 6 | docker_image: |
| 7 | name: "xosproject/xos-base" |
| 8 | path: "{{ cord_dir }}/orchestration/xos/containers/xos" |
| 9 | dockerfile: "Dockerfile.base" |
| 10 | |
| 11 | - name: Pull xos-base docker image from Dockerhub |
| 12 | when: not build_xos_base_image |
| 13 | docker_image: |
| 14 | name: "xosproject/xos-base" |
| 15 | |
| 16 | - name: Obtain XOS git repo metadata |
| 17 | command: "git log --pretty=format:'{\"XOS_GIT_COMMIT_DATE\":\"%ci\", \"XOS_GIT_COMMIT_HASH\":\"%H\"}' -n 1" |
| 18 | args: |
| 19 | chdir: "{{ cord_dir }}/orchestration/xos/" |
| 20 | register: xos_git_metadata |
| 21 | tags: |
| 22 | - skip_ansible_lint # idempotent git metadata retrieval, git module can't do this |
| 23 | |
| 24 | - name: Copy over SSL CA certificates |
| 25 | copy: |
| 26 | src: "{{ playbook_dir }}/pki/intermediate_ca/certs/im_cert_chain.pem" |
| 27 | dest: "{{ cord_dir }}/orchestration/xos/containers/xos/local_certs.crt" |
| 28 | mode: 0644 |
| 29 | |
| 30 | - name: Build xosproject/xos devel image |
| 31 | docker_image: |
| 32 | name: "xosproject/xos" |
| 33 | path: "{{ cord_dir }}/orchestration/xos/" |
| 34 | dockerfile: "containers/xos/Dockerfile.devel" |
| 35 | buildargs: "{{ xos_git_metadata.stdout }}" |
| 36 | pull: False # should use locally created, or already pulled xos-base image |
| 37 | |
| 38 | - name: Build xosproject/xos-test testing image |
| 39 | when: build_xos_test_image |
| 40 | docker_image: |
| 41 | name: "xosproject/xos-test" |
| 42 | path: "{{ cord_dir }}/orchestration/xos/" |
| 43 | dockerfile: "containers/xos/Dockerfile.test" |
| 44 | pull: False # use the locally built copy of xosproject/xos |
| 45 | |
| 46 | - name: Tag and push xos-base image to docker registry |
| 47 | when: push_xos_base_image |
| 48 | docker_image: |
| 49 | name: "{{ deploy_docker_registry }}/xosproject/xos-base" |
| 50 | tag: "{{ deploy_docker_tag }}" |
| 51 | push: yes |
| 52 | |
| 53 | - name: Tag and push xos image to docker registry |
| 54 | when: push_xos_image |
| 55 | docker_image: |
| 56 | name: "{{ deploy_docker_registry }}/xosproject/xos" |
| 57 | tag: "{{ deploy_docker_tag }}" |
| 58 | push: True |
| 59 | |