Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
test release-by-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
seglo committed Apr 7, 2022
1 parent f1cb416 commit 4edc29b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

## Historical Change Log

**For new change log entries see [CHANGELOG.md](CHANGELOG.md)
*For new change log entries see [CHANGELOG.md](CHANGELOG.md)*

0.6.8

Expand Down
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,22 +564,11 @@ helm install ./charts/kafka-lag-exporter \

## Release

### Pre-requisites
The release process is run when a new tag is pushed to the repository. Release steps:

The release process is orchestrated by the [`sbt-release`](https://github.com/sbt/sbt-release). Privileged access is
required. Before running a release make sure the following pre-req's are met.

* Authenticated with Docker Hub with the `docker` command.
* Authenticated with GitHub
* `~/.netrc` file setup with GitHub credentials/token

### Release steps

1. Update the Change log
1. Run `doctoc README.md`
1. Run `sbt release`. To see what steps are performed during release consult the `build.sbt`.
1. Update change log `docker run -it --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator -u seglo -p kafka-lag-exporter -t $GITHUB_TOKEN --no-unreleased --since-tag v0.6.7`
1. Review the GitHub release draft and submit it.
1. Push a new tag `git tag -a v0.7.0 -m "v0.7.0" && git push origin --tags`

## Change log

Expand Down
23 changes: 12 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ lazy val kafkaLagExporter =
dockerCommands := {
// OCI Image Spec Annotations
// https://github.com/opencontainers/image-spec/blob/main/annotations.md
val labels = Map(
val labelsStr = Map(
"org.opencontainers.image.title" -> name.value,
"org.opencontainers.image.description" -> description.value,
"org.opencontainers.image.vendor" -> organizationName.value,
Expand All @@ -76,10 +76,11 @@ lazy val kafkaLagExporter =
"org.opencontainers.image.authors" -> maintainer.value,
"org.opencontainers.image.url" -> homepage.value.get.toString,
"org.opencontainers.image.version" -> version.value,
"org.opencontainers.image.licenses" -> licenses.value
.map(l => l._1 + ": " + l._2)
.mkString(", ")
).map(l => Cmd("LABEL", l._1 + "=\"" + l._2 + "\""))
"org.opencontainers.image.licenses" -> licenses.value.map(l => l._1 + ": " + l._2).mkString(", ")
)
.map(l => l._1 + "=\"" + l._2 + "\"")
.mkString(", \\\n")
val labels = Cmd("LABEL", labelsStr)
val dockerBaseDirectory = (Docker / defaultLinuxInstallLocation).value
val layerIdsAscending = (Docker / dockerLayerMappings).value
.map(_.layerId)
Expand All @@ -94,14 +95,15 @@ lazy val kafkaLagExporter =
Cmd("COPY", s"$path /$files")
}
Seq(Cmd("FROM", "redhat/ubi8")) ++
labels ++ Seq(
Seq(
Cmd(
"RUN",
"yum -y install java-17-openjdk-headless && yum update -y && yum clean all -y"
),
Cmd("RUN", "useradd -r -m -u 1001 kafkalagexporter")
) ++
layerCopy ++ Seq(
labels,
Cmd(
"RUN",
"chgrp -R 1001 /opt && chmod -R g=u /opt && chmod +x /opt/docker/bin/kafka-lag-exporter"
Expand Down Expand Up @@ -129,17 +131,17 @@ lazy val kafkaLagExporter =
lintHelmChart, // Lint the Helm Chart for errors
checkSnapshotDependencies,
inquireVersions,
// runClean,
// runTest,
runClean,
runTest,
setReleaseVersion,
updateHelmChartRelease, // Update the Helm Chart
publishDockerImage, // Publish the Docker images used by the chart
packageChart, // Package the Helm Chart
buildChartsIndex, // Build Helm Charts index
buildChartsIndex, // Build Helm Charts index
packageJavaApp, // Package the standalone Java App
updateReadmeRelease, // Update the README.md with this version
setNextVersion,
updateHelmChartNextVersion, // Update the Helm Chart with the next snapshot version
updateHelmChartNextVersion // Update the Helm Chart with the next snapshot version
)
)

Expand Down Expand Up @@ -242,7 +244,6 @@ lazy val updateReadmeRelease = ReleaseStep(action = st => {
st
})


lazy val packageChart = ReleaseStep(action = st => {
exec("./scripts/package_chart.sh", "Error while packaging Helm Chart")
st
Expand Down

0 comments on commit 4edc29b

Please sign in to comment.