Rico Lin | 8356555 | 2024-07-05 22:59:02 +0800 | [diff] [blame] | 1 | # Copyright (c) 2024 VEXXHOST, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | - name: Upgrade test |
| 16 | hosts: all |
| 17 | become: true |
| 18 | tasks: |
| 19 | - name: Checkout to "{{ from_branch }}" branch |
Rico Lin | 8356555 | 2024-07-05 22:59:02 +0800 | [diff] [blame] | 20 | ansible.builtin.shell: | |
| 21 | sudo apt-get purge -y snapd |
| 22 | git stash |
| 23 | git checkout "{{ from_branch }}" |
| 24 | args: |
| 25 | chdir: "{{ zuul.project.src_dir }}" |
| 26 | |
Mohammed Naser | 6080c9b | 2024-07-18 10:43:09 -0400 | [diff] [blame] | 27 | - name: Run molecule with existing branch |
Mohammed Naser | 6080c9b | 2024-07-18 10:43:09 -0400 | [diff] [blame] | 28 | ansible.builtin.include_role: |
| 29 | name: tox |
| 30 | vars: |
| 31 | tox_envlist: molecule-venv |
| 32 | tox_extra_args: "-- converge -s aio" |
| 33 | tox_environment: |
| 34 | ATMOSPHERE_NETWORK_BACKEND: "{{ network_backend }}" |
| 35 | zuul_work_dir: "{{ zuul.project.src_dir }}" |
Rico Lin | 8356555 | 2024-07-05 22:59:02 +0800 | [diff] [blame] | 36 | |
| 37 | - name: Checkout to "{{ zuul.branch }}" branch |
Rico Lin | 8356555 | 2024-07-05 22:59:02 +0800 | [diff] [blame] | 38 | ansible.builtin.shell: | |
| 39 | git restore . |
| 40 | git checkout "{{ zuul.branch }}" |
| 41 | git stash pop |
| 42 | args: |
| 43 | chdir: "{{ zuul.project.src_dir }}" |
| 44 | |
Mohammed Naser | 6080c9b | 2024-07-18 10:43:09 -0400 | [diff] [blame] | 45 | - name: Upgrade cloud to "{{ zuul.branch }}" |
Mohammed Naser | 6080c9b | 2024-07-18 10:43:09 -0400 | [diff] [blame] | 46 | ansible.builtin.include_role: |
| 47 | name: tox |
| 48 | vars: |
| 49 | tox_envlist: molecule-venv |
| 50 | tox_extra_args: "-- converge -s aio" |
| 51 | tox_environment: |
| 52 | ATMOSPHERE_NETWORK_BACKEND: "{{ network_backend }}" |
| 53 | zuul_work_dir: "{{ zuul.project.src_dir }}" |
| 54 | |
| 55 | - name: Verify if upgrade was successful |
Mohammed Naser | 6080c9b | 2024-07-18 10:43:09 -0400 | [diff] [blame] | 56 | ansible.builtin.include_role: |
| 57 | name: tox |
| 58 | vars: |
| 59 | tox_envlist: molecule-venv |
| 60 | tox_extra_args: "-- verify -s aio" |
| 61 | tox_environment: |
| 62 | ATMOSPHERE_NETWORK_BACKEND: "{{ network_backend }}" |
| 63 | zuul_work_dir: "{{ zuul.project.src_dir }}" |