-
Notifications
You must be signed in to change notification settings - Fork 16
47 lines (43 loc) · 1.66 KB
/
upgrade-2-5.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
name: Upgrade 2.5
on:
repository_dispatch:
types:
- geomapfish_25_updated
jobs:
upgrade:
runs-on: ubuntu-24.04
name: Upgrade 2.5
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
ref: 'prod-2-5'
token: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}
- name: Update the demo
run: scripts/upgrade ${{ github.event.client_payload.version }} origin
- name: Push interrupted Upgrade
run: |
ls -als .UPGRADE*
git add --all || true
git add --force .UPGRADE_INSTRUCTIONS upgrade .upgrade.yaml || true
git status
git commit -m "Interrupted upgrade to ${{ github.event.client_payload.version }}"
git push --force origin HEAD:interrupted-upgrade-${{ github.event.client_payload.version }}
python3 -c 'import requests
response = requests.post(
"https://api.github.com/repos/camptocamp/demo_geomapfish/pulls",
json={
"title": "Upgrade failed",
"body": "See https://github.com/camptocamp/demo_geomapfish/actions?query=workflow%3A%22Upgrade+2.5%22",
"head": "interrupted-upgrade-${{ github.event.client_payload.version }}",
"base": "prod-2-5",
"maintainer_can_modify": True
},
headers={
"Accept": "application/vnd.github.v3+json",
"Authorization": "Bearer ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}",
"Content-Type": "application/json",
},
)
assert response.status_code < 300, response.text'
if: failure()