Skip to content

Commit 29e7a8f

Browse files
authored
Merge pull request #18 from octue/fix-environment-outputs
Update entrypoint.sh
2 parents c495298 + 637e582 commit 29e7a8f

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM python:3.10.7-slim
22

33
RUN apt-get update -y && apt-get install -y --fix-missing curl git && rm -rf /var/lib/apt/lists/*
44

5-
RUN pip3 install git+https://github.com/octue/[email protected].1
5+
RUN pip3 install git+https://github.com/octue/[email protected].2
66

77
COPY get_deployment_info/entrypoint.sh /entrypoint.sh
88

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ steps:
3232
gcp_region: europe-west1
3333
gcp_resource_affix: test
3434
gcp_service_name: my-test-service
35-
gcp_environment: main
3635
```
3736
3837
Outputs can be accessed in the usual way. For example, to print all the outputs:
@@ -50,7 +49,8 @@ Outputs can be accessed in the usual way. For example, to print all the outputs:
5049
echo ${{ steps.get-deployment-info.outputs.version_slug }}
5150
echo ${{ steps.get-deployment-info.outputs.revision_tag }}
5251
echo ${{ steps.get-deployment-info.outputs.revision_tag_slug }}
53-
echo ${{ steps.get-deployment-info.outputs.gcp_environment }}
52+
echo ${{ steps.get-deployment-info.outputs.gcp_environment_kebab }}
53+
echo ${{ steps.get-deployment-info.outputs.gcp_environment_screaming }}
5454
echo ${{ steps.get-deployment-info.outputs.gcp_project_name }}
5555
echo ${{ steps.get-deployment-info.outputs.gcp_project_number }}
5656
echo ${{ steps.get-deployment-info.outputs.gcp_region }}
@@ -71,6 +71,8 @@ Some of the outputs' values depend on whether the action is run on the `main` br
7171
- `revision_tag` is `<version>`
7272
- `image_version_tag` is `main-<version>`
7373
- `image_latest_tag` is `main-latest`
74+
- `gcp_environment_kebab` is `production`
75+
- `gcp_environment_screaming` is `PRODUCTION`
7476

7577
### Non-main branch deployments
7678

@@ -80,3 +82,5 @@ Cloud Run without having to restrict the length of branch names.
8082
- `revision_tag` is `<truncated branch_tag_kebab>`
8183
- `image_version_tag` is `<truncated branch_tag_kebab>`
8284
- `image_latest_tag` is `<truncated branch_tag_kebab>-latest`
85+
- `gcp_environment_kebab` is `staging`
86+
- `gcp_environment_screaming` is `STAGING`

action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ outputs:
5858
description: "If the branch is 'main', this is 'production'; otherwise it's 'staging'."
5959
gcp_environment_screaming:
6060
description: "If the branch is 'main', this is 'PRODUCTION'; otherwise it's 'STAGING'."
61+
6162
runs:
6263
using: "docker"
6364
image: "docker://octue/get-deployment-info:0.3.1"

get_deployment_info/entrypoint.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,21 @@ if [ "$BRANCH_TAG_KEBAB" = "main" ]; then
3737
REVISION_TAG=$VERSION
3838
IMAGE_VERSION_TAG="$BRANCH_TAG_KEBAB-$REVISION_TAG"
3939
IMAGE_LATEST_TAG="$BRANCH_TAG_KEBAB-latest"
40-
GCP_ENVIRONMENT_KEBAB=production >> $GITHUB_OUTPUT
41-
GCP_ENVIRONMENT_SCREAMING=PRODUCTION >> $GITHUB_OUTPUT
40+
GCP_ENVIRONMENT_KEBAB="production"
41+
GCP_ENVIRONMENT_SCREAMING="PRODUCTION"
4242
else
4343
REVISION_TAG=$(expr substr "$BRANCH_TAG_KEBAB" 1 12)
4444
IMAGE_VERSION_TAG="$REVISION_TAG"
4545
IMAGE_LATEST_TAG="$REVISION_TAG-latest"
46-
GCP_ENVIRONMENT_KEBAB=staging >> $GITHUB_OUTPUT
47-
GCP_ENVIRONMENT_SCREAMING=STAGING >> $GITHUB_OUTPUT
46+
GCP_ENVIRONMENT_KEBAB="staging"
47+
GCP_ENVIRONMENT_SCREAMING="STAGING"
4848
fi
4949

5050
echo "revision_tag=$REVISION_TAG" >> $GITHUB_OUTPUT
5151
echo "image_version_tag=$IMAGE_VERSION_TAG" >> $GITHUB_OUTPUT
5252
echo "image_latest_tag=$IMAGE_LATEST_TAG" >> $GITHUB_OUTPUT
53+
echo "gcp_environment_kebab=$GCP_ENVIRONMENT_KEBAB" >> $GITHUB_OUTPUT
54+
echo "gcp_environment_screaming=$GCP_ENVIRONMENT_SCREAMING" >> $GITHUB_OUTPUT
5355

5456
REVISION_TAG_SLUG=$(echo $REVISION_TAG | tr . -)
5557
echo "revision_tag_slug=$REVISION_TAG_SLUG" >> $GITHUB_OUTPUT

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "get-deployment-info"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
description = "A Github Action that gets the information required to build and deploy an Octue service."
55
authors = ["Marcus Lugg <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)