From 7672e221d19340cf1b1bbc7eda4449f624ffd942 Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Fri, 1 Mar 2019 09:34:47 -0600 Subject: [PATCH] DATACASS-619 - Use full 8-jdk Docker image. --- ci/README.adoc | 39 +++++++++++++++++++++++++++++++++++++++ ci/build.sh | 2 +- ci/build.yml | 2 +- ci/test.sh | 4 ++-- ci/test.yml | 2 +- 5 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 ci/README.adoc diff --git a/ci/README.adoc b/ci/README.adoc new file mode 100644 index 000000000..37928f65e --- /dev/null +++ b/ci/README.adoc @@ -0,0 +1,39 @@ +== Running CI tasks locally + +Since Concourse is built on top of Docker, it's easy to: + +* Debug what went wrong on your local machine. +* Test out a a tweak to your `test.sh` script before sending it out. +* Experiment against a new image before submitting your pull request. + +All of these use cases are great reasons to essentially run what Concourse does on your local machine. + +IMPORTANT: To do this you must have Docker installed on your machine. + +1. `docker run -it --mount type=bind,source="$(pwd)",target=/spring-data-cassandra-github openjdk:8-jdk /bin/bash` ++ +This will launch the Docker image and mount your source code at `spring-data-cassandra-github`. ++ +Next, run the `test.sh` script from inside the container: ++ +2. `PROFILE=none spring-data-cassandra-github/ci/test.sh` + +Since the container is binding to your source, you can make edits from your IDE and run continue to run build jobs. + +If you need to test the `build.sh` script, then do this: + +1. `mkdir /tmp/spring-data-cassandra-artifactory` +2. `docker run -it --mount type=bind,source="$(pwd)",target=/spring-data-cassandra-github --mount type=bind,source="/tmp/spring-data-cassandra-artifactory",target=/spring-data-cassandra-artifactory openjdk:8-jdk /bin/bash` ++ +This will launch the Docker image and mount your source code at `spring-data-cassandra-github` and the temporary +artifactory output directory at `spring-data-cassandra-artifactory`. ++ +Next, run the `build.sh` script from inside the container: ++ +3. `spring-data-cassandra-github/ci/build.sh` + +IMPORTANT: `build.sh` doesn't actually push to Artifactory so don't worry about accidentally deploying anything. +It just deploys to a local folder. That way, the `artifactory-resource` later in the pipeline can pick up these artifacts +and deliver them to artifactory. + +NOTE: Docker containers can eat up disk space fast! From time to time, run `docker system prune` to clean out old images. \ No newline at end of file diff --git a/ci/build.sh b/ci/build.sh index 757523469..61c78f2b6 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/bash set -euo pipefail diff --git a/ci/build.yml b/ci/build.yml index 3ed5c1c1e..5e945b1a6 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -5,7 +5,7 @@ image_resource: type: docker-image source: repository: openjdk - tag: 8-jdk-alpine + tag: 8-jdk inputs: - name: spring-data-cassandra-github diff --git a/ci/test.sh b/ci/test.sh index 237ab697e..744d2ed45 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/bash set -euo pipefail @@ -8,4 +8,4 @@ rm -rf $HOME/.m2/repository/org/springframework/data 2> /dev/null || : cd spring-data-cassandra-github -./mvnw clean dependency:list test -P${PROFILE} -Dsort -Dbundlor.enabled=false -B +./mvnw clean dependency:list test -P${PROFILE} -Dsort diff --git a/ci/test.yml b/ci/test.yml index 04a8d9f9f..4bebfb216 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -5,7 +5,7 @@ image_resource: type: docker-image source: repository: openjdk - tag: 8-jdk-alpine + tag: 8-jdk inputs: - name: spring-data-cassandra-github