-
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.
MRG: Merge pull request #14 from octue/use-truncated-branch-or-pull-n…
…ame-in-revision-tag Use truncated branch or pull request name for revision tag for non-main deployments
- Loading branch information
Showing
5 changed files
with
28 additions
and
7 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ FROM python:3.10.7-slim | |
|
||
RUN apt-get update -y && apt-get install -y --fix-missing curl git && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip3 install git+https://github.com/octue/[email protected].1 | ||
RUN pip3 install git+https://github.com/octue/[email protected].2 | ||
|
||
COPY get_deployment_info/entrypoint.sh /entrypoint.sh | ||
|
||
|
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 |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
|
||
# Get deployment info | ||
|
||
A GitHub action that gets the information needed to build and deploy an Octue service to the cloud. This information is | ||
extracted and/or generated from: | ||
A GitHub action that gets the information needed to build and deploy an Octue service to the cloud from a | ||
main/production branch or a non-main/development branch. The required information is extracted and/or generated from: | ||
|
||
- The action inputs | ||
- `git` | ||
|
@@ -25,7 +25,7 @@ steps: | |
|
||
- name: Get deployment info | ||
id: get-deployment-info | ||
uses: octue/[email protected].1 | ||
uses: octue/[email protected].2 | ||
with: | ||
gcp_project_name: test-project | ||
gcp_project_number: 1234 | ||
|
@@ -48,6 +48,8 @@ Outputs can be accessed in the usual way. For example, to print all the outputs: | |
echo ${{ steps.get-deployment-info.outputs.image_version_tag }} | ||
echo ${{ steps.get-deployment-info.outputs.short_sha }} | ||
echo ${{ steps.get-deployment-info.outputs.version_slug }} | ||
echo ${{ steps.get-deployment-info.outputs.revision_tag }} | ||
echo ${{ steps.get-deployment-info.outputs.revision_tag_slug }} | ||
echo ${{ steps.get-deployment-info.outputs.gcp_environment }} | ||
echo ${{ steps.get-deployment-info.outputs.gcp_project_name }} | ||
echo ${{ steps.get-deployment-info.outputs.gcp_project_number }} | ||
|
@@ -59,3 +61,22 @@ Outputs can be accessed in the usual way. For example, to print all the outputs: | |
Note: there's no need to print the outputs for debugging in practice - the action prints them to `stdout` for this very | ||
purpose. | ||
|
||
## Main vs non-main branch deployments | ||
|
||
Some of the outputs' values depend on whether the action is run on the `main` branch or a non-`main` branch. | ||
|
||
### Main branch deployments | ||
|
||
- `revision_tag` is `<version>` | ||
- `image_version_tag` is `main-<version>` | ||
- `image_latest_tag` is `main-latest` | ||
|
||
### Non-main branch deployments | ||
|
||
The truncated branch name (first 12 characters) is used to ensure service names are short enough to be accepted by e.g. | ||
Cloud Run without having to restrict the length of branch names. | ||
|
||
- `revision_tag` is `pull-<truncated branch_tag_kebab>` | ||
- `image_version_tag` is `pull-<truncated branch_tag_kebab>` | ||
- `image_latest_tag` is `pull-<truncated branch_tag_kebab>-latest` |
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 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 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "get-deployment-info" | ||
version = "0.2.1" | ||
version = "0.2.2" | ||
description = "A Github Action that gets the information required to build and deploy an Octue service." | ||
authors = ["Marcus Lugg <[email protected]>"] | ||
readme = "README.md" | ||
|