eprasad | 81108dc | 2020-12-29 11:49:10 +0000 | [diff] [blame] | 1 | --- |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2020 The Nordix Foundation. All rights reserved. |
| 4 | # ================================================================================ |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # SPDX-License-Identifier: Apache-2.0 |
| 18 | # ============LICENSE_END========================================================= |
| 19 | |
Akash Rajguru | a5e5764 | 2021-06-02 14:40:39 +0100 | [diff] [blame^] | 20 | # - name: Prepare packaging |
eprasad | 81108dc | 2020-12-29 11:49:10 +0000 | [diff] [blame] | 21 | # include_tasks: prepare-packaging.yaml |
| 22 | |
| 23 | - name: Create folder to store dependencies for offline testing |
| 24 | file: |
| 25 | path: "{{ offline_pkg_folder }}" |
| 26 | state: "{{ item }}" |
| 27 | with_items: |
| 28 | - absent |
| 29 | - directory |
| 30 | |
| 31 | - name: Install packages on {{ ansible_os_family }} |
| 32 | include_tasks: "install-packages-{{ ansible_os_family }}.yml" |
| 33 | |
| 34 | |
| 35 | # collect apt packages |
| 36 | - name: Fetch operating system packages |
| 37 | include_tasks: "pkg-{{ ansible_os_family }}.yaml" |
| 38 | |
| 39 | # clone git repositories |
| 40 | - name: Fetch git repositories |
| 41 | include_tasks: git.yaml |
| 42 | |
| 43 | # download pip packages |
| 44 | - name: Fetch pip python packages |
| 45 | include_tasks: pip.yaml |
| 46 | |
| 47 | # fetch xtexting container images |
| 48 | - name: Fetch container images |
| 49 | include_tasks: containers.yaml |
| 50 | |
| 51 | # ensure we don't have leftovers |
| 52 | - name: Delete outdated files |
| 53 | file: |
| 54 | path: "{{ item }}" |
| 55 | state: absent |
| 56 | with_items: |
| 57 | - "{{ offline_pkg_file }}" |
| 58 | - "{{ offline_pkg_folder }}/test.sh" |
| 59 | - "{{ offline_testing_file }}" |
| 60 | - "/tmp/decompress.sh" |
| 61 | |
| 62 | - name: Copy decompress and run scripts |
| 63 | copy: |
| 64 | src: "{{ item.src }}" |
| 65 | dest: "{{ item.dest }}" |
| 66 | mode: 0755 |
| 67 | with_items: |
| 68 | - {src: "test.sh", dest: "{{ offline_pkg_folder }}/test.sh"} |
| 69 | - {src: "decompress.sh", dest: "/tmp/decompress.sh"} |
| 70 | |
| 71 | # check if the packaging is run by release job by looking at /tmp/release.properties |
| 72 | - name: Check if /tmp/release.properties file exists |
| 73 | stat: |
| 74 | path: /tmp/release.properties |
| 75 | register: release_properties |
| 76 | |
| 77 | # record repo shas in release.properties file if it exists and |
| 78 | # copy release.properties to tarball |
| 79 | - name: Record test repo SHAs in release.properties |
| 80 | include_tasks: record-shas.yaml |
| 81 | when: release_properties.stat.exists |
| 82 | |
| 83 | # create tarball |
| 84 | - name: Create test installer file |
| 85 | script: build.sh |
| 86 | register: build_script |
| 87 | |
| 88 | - name: Log build script output to console |
| 89 | debug: |
| 90 | msg: "{{ build_script.stdout_lines }}" |
| 91 | |
| 92 | # vim: set ts=2 sw=2 expandtab: |