Skip to content

Commit

Permalink
Fix Docker publishing (#91)
Browse files Browse the repository at this point in the history
* Delete unused Travis CI configuration file

* Update changelog

* Remove git versioning

* Fix publishing to Docker via CDP
  • Loading branch information
Séamus Ó Ceanainn authored Apr 13, 2022
1 parent ff763ef commit bac1bb2
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 36 deletions.
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

48 changes: 44 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,55 @@
# v1.3.0

- Added support for filtering CloudWatch metrics.
- Added support for configuring AdminClient in KafkaSettings.
- Added support for specifying root log level via Java options.

# v1.2.0

- Added support for Kafka 2.2.0.
- Improved DataDog metric name format (reducing redundancy with metric tags).

# v1.1.0

- Added improved application health checks.

# v1.0.7

- Added support for Kafka 2.0.0.

# v1.0.6

- Added support for Kafka 1.1.0.
- Added support for connecting to Kafka brokers using authentication.

# v1.0.3

- Moved team name (ownership) to 'Machina' in Docker / Pierone. Images are now published to `registry-write.opensource.zalan.do/machina` instead of `registry-write.opensource.zalan.do/dougal`.

# v1.0.2

- Added support for reporting aggregated consumer lag in exported metrics.

# v1.0.1

- Added support for publishing metrics to Datadog.

# v1.0.0

- Added support for Kafka 1.0.0.

# v0.3.0

- Added support for exporting lag metrics to AWS CloudWatch
- Added support for exporting lag metrics to AWS CloudWatch.

# v0.2.1

- Fixed logging issues
- Fixed logging issues.

# v0.2.0

- Support added for Kafka 0.10.2.0
- Support added for Kafka 0.10.2.0.

# v0.1.0

- Initial release for Kafka 0.10.0.1
- Initial release for Kafka 0.10.0.1.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Remora [![Build Status](https://travis-ci.org/zalando-incubator/remora.svg?branch=master)](https://travis-ci.org/zalando-incubator/remora)
# Remora

![Grafana Graph](https://raw.githubusercontent.com/imduffy15/remora-fetcher/master/img/grafana.png)

Expand Down Expand Up @@ -505,7 +505,7 @@ This way, a docker container running Remora will be able to communicate with a D

### Build

Create docker image locally. The image will be built to `remora:<TAG-GITCOMMIT>` and `latest`
Create docker image locally. The image will be built to `remora:0.1.0-SNAPSHOT` by default.

```bash
$ sbt docker:publishLocal
Expand Down
2 changes: 1 addition & 1 deletion auth-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
- '9092:9092'

remora:
image: registry.opensource.zalan.do/machina/remora
image: registry.opensource.zalan.do/machina/remora:1.3.0
depends_on:
- kafka
hostname: remora
Expand Down
6 changes: 3 additions & 3 deletions basic-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ services:

remora:
# Built locally
image: remora
# latest from repo
# image: registry.opensource.zalan.do/machina/remora
image: remora:0.1.0-SNAPSHOT
# From repo
#image: registry.opensource.zalan.do/machina/remora:1.3.0
depends_on:
- kafka
environment:
Expand Down
8 changes: 1 addition & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,18 @@ lazy val commonSettings = Seq(

lazy val dockerSettings = Seq(
daemonUser := "root",
dockerUpdateLatest := true,
dockerUpdateLatest := false,
dockerBaseImage := "registry.opensource.zalan.do/library/openjdk-8:latest",
dockerExposedPorts := Seq(9000),
dockerExposedVolumes := Seq("/opt/docker/logs"),
dockerRepository := sys.props.get("docker.repo"),
maintainer := "[email protected]"
)

lazy val gitSettings = Seq(
git.useGitDescribe := true
)

lazy val root = (project in file("."))
.settings(commonSettings)
.settings(dockerSettings)
.settings(gitSettings)
.enablePlugins(
GitVersioning,
JavaServerAppPackaging
)

Expand Down
139 changes: 136 additions & 3 deletions delivery.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,142 @@
version: "2017-09-20"

dependencies:
- id: base-image
type: docker
ref: registry.opensource.zalan.do/library/openjdk-8

pipeline:
- id: build
- id: compile-test
type: script
overlay: ci/scala
when:
event: push
branch: master
vm_config:
type: linux
image: cdp-runtime/jdk8-sbt
size: large
commands:
- desc: Compile and test application
cmd: |
sbt compile test
- id: release-patch-version
type: script
when:
event: push
branch: master
triggered_by_dependency: null
requires_human_approval: true
vm_config:
type: linux
image: cdp-runtime/jdk8-sbt
size: large
commands:
- desc: Build and push docker image
cmd: |
echo "Determining next version to publish:"
current_release=$(git describe --tags origin/master)
if [[ $(cut -d '-' -f1 <<< $current_release) =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$(cut -d '-' -f1 <<< $current_release)"
echo "Previous release: $version"
buildVersion="$(cut -d '.' -f3 <<< $version)"
minorVersion="$(cut -d '.' -f2 <<< $version)"
majorVersion="$(cut -d '.' -f1 <<< $version)"
version="$majorVersion.$minorVersion.$(($buildVersion + 1))"
else
echo "Issue with current tag: $current_release"
return -1
fi
sbt "set version in ThisBuild := \"$(cut -c2- <<< $version)\"" docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/machina
echo "Published a new release version: $version"
echo "Tagging new version: $version"
git gh-tag $version
- id: release-minor-version
type: script
when:
event: push
branch: master
triggered_by_dependency: null
requires_human_approval: true
vm_config:
type: linux
image: cdp-runtime/jdk8-sbt
size: large
commands:
- desc: Build and push docker image
cmd: |
echo "Determining next version to publish:"
current_release=$(git describe --tags origin/master)
if [[ $(cut -d '-' -f1 <<< $current_release) =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$(cut -d '-' -f1 <<< $current_release)"
echo "Previous release: $version"
minorVersion="$(cut -d '.' -f2 <<< $version)"
majorVersion="$(cut -d '.' -f1 <<< $version)"
version="$majorVersion.$(($minorVersion + 1)).0"
else
echo "Issue with current tag: $current_release"
return -1
fi
sbt "set version in ThisBuild := \"$(cut -c2- <<< $version)\"" docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/machina
echo "Published a new release version: $version"
echo "Tagging new version: $version"
git gh-tag $version
- id: release-major-version
type: script
when:
event: push
branch: master
triggered_by_dependency: null
requires_human_approval: true
vm_config:
type: linux
image: cdp-runtime/jdk8-sbt
size: large
commands:
- desc: Build and push docker image
cmd: |
echo "Determining next version to publish:"
current_release=$(git describe --tags origin/master)
if [[ $(cut -d '-' -f1 <<< $current_release) =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$(cut -d '-' -f1 <<< $current_release)"
echo "Previous release: $version"
buildVersion="$(cut -d '.' -f3 <<< $version)"
minorVersion="$(cut -d '.' -f2 <<< $version)"
majorVersion="$(cut -d '.' -f1 <<< ${version//v})"
version="v$((majorVersion + 1)).0.0"
else
echo "Issue with current tag: $current_release"
return -1
fi
sbt "set version in ThisBuild := \"$(cut -c2- <<< $version)\"" docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/machina
echo "Published a new release version: $version"
echo "Tagging new version: $version"
git gh-tag $version
- id: release-updated-base-image
type: script
when:
event: push
branch: master
triggered_by_dependency: base-image
vm_config:
type: linux
image: cdp-runtime/jdk8-sbt
size: large
commands:
- desc: Build and push docker image
cmd: |
sbt compile test docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/machina
echo "Determining next version to publish:"
current_release=$(git describe --tags origin/master)
if [[ $(cut -d '-' -f1 <<< $current_release) =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$(cut -d '-' -f1 <<< $current_release)"
echo "Previous release: $version"
version="$version-$(date +'%Y%m%d')"
else
echo "Issue with current tag: $current_release"
return -1
fi
sbt "set version in ThisBuild := \"$(cut -c2- <<< $version)\"" docker:publish -Ddocker.repo=registry-write.opensource.zalan.do/machina
echo "Published an updated release version: $version"
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
resolvers += Resolver.url("sbt-plugins", url("https://dl.bintray.com/zalando/sbt-plugins/"))(Resolver.ivyStylePatterns)

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.6")

0 comments on commit bac1bb2

Please sign in to comment.