-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (99 loc) · 4.94 KB
/
night.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Night
on:
workflow_dispatch:
schedule:
- cron: '20 4 * * 2'
push:
branches:
- fix/night-workflow
jobs:
night:
name: Night
runs-on: ubuntu-22.04
steps:
- name: (PREPARE) Checkout Repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Setup Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}"
- name: (PREPARE) Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v1
- name: (PREPARE) Setup GCP credentials
uses: actions/github-script@v3
with:
script: |
if (!process.env.GCP_CREDENTIALS) throw 'GCP_CREDENTIALS undefined'
const fs = require('fs')
const file = 'gcp-credentials.json'
const content = new Buffer.from(process.env.GCP_CREDENTIALS, 'base64').toString('utf-8')
fs.writeFileSync(file, content)
env:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
- name: (PREPARE) Setup Terraform
uses: actions/github-script@v3
with:
script: |
if (!process.env.TERRAFORM_API_TOKEN) throw 'TERRAFORM_TOKEN undefined'
const fs = require('fs')
const path = require('path')
const dir = path.resolve(process.env.HOME, '.terraform.d')
const file = path.resolve(dir, 'credentials.tfrc.json')
const content = JSON.stringify({
"credentials": {
"app.terraform.io": {
"token": process.env.TERRAFORM_API_TOKEN
}
}
}, null, 4)
fs.mkdirSync(dir)
fs.writeFileSync(file, content)
env:
TERRAFORM_API_TOKEN: ${{ secrets.TERRAFORM_API_TOKEN }}
- name: (PREPARE) Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
cache: pip
- name: (PREPARE) Install xOpera
run: pip install opera==0.6.9
- name: (PREPARE) Cache Unfurl
uses: actions/cache@v3
with:
path: /home/runner/.unfurl_home
key: unfurl-home
- name: (PREPARE) Install Unfurl
run: |
pip install unfurl==0.7.1
yes | unfurl home --init
- name: (INSTALLATION) Install vintner
run: curl -fsSL https://vintner.opentosca.org/install.sh | sudo bash -
- name: (INSTALLATION) Verify signature
run: |
curl https://vintner.opentosca.org/vintner-release.gpg | gpg --import
wget https://github.com/opentosca/opentosca-vintner/releases/download/latest/vintner-linux-x64.asc
gpg --verify vintner-linux-x64.asc /usr/bin/vintner
- name: (INSTALLATION) Test setup
run: |
vintner --version
vintner setup init
vintner setup benchmark --seeds 10 250
# GitHub runner seems not to support ipv6, thus, we can not test on bwCloud.
# See https://github.com/actions/runner-images/issues/668
- name: (EXAMPLES) Deploy the enterprise plan of unfurl-artifacts on GCP
id: unfurl-artifacts-deploy
run: |
vintner orchestrators init unfurl
vintner orchestrators enable --orchestrator unfurl
vintner templates import --template artifacts --path examples/unfurl-artifacts
vintner instances create --instance artifacts --template artifacts
vintner instances resolve --instance artifacts --inputs examples/unfurl-artifacts/tests/enterprise/inputs.yaml
echo "gcp_credentials: $(pwd)/gcp-credentials.json" > examples/unfurl-artifacts/deployment-inputs.ignored.yaml
vintner instances deploy --instance artifacts --inputs examples/unfurl-artifacts/deployment-inputs.ignored.yaml
- name: (EXAMPLES) Test the enterprise plan of unfurl-artifacts on GCP
run: curl https://shop-dot-stoetzms-387808.ey.r.appspot.com
- name: (EXAMPLES) Undeploy the enterprise plan of unfurl-artifacts on GCP
run: vintner instances undeploy --instance artifacts
if: failure() && (steps['unfurl-artifacts-deploy']outcome == 'failure' || steps['unfurl-artifacts-deploy']outcome == 'success')