Skip to content

Commit

Permalink
Merge pull request #63 from ing-bank/sbt-versioning
Browse files Browse the repository at this point in the history
Align SBT version with env variable used to build docker container
  • Loading branch information
Bongani authored Mar 26, 2019
2 parents 7d3a117 + 6249e62 commit 4ec1a7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ after_success:
- if [ "$TRAVIS_PULL_REQUEST" != "false" -o "${TRAVIS_BRANCH}" == "master" ]; then
bash <(curl -s https://codecov.io/bash);
fi
- export DOCKER_TAG="${TRAVIS_BRANCH/\//_}"
- export AIRLOCK_VERSION="${TRAVIS_BRANCH/\//_}"
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- if [ "${TRAVIS_BRANCH}" != "master" ]; then
echo "Build image for with name $DOCKER_REPO:$DOCKER_TAG";
echo "Build image for with name $DOCKER_REPO:$AIRLOCK_VERSION";
sbt clean docker:publish;
fi
- if [ -n "$TRAVIS_TAG" ]; then
docker tag $DOCKER_REPO:$DOCKER_TAG $DOCKER_REPO:latest;
docker tag $DOCKER_REPO:$AIRLOCK_VERSION $DOCKER_REPO:latest;
docker push $DOCKER_REPO:latest;
fi

Expand Down
11 changes: 5 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import com.typesafe.sbt.packager.docker
import com.typesafe.sbt.packager.docker.ExecCmd
import scalariform.formatter.preferences._

val airlockVersion = scala.sys.env.getOrElse("AIRLOCK_VERSION", "SNAPSHOT")

name := "airlock"
version := "0.1.23"
version := airlockVersion
scalaVersion := "2.12.8"

scalacOptions += "-unchecked"
Expand All @@ -17,7 +19,7 @@ scalacOptions += "-Xfatal-warnings"
// Experimental: improved update resolution.
updateOptions := updateOptions.value.withCachedResolution(cachedResoluton = true)

val akkaHttpVersion = "10.1.7"
val akkaHttpVersion = "10.1.7"
val akkaVersion = "2.5.21"
val logbackJson = "0.1.5"
val metricVersion = "4.0.5"
Expand Down Expand Up @@ -72,10 +74,7 @@ javaOptions += "-Djava.awt.headless=true"
dockerExposedPorts := Seq(8080) // should match PROXY_PORT
dockerCommands += ExecCmd("ENV", "PROXY_HOST", "0.0.0.0")
dockerBaseImage := "openjdk:8u171-jre-slim-stretch"
dockerAlias := docker.DockerAlias(Some("docker.io"),
Some("wbaa"),
"airlock",
Option(System.getenv("DOCKER_TAG")))
dockerAlias := docker.DockerAlias(Some("docker.io"), Some("wbaa"), "airlock", Some(airlockVersion))

scalariformPreferences := scalariformPreferences.value
.setPreference(AlignSingleLineCaseStatements, true)
Expand Down

0 comments on commit 4ec1a7c

Please sign in to comment.