blob: 576e8e2a02654738ed9b8f7b7c78bac777430de5 [file] [log] [blame]
Rico Lin83565552024-07-05 22:59:02 +08001# 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 Lin83565552024-07-05 22:59:02 +080020 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 Naser6080c9b2024-07-18 10:43:09 -040027 - name: Run molecule with existing branch
Mohammed Naser6080c9b2024-07-18 10:43:09 -040028 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 Lin83565552024-07-05 22:59:02 +080036
37 - name: Checkout to "{{ zuul.branch }}" branch
Rico Lin83565552024-07-05 22:59:02 +080038 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 Naser6080c9b2024-07-18 10:43:09 -040045 - name: Upgrade cloud to "{{ zuul.branch }}"
Mohammed Naser6080c9b2024-07-18 10:43:09 -040046 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 Naser6080c9b2024-07-18 10:43:09 -040056 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 }}"