| # Copyright (c) 2024 VEXXHOST, Inc. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| # not use this file except in compliance with the License. You may obtain |
| # a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations |
| # under the License. |
| |
| - name: Upgrade test |
| hosts: all |
| become: true |
| tasks: |
| - name: Checkout to "{{ from_branch }}" branch |
| ansible.builtin.shell: | |
| sudo apt-get purge -y snapd |
| git stash |
| git checkout "{{ from_branch }}" |
| args: |
| chdir: "{{ zuul.project.src_dir }}" |
| |
| - name: Run molecule with existing branch |
| ansible.builtin.include_role: |
| name: tox |
| vars: |
| tox_envlist: molecule-venv |
| tox_extra_args: "-- converge -s aio" |
| tox_environment: |
| ATMOSPHERE_NETWORK_BACKEND: "{{ network_backend }}" |
| zuul_work_dir: "{{ zuul.project.src_dir }}" |
| |
| - name: Checkout to "{{ zuul.branch }}" branch |
| ansible.builtin.shell: | |
| git restore . |
| git checkout "{{ zuul.branch }}" |
| git stash pop |
| args: |
| chdir: "{{ zuul.project.src_dir }}" |
| |
| - name: Upgrade cloud to "{{ zuul.branch }}" |
| ansible.builtin.include_role: |
| name: tox |
| vars: |
| tox_envlist: molecule-venv |
| tox_extra_args: "-- converge -s aio" |
| tox_environment: |
| ATMOSPHERE_NETWORK_BACKEND: "{{ network_backend }}" |
| zuul_work_dir: "{{ zuul.project.src_dir }}" |
| |
| - name: Verify if upgrade was successful |
| ansible.builtin.include_role: |
| name: tox |
| vars: |
| tox_envlist: molecule-venv |
| tox_extra_args: "-- verify -s aio" |
| tox_environment: |
| ATMOSPHERE_NETWORK_BACKEND: "{{ network_backend }}" |
| zuul_work_dir: "{{ zuul.project.src_dir }}" |