blob: 88e6af6d47be431b7f2f001c97f75c87d4f3b363 [file] [log] [blame]
Scott Baker57196542017-04-11 15:48:17 -07001---
2# xos-core-build/tasks/main.yml
3
4- name: Intialize recipe list
5 set_fact:
Sapan Bhatia631a1082017-04-27 00:53:27 +02006 recipes: ['/opt/cord/orchestration/xos/xos/core/core-onboard.yaml']
Scott Baker57196542017-04-11 15:48:17 -07007
8- name: Generate list of recipes
9 set_fact:
10 recipes: "{{ recipes }} + [ '/opt/cord/{{ item.path }}/xos/{{ item.name }}-{{ item.operation | default('onboard') }}.yaml']"
11 with_items: "{{ xos_services }}"
12
13- name: Generate list of libraries
14 set_fact:
15 recipes: "{{ recipes }} + [ '/opt/cord/orchestration/xos_libraries/{{ item }}/{{ item }}-onboard.yaml']"
16 with_items: "{{ xos_libraries }}"
17
Scott Baker463e5f92017-04-20 15:27:41 -070018- name: Add in the profile library
19 set_fact:
20 recipes: "{{ recipes }} + [ '/opt/cord/orchestration/profiles/{{ profile_library }}/xos/{{ profile_library }}-onboard.yaml']"
21 when:
22 profile_library != ""
23
Scott Baker57196542017-04-11 15:48:17 -070024- name: Join the list of recipes
25 set_fact:
26 recipes_string: "{{ recipes | join(' ') }}"
27
28- debug:
29 msg: "{{ recipes }}"
30
31- name: Create the BUILD directory
32 file:
33 path: "{{ cord_dir | realpath }}/orchestration/xos/containers/xos/BUILD"
34 state: directory
35 mode: 0755
36
37# Run the corebuilder tool -- we can't do this using a docker ansible command,
38# as we have to wait for the tool to complete before continuing.
39
40- name: Run the corebuilder tool
41 shell: >
42 docker run
43 --rm
44 -v {{ cord_dir | realpath }}:/opt/cord
45 -v {{ cord_dir | realpath }}/orchestration/xos/containers/xos/BUILD:/opt/xos_corebuilder/BUILD
46 xosproject/xos-corebuilder:candidate
47 {{ recipes_string }}
48 tags:
49 - skip_ansible_lint # running a build task
50
51- name: Build UI image
52 docker_image:
53 name: "xosproject/xos-ui"
54 path: "{{ cord_dir | realpath }}/orchestration/xos"
55 tag: "{{ build_docker_tag }}"
56 dockerfile: "containers/xos/Dockerfile.UI"
57 pull: False
Andy Baviere8b01d22017-05-03 08:47:16 -070058 force: True