generated from ConductionNL/commonground-example
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 2.78 KB
/
helmUpgrade.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
name: Helm Upgrade
on:
repository_dispatch:
types: [start-upgrade-workflow]
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setting APP_NAME
run: |
export NAME=$(grep APP_NAME= .env | cut -d '=' -f2)
echo ::set-env name=APP_NAME::$NAME
- name: Set APP_ENV
run: |
export ENV=${{ github.event.client_payload.environment }}
echo ::set-env name=APP_ENV::$ENV
- name: Set DEBUG
run: echo ::set-env name=DEBUG::${{ github.event.client_payload.debug }}
- name: Set AUTH_KEY
run: |
export CACHE=${{ github.event.client_payload.cache }}
echo ::set-env name=APP_CACHE::$CACHE
- name: Set APP_DOMAIN
run: |
export DOMAIN="${{ github.event.client_payload.domain }}"
echo ::set-env name=APP_DOMAIN::$DOMAIN
- name: Set DB_URL
run: |
export DBURL="${{ github.event.client_payload.dburl }}"
echo ::set-env name=DB_URL::$DBURL
# Het volgende moeten we misschien naar de secrets verkassen
- name: Set AUTH_KEY
run: |
export AUTHKEY=${{ github.event.client_payload.authorization }}
echo ::set-env name=AUTH_KEY::$AUTHKEY
# - name: Print variables
# run: |
# printf "APP_NAME: \t\t $APP_NAME\nAPP_ENV: \t\t $APP_ENV\nDEBUG: \t\t $DEBUG\nAPP_DOMAIN: \t\t $APP_DOMAIN\nDB_URL: \t\t $DB_URL\nAUTH_KEY: \t\t $AUTH_KEY"
- name: Create kube config
id: kubeconfig
run: |
if [ "${{ github.event.client_payload.kubeconfig }}" != "" ]; then
printf "${{ github.event.client_payload.kubeconfig }}" > kubeconfig.yaml
echo "##[set-output name=success]true"
else
echo "##[set-output name=success]false"
fi
- name: Set correct helm version
if: steps.kubeconfig.outputs.success == 'true'
run: curl -L https://git.io/get_helm.sh | bash -s -- --version v2.12.3
# - run: helm version
- name: Helm Install
if: steps.kubeconfig.outputs.success == 'true'
run: |
helm upgrade $APP_NAME-$APP_ENV ./api/helm --namespace=$APP_ENV --kubeconfig=./kubeconfig.yaml --set settings.debug=$DEBUG,settings.env=$APP_ENV,settings.domain="$APP_DOMAIN",settings.cache="$APP_CACHE",security.commongroundKey=$AUTH_KEY,security.applicationKey=$AUTH-KEY,postgresql.enabled=false,postgresql.url="$DB_URL"