Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 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 Baker | 5719654 | 2017-04-11 15:48:17 -0700 | [diff] [blame] | 17 | --- |
| 18 | # xos-core-build/tasks/main.yml |
| 19 | |
| 20 | - name: Intialize recipe list |
| 21 | set_fact: |
Sapan Bhatia | e86a3d2 | 2017-04-27 00:53:27 +0200 | [diff] [blame] | 22 | recipes: ['/opt/cord/orchestration/xos/xos/core/core-onboard.yaml'] |
Scott Baker | 5719654 | 2017-04-11 15:48:17 -0700 | [diff] [blame] | 23 | |
| 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 | |
| 29 | - name: Generate list of libraries |
| 30 | set_fact: |
| 31 | recipes: "{{ recipes }} + [ '/opt/cord/orchestration/xos_libraries/{{ item }}/{{ item }}-onboard.yaml']" |
| 32 | with_items: "{{ xos_libraries }}" |
| 33 | |
Scott Baker | 6a2065c | 2017-04-20 15:27:41 -0700 | [diff] [blame] | 34 | - name: Add in the profile library |
| 35 | set_fact: |
| 36 | recipes: "{{ recipes }} + [ '/opt/cord/orchestration/profiles/{{ profile_library }}/xos/{{ profile_library }}-onboard.yaml']" |
| 37 | when: |
| 38 | profile_library != "" |
| 39 | |
Scott Baker | 5719654 | 2017-04-11 15:48:17 -0700 | [diff] [blame] | 40 | - name: Join the list of recipes |
| 41 | set_fact: |
| 42 | recipes_string: "{{ recipes | join(' ') }}" |
| 43 | |
| 44 | - debug: |
| 45 | msg: "{{ recipes }}" |
| 46 | |
| 47 | - name: Create the BUILD directory |
| 48 | file: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 49 | path: "{{ build_cord_dir | realpath }}/orchestration/xos/containers/xos/BUILD" |
Scott Baker | 5719654 | 2017-04-11 15:48:17 -0700 | [diff] [blame] | 50 | state: directory |
| 51 | mode: 0755 |
| 52 | |
| 53 | # Run the corebuilder tool -- we can't do this using a docker ansible command, |
| 54 | # as we have to wait for the tool to complete before continuing. |
| 55 | |
| 56 | - name: Run the corebuilder tool |
| 57 | shell: > |
| 58 | docker run |
| 59 | --rm |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 60 | -v {{ build_cord_dir | realpath }}:/opt/cord |
| 61 | -v {{ build_cord_dir ~ "/orchestration/xos/containers/xos/BUILD" | realpath }}:/opt/xos_corebuilder/BUILD |
| 62 | xosproject/xos-corebuilder:{{ build_docker_tag }} |
Scott Baker | 5719654 | 2017-04-11 15:48:17 -0700 | [diff] [blame] | 63 | {{ recipes_string }} |
| 64 | tags: |
| 65 | - skip_ansible_lint # running a build task |
| 66 | |
| 67 | - name: Build UI image |
| 68 | docker_image: |
| 69 | name: "xosproject/xos-ui" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 70 | path: "{{ build_cord_dir | realpath }}/orchestration/xos" |
Scott Baker | 5719654 | 2017-04-11 15:48:17 -0700 | [diff] [blame] | 71 | tag: "{{ build_docker_tag }}" |
| 72 | dockerfile: "containers/xos/Dockerfile.UI" |
| 73 | pull: False |
Andy Bavier | fa53a8d | 2017-05-03 08:47:16 -0700 | [diff] [blame] | 74 | force: True |