-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (86 loc) · 3.42 KB
/
test_stack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
##
## Copyright (c) 2019 Matthias Tafelmeier.
##
## This file is part of godon
##
## godon is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as
## published by the Free Software Foundation, either version 3 of the
## License, or (at your option) any later version.
##
## godon is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Affero General Public License for more details.
##
## You should have received a copy of the GNU Affero General Public License
## along with this godon. If not, see <http://www.gnu.org/licenses/>.
##
on:
pull_request:
types: [ labeled ]
branches:
- master
env:
INSTANCE_NAME: "ci_runner"
OS_AUTH_URL: https://oprod-controller1.osuosl.org:5000/v3
OS_PROJECT_NAME: "godon"
OS_USER_DOMAIN_NAME: "Default"
OS_PROJECT_DOMAIN_ID: "default"
OS_REGION_NAME: "RegionOne"
OS_IDENTITY_API_VERSION: 3
OS_INTERFACE: public
OS_USERNAME: ${{ secrets.osuosl_openstack_user }}
OS_PASSWORD: ${{ secrets.osuosl_openstack_pw }}
GH_ACTIONS_TOKEN: ${{ secrets.gh_runner_token }}
jobs:
test_stack_rebuild_nixos:
if: ${{ contains(github.event.pull_request.labels.*.name, 'teststack') && contains(github.event.pull_request.labels.*.name, 'rebuild') }}
runs-on: [self-hosted, linux] # only unique osuosl instance
env:
image_pool_dir: "/github-runner/artifacts"
nix_config_path: "testing/infra/machines/nix/configuration.nix"
steps:
- name: build test instance nixos configuration
run: >
source /etc/bashrc;
export NIXPKGS_ALLOW_INSECURE=1
image="$(nixos-generate -f qcow -c "${nix_config_path}" | tail -n 2 | grep qcow2)";
echo "image=${image}" >> $GITHUB_ENV
- name: update image in pool
run: >
source /etc/bashrc;
cp "${image}" "${image_pool_dir}";
test_stack_recreate:
if: ${{ contains(github.event.pull_request.labels.*.name, 'teststack') && contains(github.event.pull_request.labels.*.name, 'recreate') }}
runs-on: [self-hosted, linux] # only unique osuosl instance
env:
MASK_FILE: testing/maskfile.md
steps:
- name: cleanup former stack
run: >
source /etc/bashrc;
mask --maskfile "${MASK_FILE}" infra cleanup network;
mask --maskfile "${MASK_FILE}" infra cleanup machines;
- name: reerrect stack
run: >
source /etc/bashrc;
mask --maskfile "${MASK_FILE}" infra create machines;
sleep 50;
mask --maskfile "${MASK_FILE}" config generate prometheus;
mask --maskfile "${MASK_FILE}" config generate breeder "./examples/network_gen.yml";
mask --maskfile "${MASK_FILE}" infra create network;
godon_recreate:
if: ${{ contains(github.event.pull_request.labels.*.name, 'godon') && contains(github.event.pull_request.labels.*.name, 'recreate') }}
runs-on: [self-hosted, linux] # only unique osuosl instance
env:
MASK_FILE: testing/maskfile.md
steps:
- name: cleanup former stack
run: >
source /etc/bashrc;
mask --maskfile "${MASK_FILE}" godon cleanup;
- name: reerrect stack
run: >
source /etc/bashrc;
mask --maskfile "${MASK_FILE}" godon create;