blob: 71675b7cf0764d14575df9882a0a07a02dc37d78 [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Scott Baker57196542017-04-11 15:48:17 -070017---
18# xos-core-build/tasks/main.yml
19
20- name: Intialize recipe list
21 set_fact:
Sapan Bhatiae86a3d22017-04-27 00:53:27 +020022 recipes: ['/opt/cord/orchestration/xos/xos/core/core-onboard.yaml']
Scott Baker57196542017-04-11 15:48:17 -070023
24- name: Generate list of recipes
25 set_fact:
26 recipes: "{{ recipes }} + [ '/opt/cord/{{ item.path }}/xos/{{ item.name }}-{{ item.operation | default('onboard') }}.yaml']"
27 with_items: "{{ xos_services }}"
28
Scott Baker6a2065c2017-04-20 15:27:41 -070029- name: Add in the profile library
30 set_fact:
31 recipes: "{{ recipes }} + [ '/opt/cord/orchestration/profiles/{{ profile_library }}/xos/{{ profile_library }}-onboard.yaml']"
32 when:
33 profile_library != ""
34
Scott Baker57196542017-04-11 15:48:17 -070035- name: Join the list of recipes
36 set_fact:
37 recipes_string: "{{ recipes | join(' ') }}"
38
39- debug:
40 msg: "{{ recipes }}"
41
42- name: Create the BUILD directory
43 file:
Zack Williamsc989f262017-05-11 13:02:59 -070044 path: "{{ build_cord_dir | realpath }}/orchestration/xos/containers/xos/BUILD"
Scott Baker57196542017-04-11 15:48:17 -070045 state: directory
46 mode: 0755
47
48# Run the corebuilder tool -- we can't do this using a docker ansible command,
49# as we have to wait for the tool to complete before continuing.
50
51- name: Run the corebuilder tool
52 shell: >
53 docker run
54 --rm
Zack Williamsc989f262017-05-11 13:02:59 -070055 -v {{ build_cord_dir | realpath }}:/opt/cord
56 -v {{ build_cord_dir ~ "/orchestration/xos/containers/xos/BUILD" | realpath }}:/opt/xos_corebuilder/BUILD
57 xosproject/xos-corebuilder:{{ build_docker_tag }}
Scott Baker57196542017-04-11 15:48:17 -070058 {{ recipes_string }}
59 tags:
60 - skip_ansible_lint # running a build task
61
62- name: Build UI image
63 docker_image:
64 name: "xosproject/xos-ui"
Zack Williamsc989f262017-05-11 13:02:59 -070065 path: "{{ build_cord_dir | realpath }}/orchestration/xos"
Scott Baker57196542017-04-11 15:48:17 -070066 tag: "{{ build_docker_tag }}"
67 dockerfile: "containers/xos/Dockerfile.UI"
68 pull: False
Andy Bavierfa53a8d2017-05-03 08:47:16 -070069 force: True