-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (66 loc) · 2.73 KB
/
unbuild_app.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
name: Unbuild app
on:
pull_request:
types: [opened, synchronize]
branches: [ "main" ]
workflow_dispatch:
jobs:
unbuild:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Retrieve app name from APPNAME
run: |
APPNAME=$(cat APPNAME)
echo "APPNAME=$APPNAME" >> $GITHUB_ENV
- name: Checkout repo
run: echo ${{ github.triggering_actor }}
- name: Download qlik-cli and unzip
run: |
wget https://github.com/qlik-oss/qlik-cli/releases/download/v2.20.3/qlik-Linux-x86_64.tar.gz -O qlik-cli.tar.gz
# Unzip archive
tar -xf qlik-cli.tar.gz
# Remove archive
rm qlik-cli.tar.gz
# Update permissions to execute
chmod +x qlik
- name: Retrieve qlik-cli version
run: ./qlik version
- name: Create context in qlik-cli
run: |
./qlik context create veritenant \
--server ${{ vars.TENANT }} \
--oauth-client-id ${{ vars.OAUTH_ID }} \
--oauth-client-secret ${{ secrets.OAUTH_SECRET }} \
--server-type cloud
- name: Select context
run: ./qlik context use veritenant
- name: Retrieve debugging info
run: |
ls -lh "./app/${{ env.APPNAME }}.qvf"
./qlik user me
- name: Import app to tenant
run: |
APP_ID=$(./qlik raw post v1/apps/import --body-file "./app/${{ env.APPNAME }}.qvf" | jq -r '.attributes.id')
echo "APP_ID=$APP_ID" >> $GITHUB_ENV
echo "Imported appId ${{ env.APP_ID }}"
- name: Delete any existing src dir
run: rm -rf src
- name: Unbuild app to ./src
run: |
./qlik app unbuild --app ${{ env.APP_ID }} --dir './src' --no-data
ls -lh "./src"
- name: Delete app from tenant
run: ./qlik app rm ${{ env.APP_ID }}
- name: Remove qlik-cli
run: rm qlik
# No check for push as github token won't trigger an action re-run
- name: Commit new .src
run: |
git config --global user.name "UnbuildBot Automation"
git config --global user.email "[email protected]"
git add src
git commit -m "Automated unbuild of app into /src"
git push