blob: 06faff1f2fd846f24249b73c1ba62c40834beeda [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 Bhatiae86a3d22017-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 Baker6a2065c2017-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:
Zack Williamsc989f262017-05-11 13:02:59 -070033 path: "{{ build_cord_dir | realpath }}/orchestration/xos/containers/xos/BUILD"
Scott Baker57196542017-04-11 15:48:17 -070034 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
Zack Williamsc989f262017-05-11 13:02:59 -070044 -v {{ build_cord_dir | realpath }}:/opt/cord
45 -v {{ build_cord_dir ~ "/orchestration/xos/containers/xos/BUILD" | realpath }}:/opt/xos_corebuilder/BUILD
46 xosproject/xos-corebuilder:{{ build_docker_tag }}
Scott Baker57196542017-04-11 15:48:17 -070047 {{ 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"
Zack Williamsc989f262017-05-11 13:02:59 -070054 path: "{{ build_cord_dir | realpath }}/orchestration/xos"
Scott Baker57196542017-04-11 15:48:17 -070055 tag: "{{ build_docker_tag }}"
56 dockerfile: "containers/xos/Dockerfile.UI"
57 pull: False
Andy Bavierfa53a8d2017-05-03 08:47:16 -070058 force: True