-
Notifications
You must be signed in to change notification settings - Fork 14
73 lines (68 loc) · 2.84 KB
/
update_janssen_helm_chart.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
name: updatejanshelmchart
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'charts/gluu/*'
jobs:
createPullRequest:
runs-on: ubuntu-latest
env:
HELM_DOCS_VERSION: "1.7.0"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
sudo apt-get update
sudo python3 -m pip install --upgrade pip
sudo pip3 install -r ./automation/requirements.txt
sudo apt-get update
sudo apt-get install jq
- name: install helm-docs
run: |
cd /tmp
wget https://github.com/norwoodj/helm-docs/releases/download/v${{env.HELM_DOCS_VERSION}}/helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
tar -xvf helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
sudo mv helm-docs /usr/local/sbin
- name: analyze chart
run: |
sudo bash automation/janssen_helm_chart/prepare_chart.sh
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
# TODO:add step to install and execute helm-docs
- name: Configure Git
run: |
# open branch in jannssen
git clone https://github.com/JanssenProject/jans.git
cd jans
git remote set-url origin https://mo-auto:${{ secrets.MOWORKFLOWTOKEN }}@github.com/JanssenProject/jans.git
git checkout -b cn-autoupdate-helm-charts
mkdir -p charts/janssen || echo "Directories exist"
cp -r ../charts/* charts/
git config user.name "mo-auto"
git config user.email "[email protected]"
git config --global user.signingkey "${{ steps.import_gpg.outputs.keyid }}"
git add -A
git commit -S -s -m "chore(charts): update helm package"
git push --set-upstream origin cn-autoupdate-helm-charts
MESSAGE="chore(charts): update helm package"
ASSIGNEES="moabu"
BODY="This is an automated message propagated by a change in the parent Gluu chart. It will be automerged. Don't think about touching me before reaching out to @moabu."
LABELS="area-CI,comp-charts-jans"
echo "${{ secrets.MOAUTO4_WORKFLOW_TOKEN }}" > token.txt
gh auth login --with-token < token.txt
PR=$(gh pr create --assignee "${ASSIGNEES}" --base "main" --body "${BODY}" --label "${LABELS}" --reviewer "${ASSIGNEES}" --title "${MESSAGE}")
gh pr merge --squash --auto "${PR}"