Skip to content

Commit

Permalink
[dash0] update .env file automatically after release
Browse files Browse the repository at this point in the history
  • Loading branch information
basti1302 committed Feb 1, 2024
1 parent 34e127e commit 217b130
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


# Images
IMAGE_VERSION=0.0.1
IMAGE_VERSION=1.0.0
IMAGE_NAME=718306648796.dkr.ecr.eu-west-1.amazonaws.com/opentelemetry-demo
TRACETEST_IMAGE_VERSION=v0.14.5

Expand Down
5 changes: 3 additions & 2 deletions .github/actions/deploy-demo/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ inputs:
containerImageVersion:
description: 'version tag of the Dash0 OTel Demo container images, e.g. 1.1.0'
required: true

runs:
using: "composite"
steps:
Expand All @@ -27,8 +28,8 @@ runs:
shell: bash
run: |
cd dash0-configuration
git add demo/environments/aws/demo-eu-west-1-demo.yaml
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "chore(otel-demo): update otel-demo image version to ${{ inputs.containerImageVersion }}"
git add demo/environments/aws/demo-eu-west-1-demo.yaml
git commit -m"chore(otel-demo): update otel-demo image version to ${{ inputs.containerImageVersion }}"
git push
27 changes: 27 additions & 0 deletions .github/actions/update-env-file/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 Dash0 Inc.
# SPDX-License-Identifier: Apache-2.0
name: Deploy Dash0 OTel Demo
description: deploy a release of the Dash0 fork of the OpenTelemetry demo
inputs:
containerImageVersion:
description: 'version tag of the Dash0 OTel Demo container images, e.g. 1.1.0'
required: true

runs:
using: "composite"
steps:
- name: check out code
uses: actions/checkout@v4
with:
ref: main

- name: update version in .env file
shell: bash
run: |
sed -i "s/^IMAGE_VERSION=[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$/IMAGE_VERSION=1.0.0/" .env
git --no-pager diff .env
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .env
git commit -m"[dash0] update image version in .env to ${{ inputs.containerImageVersion }}"
git push
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ jobs:
with:
token: ${{ secrets.REPOSITORY_FULL_ACCESS_GITHUB_TOKEN }}
containerImageVersion: ${{ github.event.release.tag_name }}

update-release-in-env-file:
runs-on: ubuntu-latest
concurrency: update-env-file
steps:
- name: update .env file
uses: ./.github/actions/update-env-file
with:
containerImageVersion: ${{ github.event.release.tag_name }}
2 changes: 1 addition & 1 deletion .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"src/featureflagservice/priv/",
"src/productcatalogservice/genproto/",
"internal/tools/",
".github/actions/deploy-demo/action.yaml"
".github/actions/**"
]
}

0 comments on commit 217b130

Please sign in to comment.