From 6f71ee6bd2ac341c06c0d8ac52522fd066615045 Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 19:29:44 +0100 Subject: [PATCH 01/11] circle ci -> docker hub integration #75 --- .circleci/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 487cb7a..1d3f0b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,7 +55,14 @@ jobs: - run: name: Verify with Prod Profile command: './mvnw -ntp verify -Pprod -DskipTests' - + - when: + condition: + equal: [ dev, << pipeline.git.branch >> ] + - run: | + docker build -t tillias/microcatalog . + docker tag tillias/microcatalog tillias/microcatalog:$DOCKER_TAG + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + docker push tillias/microcatalog - when: condition: equal: [ master, << pipeline.git.branch >> ] From e27e3ec7a011978df085143f6ac45517b64c5126 Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 19:31:55 +0100 Subject: [PATCH 02/11] circle ci -> docker hub integration #75 --- .circleci/config.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d3f0b8..b85c213 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,11 +58,13 @@ jobs: - when: condition: equal: [ dev, << pipeline.git.branch >> ] - - run: | - docker build -t tillias/microcatalog . - docker tag tillias/microcatalog tillias/microcatalog:$DOCKER_TAG - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push tillias/microcatalog + - run: + name: Docker push + command: | + docker build -t tillias/microcatalog . + docker tag tillias/microcatalog tillias/microcatalog:$DOCKER_TAG + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + docker push tillias/microcatalog - when: condition: equal: [ master, << pipeline.git.branch >> ] From 07eac5199d33600c5a62969db3676c07780c11df Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 19:33:25 +0100 Subject: [PATCH 03/11] circle ci -> docker hub integration #75 --- .circleci/config.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b85c213..3de2b1f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,13 +58,14 @@ jobs: - when: condition: equal: [ dev, << pipeline.git.branch >> ] - - run: - name: Docker push - command: | - docker build -t tillias/microcatalog . - docker tag tillias/microcatalog tillias/microcatalog:$DOCKER_TAG - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push tillias/microcatalog + steps: + - run: + name: Docker push + command: | + docker build -t tillias/microcatalog . + docker tag tillias/microcatalog tillias/microcatalog:$DOCKER_TAG + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + docker push tillias/microcatalog - when: condition: equal: [ master, << pipeline.git.branch >> ] From 142ea01e6f77d3d951f7e22c83df87869b9d978a Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 21:01:12 +0100 Subject: [PATCH 04/11] circle ci -> docker hub integration #75 --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3de2b1f..0b81030 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,6 +59,8 @@ jobs: condition: equal: [ dev, << pipeline.git.branch >> ] steps: + - setup_remote_docker: + version: 19.03.13 - run: name: Docker push command: | From d6c3ddc1f12d4052ec894edac114ac899ba62d18 Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 21:26:39 +0100 Subject: [PATCH 05/11] caching for docker layers #75 --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b81030..ae3f946 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,12 @@ jobs: - image: cimg/openjdk:11.0.8-node steps: - checkout + command: | + OLD_VERSION=$(mvn -s .circleci/settings.xml -q \ + -Dexec.executable="echo" -Dexec.args='${project.version}' \ + --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) + NEW_VERSION="${OLD_VERSION/-SNAPSHOT/}" + echo $NEW_VERSION # Download and cache dependencies - restore_cache: @@ -42,10 +48,7 @@ jobs: command: 'chmod +x mvnw' - run: name: Run Style Checks - command: './mvnw -ntp checkstyle:check' - - run: - name: Clean and Verify - command: './mvnw -ntp clean verify' + command: './mvnw -ntp clean checkstyle:check' - run: name: Run Front End Tests command: npm run test @@ -57,10 +60,11 @@ jobs: command: './mvnw -ntp verify -Pprod -DskipTests' - when: condition: - equal: [ dev, << pipeline.git.branch >> ] + equal: [ master, << pipeline.git.branch >> ] steps: - setup_remote_docker: version: 19.03.13 + docker_layer_caching: true - run: name: Docker push command: | @@ -68,10 +72,6 @@ jobs: docker tag tillias/microcatalog tillias/microcatalog:$DOCKER_TAG echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker push tillias/microcatalog - - when: - condition: - equal: [ master, << pipeline.git.branch >> ] - steps: - run: name: Deploy to Heroku command: './mvnw -ntp com.heroku.sdk:heroku-maven-plugin:2.0.5:deploy -DskipTests -Pprod -Dheroku.buildpacks=heroku/jvm -Dheroku.appName=microcatalog' From 2fe67e5ca0ec22b6eba175c3e9eff861df2d3a77 Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 21:27:05 +0100 Subject: [PATCH 06/11] caching for docker layers #75 --- .circleci/config.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ae3f946..80ea215 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,12 +5,13 @@ jobs: - image: cimg/openjdk:11.0.8-node steps: - checkout - command: | - OLD_VERSION=$(mvn -s .circleci/settings.xml -q \ - -Dexec.executable="echo" -Dexec.args='${project.version}' \ - --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) - NEW_VERSION="${OLD_VERSION/-SNAPSHOT/}" - echo $NEW_VERSION + - run + command: | + OLD_VERSION=$(mvn -s .circleci/settings.xml -q \ + -Dexec.executable="echo" -Dexec.args='${project.version}' \ + --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) + NEW_VERSION="${OLD_VERSION/-SNAPSHOT/}" + echo $NEW_VERSION # Download and cache dependencies - restore_cache: From b8bf75c237ebe00f8680ffeb45f20b7198747f7d Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 21:28:03 +0100 Subject: [PATCH 07/11] caching for docker layers #75 --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 80ea215..654de25 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,7 @@ jobs: steps: - checkout - run + name: Parse version command: | OLD_VERSION=$(mvn -s .circleci/settings.xml -q \ -Dexec.executable="echo" -Dexec.args='${project.version}' \ From 6df2037845172260643afd95a7766cda497bbbd0 Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 21:29:13 +0100 Subject: [PATCH 08/11] caching for docker layers #75 --- .circleci/config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 654de25..91b0651 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,13 +6,13 @@ jobs: steps: - checkout - run - name: Parse version - command: | - OLD_VERSION=$(mvn -s .circleci/settings.xml -q \ - -Dexec.executable="echo" -Dexec.args='${project.version}' \ - --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) - NEW_VERSION="${OLD_VERSION/-SNAPSHOT/}" - echo $NEW_VERSION + name: Parse version + command: | + OLD_VERSION=$(mvn -s .circleci/settings.xml -q \ + -Dexec.executable="echo" -Dexec.args='${project.version}' \ + --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) + NEW_VERSION="${OLD_VERSION/-SNAPSHOT/}" + echo $NEW_VERSION # Download and cache dependencies - restore_cache: From feceb5c20fff35331971d1c313e7f74a8a75a825 Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 21:29:55 +0100 Subject: [PATCH 09/11] caching for docker layers #75 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 91b0651..e7c97d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: - image: cimg/openjdk:11.0.8-node steps: - checkout - - run + - run: name: Parse version command: | OLD_VERSION=$(mvn -s .circleci/settings.xml -q \ From eb24a23786edd433822e8096a571b87620cc6fa4 Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 21:37:01 +0100 Subject: [PATCH 10/11] caching for docker layers #75 --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7c97d0..cb88f67 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,10 +8,9 @@ jobs: - run: name: Parse version command: | - OLD_VERSION=$(mvn -s .circleci/settings.xml -q \ - -Dexec.executable="echo" -Dexec.args='${project.version}' \ - --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) + OLD_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) NEW_VERSION="${OLD_VERSION/-SNAPSHOT/}" + echo $OLD_VERSION echo $NEW_VERSION # Download and cache dependencies From c8a0db59a3757983de816915b8204efe43fffb1f Mon Sep 17 00:00:00 2001 From: tillias Date: Thu, 29 Oct 2020 21:40:27 +0100 Subject: [PATCH 11/11] caching for docker layers #75 --- .circleci/config.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cb88f67..f161e3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,13 +5,6 @@ jobs: - image: cimg/openjdk:11.0.8-node steps: - checkout - - run: - name: Parse version - command: | - OLD_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - NEW_VERSION="${OLD_VERSION/-SNAPSHOT/}" - echo $OLD_VERSION - echo $NEW_VERSION # Download and cache dependencies - restore_cache: @@ -69,6 +62,8 @@ jobs: - run: name: Docker push command: | + SNAPSHOT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + DOCKER_TAG="${OLD_VERSION/-SNAPSHOT/}" docker build -t tillias/microcatalog . docker tag tillias/microcatalog tillias/microcatalog:$DOCKER_TAG echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin