-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(devops): Deploy to test environments via CI #3572
base: main
Are you sure you want to change the base?
Conversation
if [[ "$NETWORK" = test_be_* ]] && [[ "$CANISTER" != "backend" ]] ; then | ||
echo "Only a backend may be deployed to test_be_* networks" | ||
exit 1 | ||
fi |
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.
maybe just a final ECHO if all checks passed for policy? as feedback for the dev
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.
@@ -62,25 +56,50 @@ jobs: | |||
echo "CANISTER=${{ github.event.inputs.canister }}" >> $GITHUB_ENV | |||
fi | |||
|
|||
- name: Check release policy | |||
run: | | |||
if [[ "$NETWORK" == "staging" ]] && [[ "${{ github.ref }}" != "refs/heads/main" ]] ; then |
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.
should this include the check for beta?
for example, the check could pass if the network is beta, but the ref is not main, no? am i missing something?
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.
There is no rule that beta may have only head of main. Indeed, there is an explicit expectation that we should be able to put feature branches and release candidates (that may not be head of main) on beta.
I have proposed that we have a test environment that always holds the latest release candidate (so that would be the latest tag of the form 1.2.3-rc-4), which is effectively what beta has most of the time at the moment, however that has not been approved.
@@ -142,6 +161,7 @@ jobs: | |||
dfx identity import --disable-encryption --force default "$key_pem" | |||
rm "$key_pem" | |||
dfx identity use default | |||
dfx identity get-principal |
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.
this is just a "good to have", right? it will print the principal so that we have more info, that's the idea?
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.
Correct. It is not enough for the code to be correct, we need to be able to verify that it is working correctly. It's hard to verify that the expected principal is being used when it's invisible. :-) Another point where we need better visibility for verification is the env vars, but that will be a bigger change so I didn't commit that.
Co-authored-by: Antonio Ventilii <[email protected]>
Motivation
Deploying to test environments is typically hard to get right. We would like:
Changes
Configuration:
Tests
gh workflow run deploy-to-environment.yml --ref staging-ii --field network=test_fe_3 --field canister=frontend