Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Github action for release having docker Image with Tag as version number #28

Merged
merged 3 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/docker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ jobs:
gradle-packages-${{ runner.os }}-${{ github.job }}
gradle-packages-${{ runner.os }}

- name: Show Github ENV variables
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
run: env | grep ^GITHUB

- name: Build with Gradle
uses: hypertrace/github-actions/gradle@main
with:
args: dockerBuildImages
env:
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
IMAGE_TAG: ${GITHUB_SHA}

- name: Verify hypertrace image
working-directory: ./.github/workflows/hypertrace-ingester
Expand Down Expand Up @@ -86,6 +91,8 @@ jobs:
uses: hypertrace/github-actions/gradle@main
with:
args: dockerBuildImages
env:
IMAGE_TAG: ${GITHUB_SHA}

- name: Verify hypertrace image
working-directory: ./.github/workflows/hypertrace-ingester
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ jobs:
uses: hypertrace/github-actions/gradle@main
with:
args: build dockerBuildImages
env:
IMAGE_TAG: ${GITHUB_SHA}

- name: push docker image
uses: hypertrace/github-actions/gradle@main
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release artifacts
on:
# Will run when a comment is added in PR e.g. /release v0.6.40-0.1.0-beta.1
issue_comment:
types: [ created ]
workflow_dispatch:

jobs:
publish-artifacts:
if: contains(github.event.comment.html_url, '/pull') && startsWith(github.event.comment.body, '/release v')
runs-on: ubuntu-20.04
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Check out code
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.PUBLIC_DOCKER_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKER_PASSWORD }}

- name: Set ENV variable
env:
RELEASE_VERSION_COMMENT: ${{ github.event.comment.body }}
run: |
echo "VERSION=${RELEASE_VERSION_COMMENT##/release\ v}" >> $GITHUB_ENV
echo "Setting tag version: ${VERSION}"

- name: Build with Gradle
uses: hypertrace/github-actions/gradle@main
with:
args: build dockerBuildImages
env:
DOCKER_USERNAME: ${{ secrets.PUBLIC_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.PUBLIC_DOCKER_PASSWORD }}
IMAGE_TAG: ${{ env.VERSION }}

- name: push docker image
uses: hypertrace/github-actions/gradle@main
with:
args: dockerPushImages
env:
DOCKER_USERNAME: ${{ secrets.PUBLIC_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.PUBLIC_DOCKER_PASSWORD }}
2 changes: 1 addition & 1 deletion hypertrace-ingester/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ hypertraceDocker {
}
namespace.set("razorpay")
}
tag("${project.name}" + "_" + getCommitHash())
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
tag("${project.name}" + "_" + System.getenv("IMAGE_TAG"))
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ hypertraceDocker {
}
namespace.set("razorpay")
}
tag("${project.name}" + "_" + getCommitHash())
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
tag("${project.name}" + "_" + System.getenv("IMAGE_TAG"))
}

fun getCommitHash(): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ hypertraceDocker {
}
namespace.set("razorpay")
}
tag("${project.name}" + "_" + getCommitHash())
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
tag("${project.name}" + "_" + System.getenv("IMAGE_TAG"))
}

fun getCommitHash(): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ hypertraceDocker {
}
namespace.set("razorpay")
}
tag("${project.name}" + "_" + getCommitHash())
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
tag("${project.name}" + "_" + System.getenv("IMAGE_TAG"))
}

fun getCommitHash(): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ hypertraceDocker {
}
namespace.set("razorpay")
}
tag("${project.name}" + "_" + getCommitHash())
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
tag("${project.name}" + "_" + System.getenv("IMAGE_TAG"))
}

// Config for gw run to be able to run this locally. Just execute gw run here on Intellij or on the console.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ hypertraceDocker {
}
namespace.set("razorpay")
}
tag("${project.name}" + "_" + getCommitHash())
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
tag("${project.name}" + "_" + System.getenv("IMAGE_TAG"))
}

tasks.test {
Expand Down
2 changes: 1 addition & 1 deletion raw-spans-grouper/raw-spans-grouper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ hypertraceDocker {
}
namespace.set("razorpay")
}
tag("${project.name}" + "_" + getCommitHash())
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
tag("${project.name}" + "_" + System.getenv("IMAGE_TAG"))
}

// Config for gw run to be able to run this locally. Just execute gw run here on Intellij or on the console.
Expand Down
2 changes: 1 addition & 1 deletion span-normalizer/span-normalizer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ hypertraceDocker {
}
namespace.set("razorpay")
}
tag("${project.name}" + "_" + getCommitHash())
TriptiTripathi1234 marked this conversation as resolved.
Show resolved Hide resolved
tag("${project.name}" + "_" + System.getenv("IMAGE_TAG"))
}

// Config for gw run to be able to run this locally. Just execute gw run here on Intellij or on the console.
Expand Down