-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template updates #8
Changes from 12 commits
498674f
e11ceb0
2a0fe17
3a6fdf2
50216b0
96c5b4d
d3320fa
f586922
0192071
f7bf729
b5e2556
c4d4c40
7b5cd3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,8 @@ jobs: | |
- name: Install and configure poetry | ||
run: | | ||
pipx install poetry | ||
poetry config virtualenvs.create false | ||
# PermissionERror in Python creating ... a directory?! | ||
# poetry config virtualenvs.create false | ||
|
||
- if: github.event.inputs.cluster == 'prod' | ||
run: | | ||
|
@@ -51,19 +52,40 @@ jobs: | |
- name: Install package | ||
run: poetry install | ||
|
||
- name: Install jq for fingerprinter | ||
run: sudo apt-get -y install jq | ||
|
||
- name: Update env with promotion version that was provided | ||
if: github.event.inputs.version | ||
run: echo "target_version=${{ github.event.inputs.version }}" >> $GITHUB_ENV | ||
|
||
- name: Update env with promotion version if not provided | ||
if: '! env.target_version' | ||
shell: bash | ||
run: | | ||
source ./scripts/globals.sh | ||
target_version=$(get_promotion_version ${{ github.event.inputs.cluster }}) | ||
echo "target_version=${target_version}" >> $GITHUB_ENV | ||
# $1 will be package name, $2 will be current version | ||
set $(poetry version) | ||
|
||
case "${{ github.event.inputs.cluster }}" in | ||
dev) | ||
version="$2" | ||
echo "Would set version to '$version' (from poetry version)" | ||
;; | ||
eval) | ||
# substitute '_' for '-' in APP_NAME | ||
url="https://${1//_/-}.iamdev.s.uw.edu/status" | ||
version=$(curl --silent $url | python -c "import json, sys; print(json.load(sys.stdin)['version'])") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you hate this and want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm totally good with this |
||
echo "After consulting dev the eval version will be ${version}" | ||
;; | ||
prod) | ||
# substitute '_' for '-' in APP_NAME | ||
url="https://${1//_/-}.iameval.s.uw.edu/status" | ||
version=$(curl --silent $url | python -c "import json, sys; print(json.load(sys.stdin)['version'])") | ||
echo "After consulting eval the prod version will be ${version}" | ||
;; | ||
*) | ||
echo "Invalid cluster! Pick one of dev|eval|prod" | ||
exit 1 | ||
;; | ||
esac | ||
echo "target_version=${version}" >> $GITHUB_ENV | ||
|
||
- name: Auth to Google Cloud | ||
# important! this 'auth' is referenced as `steps.auth` on the next job | ||
|
@@ -80,10 +102,14 @@ jobs: | |
run: |- | ||
echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev | ||
|
||
- name: Deploy version ${{ env.target_version }} | ||
- name: Tag version ${{ env.target_version }} for ${{ github.event.inputs.cluster }} | ||
id: deploy | ||
run: | | ||
echo "::notice::Deploying appid version ${{ env.target_version }} to ${{ github.event.inputs.cluster }}" | ||
./scripts/build.sh \ | ||
--deploy ${{ inputs.cluster }} \ | ||
-dversion ${{ env.target_version }} | ||
# timestamp and deploy_tag are not DRY - see also release-on-push-to-main.yaml | ||
timestamp=$(date --utc +%Y.%m.%d.%H.%M.%S) | ||
deploy_tag="deploy-${{ github.event.inputs.cluster }}.${timestamp}.v${{ env.target_version }}" | ||
echo "::notice::Deploying appid version ${{ env.target_version }} to ${{ github.event.inputs.cluster }} as ${deploy_tag}" | ||
# this will create a new tag (deploy_tag) on an existing tag (env.target_version) | ||
docker buildx imagetools create \ | ||
--tag us-docker.pkg.dev/uwit-mci-iam/containers/${template:app_name_hyphen}:${deploy_tag} \ | ||
us-docker.pkg.dev/uwit-mci-iam/containers/${template:app_name_hyphen}:${{ env.target_version }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Finalize Template | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
app-name: | ||
app_name: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bugfix - caused the provided app name to always be ignored due to failed lookup |
||
required: false | ||
description: > | ||
This is the name of your app; if left blank, it will match the | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flagging that I got a
PermissionError
here on my test innovate_tagging project. I side-stepped it by commenting outpoetry config virtualenvs.create false
on the "Install and configure poetry" task