-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update CICD * Unbuilt .qvf files into /diff --------- Co-authored-by: qlik[bot] <username@users.noreply.github.com>
- Loading branch information
Showing
33 changed files
with
24,222 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Comment on PR | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: [ "main" ] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
verify: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
if: ${{ github.actor != 'dependabot[bot]' }} && ${{ github.actor != 'renovate[bot]' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Retrieve app name from release config | ||
run: | | ||
APPNAME=$(jq -r '.name' "release.json") | ||
echo "APPNAME=$APPNAME" >> $GITHUB_ENV | ||
- name: PR comment with file | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
mode: upsert | ||
comment_tag: previewComment | ||
message: | | ||
# PR checklist | ||
Checklist: | ||
- [ ] Is the name of this app/solution still `${{ env.APPNAME }}`? | ||
- [ ] Have you updated the version tag in each .qvf file, and followed semantic versioning (e.g. v1.1.1)? | ||
- [ ] Is this PR named appropriately? For example: | ||
- Feature release: `feat: add sheet usage event` | ||
- Bug fix: `fix: replaced deprecated events` | ||
- Documentation update: `docs: updated images in install guide` | ||
- [ ] Have you reviewed the unbuilt diff generated by the workflow in /diff? | ||
If you wish to merge and release: | ||
- Have this PR approved by a code owner, then merge into main | ||
- Go to releases, an action will generate a draft release with all files in /assets, and any external assets references in `release.json` | ||
- Make any updates, then submit the release | ||
Common issues: | ||
- After merging, draft release doesn't update - this is usually because | ||
the action failed due to an old draft release with the same name. | ||
Delete the draft release, and re-run the action. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: Unbuild app | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: [ "main" ] | ||
paths: | ||
- 'assets/**' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
unbuild: | ||
runs-on: ubuntu-22.04 | ||
if: ${{ github.actor != 'dependabot[bot]' }} && ${{ github.actor != 'renovate[bot]' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- 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.25.0/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 ${{ secrets.QLIK_CLOUD_MONITORING_TENANT }} \ | ||
--oauth-client-id ${{ secrets.QLIK_CLOUD_MONITORING_OAUTH_ID }} \ | ||
--oauth-client-secret ${{ secrets.QLIK_CLOUD_MONITORING_OAUTH_SECRET }} \ | ||
--server-type cloud | ||
- name: Select context | ||
run: ./qlik context use veritenant | ||
|
||
- name: Delete any existing diff dir | ||
run: rm -rf diff | ||
|
||
- name: Config git | ||
run: | | ||
git config --global user.name "qlik[bot]" | ||
git config --global user.email "username@users.noreply.github.com" | ||
- name: Unbuild apps | ||
run: | | ||
shopt -s globstar nocaseglob | ||
qUrl_list=() | ||
for FILE in ./assets/*.qvf; do | ||
FILENAME=$(basename "$FILE") | ||
cp "$FILE" ./import.qvf # Handle for weird filenames and qlik-cli handling | ||
APP_ID=$(./qlik raw post v1/apps/import --body-file "./import.qvf" | jq -r '.attributes.id') | ||
echo "Imported appId $APP_ID" | ||
./qlik app unbuild --app "$APP_ID" --dir "./diff/$FILENAME" --no-data | ||
|
||
REPLACE_STRING="<appId>" | ||
|
||
find "./diff/$FILENAME" -type f | while read -r UBFILEA; do | ||
if [[ -f "$UBFILEA" ]]; then | ||
sed -i "s/$APP_ID/$REPLACE_STRING/g" "$UBFILEA" | ||
UBFILENAME=$(basename "$UBFILEA") | ||
if [ "$(basename "$UBFILEA")" == "app-properties.json" ]; then | ||
jq 'del(.qSavedInProductVersion)' "${UBFILEA}" > "${UBFILEA}.tmp" && mv "${UBFILEA}.tmp" "${UBFILEA}" | ||
jq 'del(.qLastReloadTime)' "${UBFILEA}" > "${UBFILEA}.tmp" && mv "${UBFILEA}.tmp" "${UBFILEA}" | ||
fi | ||
fi | ||
done | ||
|
||
MEDIA_LIST=$(./qlik raw get "v1/apps/$APP_ID/media/list" --query "show=recursive") | ||
IMAGE_LIST=$(echo "$MEDIA_LIST" | jq '[.[] | select(.type == "image") | {name: .name, link: .link}]') | ||
IMAGE_COUNT=$(echo "$IMAGE_LIST" | jq 'length') | ||
IMAGE_STORE_PATH="./diff/$FILENAME/images" | ||
echo "Number of images found: $IMAGE_COUNT" | ||
|
||
|
||
echo "$IMAGE_LIST" | jq -c '.[]' | while read -r IMAGE; do | ||
if [ ! -d "$IMAGE_STORE_PATH" ]; then | ||
mkdir -p "$IMAGE_STORE_PATH" | ||
echo "Created directory: $IMAGE_STORE_PATH" | ||
fi | ||
|
||
IMG_NAME=$(echo "$IMAGE" | jq -r '.name') | ||
IMG_LINK=$(echo "$IMAGE" | jq -r '.link') | ||
IMG_PATH="${IMG_LINK#/api/}" | ||
echo "Retrieving image: $IMG_NAME from: $IMG_PATH" | ||
./qlik raw get "$IMG_PATH" --output-file "$IMAGE_STORE_PATH/$IMG_NAME" | ||
done | ||
|
||
./qlik app rm "$APP_ID" | ||
|
||
done <<< "$FILE" | ||
|
||
|
||
- name: Remove qlik-cli | ||
run: rm qlik | ||
|
||
- name: Commit /diff if changes | ||
run: | | ||
git add ./diff | ||
GIT_STATUS=$(git status -uno -s) | ||
if [ "$GIT_STATUS" ]; then | ||
echo "git change summary: $GIT_STATUS" | ||
git commit -m "Unbuilt .qvf files into /diff" | ||
git push | ||
else | ||
echo "No changes found in /diff, skipping commit" | ||
fi | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"qTitle": "Entitlement Analyzer v2.3.0", | ||
"qThumbnail": { | ||
"qUrl": "/api/v1/apps/<appId>/media/files/UserAnalyzer.png" | ||
}, | ||
"description": "The Entitlement Analyzer provides a comprehensive dashboard to analyze entitlement consumption and assignments across a Qlik Sense tenant(s).\n\n{v2.3.0}", | ||
"qUsage": "ANALYTICS", | ||
"published": false, | ||
"hassectionaccess": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
script: script.qvs | ||
connections: connections.yml | ||
dimensions: dimensions.json | ||
measures: measures.json | ||
objects: objects/*.json | ||
variables: variables.json | ||
app-properties: app-properties.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
connections: | ||
MyDataFiles: | ||
type: qix-datafiles.exe | ||
connectionstring: CUSTOM CONNECT TO "provider=qix-datafiles.exe;path=mydatafiles;" | ||
username: | ||
password: | ||
DataFiles: | ||
type: qix-datafiles.exe | ||
connectionstring: CUSTOM CONNECT TO "provider=qix-datafiles.exe;path=datafiles;" | ||
username: | ||
password: | ||
DataPrepAppCache: | ||
type: qix-datafiles.exe | ||
connectionstring: CUSTOM CONNECT TO "provider=qix-datafiles.exe;path=dataprepappcache;" | ||
username: | ||
password: |
Oops, something went wrong.