feat: Add GitHub Action to deprovision an ephemeral environment#4
Conversation
| with: | ||
| server: ${{ inputs.server || vars.TEST_INSTANCE_URL }} | ||
| service_account_id: ${{ inputs.service_account_id || vars.TEST_INSTANCE_SERVICE_ACCOUNT_ID }} | ||
|
|
There was a problem hiding this comment.
It could be nice if we could add a step in here which creates an EE and waits for it to deploy.
But we would need to output the provisioning and deployment server task ids from the create action so we could wait for them to complete...
There was a problem hiding this comment.
Actually, not so much. The environment is created, but it is not provisioned or deployed at this time. When you manually create a deployment, the provisioning is kicked off. So, waiting for the deployment server task to complete would be enough
There was a problem hiding this comment.
Oh yeah, true. Just the deployment task id then. But I don't think we can access it here.
There was a problem hiding this comment.
You would need to create a release and deployment using those actions
There was a problem hiding this comment.
This is a job for our future selves 🔮✨
|
This pull request has been linked to Shortcut Story #124036: Support deprovisioning an entire ephemeral environment. |
a90f597 to
b7375e4
Compare
| @@ -1,4 +1,42 @@ | |||
| name: Test Deprovision Ephemeral Environment | |||
| name: Test Deprovision Environment | |||
There was a problem hiding this comment.
Long name doesn't fit on GH actions list.
317680d to
23b413a
Compare
| }, | ||
| ], | ||
| }; | ||
|
|
There was a problem hiding this comment.
Matches the create action and runs tests 👍
ed0e491 to
1aeea20
Compare
| @@ -1,5 +1,5 @@ | |||
| node_modules/ | |||
| dist/ | |||
| out/ | |||
There was a problem hiding this comment.
Code gets compiled to 'out/' and then ncc bundles it to 'dist/'. We commit 'dist/' and it is run by the action 👍
47224b8 to
0f59b70
Compare
What's this? 🐕
This adds a first iteration of our Octopus GitHub action to deprovision an ephemeral environment.
Action inputs:
Values for space name, server URL and API key (or OIDC access key) can also be supplied using environment variables. In the case where an input and env var are both provided, the environment variables takes precedence.
Action outputs:
The action outputs a JSON string containing a
runbookRunIdandserverTaskIdfor each deprovisioning runbook run. This is consistent with the format we use in thecreate-runbook-runGitHub Action which outputs a JSON string of objects containing aserverTaskId,environmentIdandtenantId.By outputting the
serverTaskId, we enable users to wait for their deprovisioning tasks to run using theawait-taskGitHub Action.Test workflow
This change includes a test workflow which can be run manually from the Actions tab of this repository. It takes the same inputs as the action listed about. If login information is not supplied to the test workflow, it defaults to using the
team-githubtest instance. The server URL and OIDC service account Id for the test instance are stored on the repo as a repository secret and variable.🚩 Currently the default OIDC identity details used by the action are pointing to this branch.
mainbranch after merging.Testing 🧪
The workflow included with this action was tested using the freshly updated team-github test instance. Feel free to try it out yourself!
The action has been tested using both OIDC login (as per the test workflow) and API-keys.
How to review? 🔍
✔️ Code quality
🧪 To test, create an EE and provide the name when running the 'Test Deprovision Environment' workflow. If using an instance other than the one linked above, you will need to provide an instance URL and API-key/ service account.
Fixes[sc-124036]