Skip to content

Commit

Permalink
okr #921: fix afterMigrate script
Browse files Browse the repository at this point in the history
+ add deploy demo on push
+ tmp disable updating yaml file
+ remove champion usernames from application-demo.properties
  • Loading branch information
janikEndtner committed Jul 5, 2024
1 parent 1835ac6 commit 577cc07
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/demo-deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
types:
- closed
branches: [ multitenancy_main ]
push:
branches: [ multitenancy_main ]

jobs:
update-version:
if: github.event.pull_request.merged == true
# if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
outputs:
okr-docker-image: ${{ vars.NEW_VALUE_URL }}:${{ steps.store-version.outputs.version}}-DEMO
Expand Down Expand Up @@ -195,15 +197,15 @@ jobs:
wget -q https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - |\
tar xz && mv ${BINARY} /usr/local/bin/yq
- name: Update YAML file
shell: bash
env:
COMMITPREFIX: '[CTS]'
run: |
curl -s --header "PRIVATE-TOKEN: ${{secrets.GITLAB_ACCESS_TOKEN}}" "${{vars.TARGET_GITLAB_REPOSITORY}}/files/deployments/overlays/demo/okr-demo-deploy.yaml?ref=${{vars.TARGET_GITLAB_REFERENCE}}" -H "Accept: application/json" -H "Content-Type: application/json" | jq -r '.content' | base64 --decode > response.yaml
yq -i "${{vars.YAML_PATH}} = \"${{needs.update-version.outputs.okr-docker-image}}\"" response.yaml
UPDATED_CONTENT=$(cat response.yaml)
curl --request PUT --header 'PRIVATE-TOKEN: ${{secrets.GITLAB_ACCESS_TOKEN}}' -F "branch=${{vars.TARGET_GITLAB_REFERENCE}}" -F "[email protected]" -F "author_name=GitLab Actions" -F "content=${UPDATED_CONTENT}" -F "commit_message=$COMMITPREFIX Automated changes to ${{vars.FILEPATH_COMMIT}}" "${{vars.TARGET_GITLAB_REPOSITORY}}/files/deployments/overlays/demo/okr-demo-deploy.yaml"
# - name: Update YAML file
# shell: bash
# env:
# COMMITPREFIX: '[CTS]'
# run: |
# curl -s --header "PRIVATE-TOKEN: ${{secrets.GITLAB_ACCESS_TOKEN}}" "${{vars.TARGET_GITLAB_REPOSITORY}}/files/deployments/overlays/demo/okr-demo-deploy.yaml?ref=${{vars.TARGET_GITLAB_REFERENCE}}" -H "Accept: application/json" -H "Content-Type: application/json" | jq -r '.content' | base64 --decode > response.yaml
# yq -i "${{vars.YAML_PATH}} = \"${{needs.update-version.outputs.okr-docker-image}}\"" response.yaml
# UPDATED_CONTENT=$(cat response.yaml)
# curl --request PUT --header 'PRIVATE-TOKEN: ${{secrets.GITLAB_ACCESS_TOKEN}}' -F "branch=${{vars.TARGET_GITLAB_REFERENCE}}" -F "[email protected]" -F "author_name=GitLab Actions" -F "content=${UPDATED_CONTENT}" -F "commit_message=$COMMITPREFIX Automated changes to ${{vars.FILEPATH_COMMIT}}" "${{vars.TARGET_GITLAB_REPOSITORY}}/files/deployments/overlays/demo/okr-demo-deploy.yaml"

generate-and-push-sbom:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion backend/src/main/resources/application-demo.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ spring.security.oauth2.resourceserver.opaquetoken.client-id=pitc_okr_demo
# flyway fill database with demo data
spring.flyway.locations=classpath:db/migration,classpath:db/data-migration-demo,classpath:db/callback

okr.user.champion.usernames=peggimann
okr.clientcustomization.customstyles.okr-topbar-background-color=#fa8072
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ values (1, '1'), -- last past quarter
(8, '8'), -- future quarter
(999, 'Backlog');

insert into person (id, email, firstname, lastname, username, version, is_okr_champion)
values (1, '[email protected]', 'Paco', 'Eggimann', 'peggimann', 1, FALSE),
(11, '[email protected]', 'Alice', 'Wunderland', 'alice', 1, FALSE),
(21, '[email protected]', 'Bob', 'Baumeister', 'bob', 1, FALSE),
(31, '[email protected]', 'Findus', 'Peterson', 'findus', 1, FALSE),
(41, '[email protected]', 'Paco', 'Egiman', 'paco', 1, FALSE),
(51, '[email protected]', 'Robin', 'Papierer', 'robin', 1, FALSE);
(61, '[email protected]', 'gl', 'gl', 'gl', 1, TRUE);
insert into person (id, email, firstname, lastname, version, is_okr_champion)
values (1, '[email protected]', 'Paco', 'Eggimann', 1, FALSE),
(11, '[email protected]', 'Alice', 'Wunderland', 1, FALSE),
(21, '[email protected]', 'Bob', 'Baumeister', 1, FALSE),
(31, '[email protected]', 'Findus', 'Peterson', 1, FALSE),
(41, '[email protected]', 'Paco', 'Egiman', 1, FALSE),
(51, '[email protected]', 'Robin', 'Papierer', 1, FALSE),
(61, '[email protected]', 'gl', 'gl', 1, TRUE);

insert into team (id, name, version)
values (4, '/BBT', 1),
Expand Down

0 comments on commit 577cc07

Please sign in to comment.