From 5c35752b79e1aaacd775bf6a1019b1dda47f8dac Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 13:56:19 +0000 Subject: [PATCH 01/97] added docker image build job --- .gitlab-ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..8af3448 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,19 @@ +stages: + - build + - deploy + +build_docker_image: + stage: build + image: docker:19.03.12 + services: + - docker:19.03.12-dind + script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . + - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + +deploy: + stage: deploy + image: maven:3.9.5-ibm-semeru-17-focal + script: + - mvn deploy -s ci_settings.xml -DskipTests -- GitLab From 3d33c1b414466e6e04808536550c4b5ac099748b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:02:31 +0000 Subject: [PATCH 02/97] added docker driver var --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8af3448..99ac6d5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,8 @@ stages: build_docker_image: stage: build image: docker:19.03.12 + variables: + - DOCKER_DRIVER: overlay2 services: - docker:19.03.12-dind script: -- GitLab From bb41f590585e624bac97bfe4bfa1195e356fb60b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:03:04 +0000 Subject: [PATCH 03/97] minor syntax fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99ac6d5..f211853 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ build_docker_image: stage: build image: docker:19.03.12 variables: - - DOCKER_DRIVER: overlay2 + DOCKER_DRIVER: overlay2 services: - docker:19.03.12-dind script: -- GitLab From a7d8f8b419deadd5788892732c66baddffa04268 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:04:29 +0000 Subject: [PATCH 04/97] added DOCKER_HOST --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f211853..bceb822 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ build_docker_image: image: docker:19.03.12 variables: DOCKER_DRIVER: overlay2 + DOCKER_HOST: tcp://localhost:2375 services: - docker:19.03.12-dind script: -- GitLab From ad138c122f5516c67076867753d8e8d7e60cbfac Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:08:22 +0000 Subject: [PATCH 05/97] added properties under dind service --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bceb822..b3ef367 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,10 @@ build_docker_image: DOCKER_DRIVER: overlay2 DOCKER_HOST: tcp://localhost:2375 services: - - docker:19.03.12-dind + - name: docker:19.03.12-dind + alias: docker + command: ["--insecure-registry=registry.example.com"] + privileged: true script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From 0961068ca66331aab9b8bd2177ebcf70532664c1 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:09:58 +0000 Subject: [PATCH 06/97] WIP --- .gitlab-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b3ef367..05311a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,14 +5,13 @@ stages: build_docker_image: stage: build image: docker:19.03.12 - variables: - DOCKER_DRIVER: overlay2 - DOCKER_HOST: tcp://localhost:2375 + # variables: + # DOCKER_DRIVER: overlay2 + # DOCKER_HOST: tcp://localhost:2375 services: - name: docker:19.03.12-dind alias: docker - command: ["--insecure-registry=registry.example.com"] - privileged: true + # command: ["--insecure-registry=registry.example.com"] script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From 28c208c35d0ac87bdbacafc37c1a1b516e660410 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:11:51 +0000 Subject: [PATCH 07/97] WIP --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05311a3..0e98f25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,13 +5,12 @@ stages: build_docker_image: stage: build image: docker:19.03.12 - # variables: + variables: # DOCKER_DRIVER: overlay2 - # DOCKER_HOST: tcp://localhost:2375 + DOCKER_HOST: tcp://localhost:2375 services: - name: docker:19.03.12-dind alias: docker - # command: ["--insecure-registry=registry.example.com"] script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From 031a5dc22a0eeedff9f834e5e717153ece4a6caa Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:44:09 +0000 Subject: [PATCH 08/97] updated docker image --- .gitlab-ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e98f25..2be6a9c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,13 +4,16 @@ stages: build_docker_image: stage: build - image: docker:19.03.12 + image: docker:24.0.5 variables: # DOCKER_DRIVER: overlay2 DOCKER_HOST: tcp://localhost:2375 + DOCKER_TLS_CERTDIR: "/certs" services: - - name: docker:19.03.12-dind + - name: docker:24.0.5-dind alias: docker + before_script: + script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From 6ad765efaec0d5ca3fb31c1c855cbe68ea2dd813 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:44:25 +0000 Subject: [PATCH 09/97] syntax fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2be6a9c..08c809a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ build_docker_image: - name: docker:24.0.5-dind alias: docker before_script: - + - docker info script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From c04636366a952aec757bb7ab68554293696d3f72 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:47:40 +0000 Subject: [PATCH 10/97] added DOCKER_HOST --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08c809a..7bf8fb7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,11 +6,11 @@ build_docker_image: stage: build image: docker:24.0.5 variables: - # DOCKER_DRIVER: overlay2 - DOCKER_HOST: tcp://localhost:2375 - DOCKER_TLS_CERTDIR: "/certs" + DOCKER_DRIVER: overlay2 + DOCKER_HOST: tcp://docker:2375 + # DOCKER_TLS_CERTDIR: "" services: - - name: docker:24.0.5-dind + - name: docker:24.0.4-dind alias: docker before_script: - docker info -- GitLab From 628bd11d1d5acfe2aedd5a5812a4fb40531d43d7 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:52:49 +0000 Subject: [PATCH 11/97] removed dind --- .gitlab-ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7bf8fb7..e980a28 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,13 +5,13 @@ stages: build_docker_image: stage: build image: docker:24.0.5 - variables: - DOCKER_DRIVER: overlay2 - DOCKER_HOST: tcp://docker:2375 + # variables: + # DOCKER_DRIVER: overlay2 + # DOCKER_HOST: tcp://docker:2375 # DOCKER_TLS_CERTDIR: "" - services: - - name: docker:24.0.4-dind - alias: docker + # services: + # - name: docker:24.0.4-dind + # alias: docker before_script: - docker info script: -- GitLab From 9b4f938806e4dad4516a06c28c97956a7a8c25b1 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:53:52 +0000 Subject: [PATCH 12/97] WIP --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e980a28..1edac2f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,9 +5,9 @@ stages: build_docker_image: stage: build image: docker:24.0.5 - # variables: + variables: # DOCKER_DRIVER: overlay2 - # DOCKER_HOST: tcp://docker:2375 + DOCKER_HOST: tcp://localhost:2375 # DOCKER_TLS_CERTDIR: "" # services: # - name: docker:24.0.4-dind -- GitLab From 8029083c471a1d9b729bbc65de03848b531003ae Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:54:45 +0000 Subject: [PATCH 13/97] removed script section --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1edac2f..875264c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,10 +14,10 @@ build_docker_image: # alias: docker before_script: - docker info - script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . - - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + # script: + # - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + # - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . + # - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG deploy: stage: deploy -- GitLab From 4b0aef7f0e67790ec261acf36c4d38b8040c4421 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:55:24 +0000 Subject: [PATCH 14/97] removed before_script added script --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 875264c..c15112d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,9 +12,8 @@ build_docker_image: # services: # - name: docker:24.0.4-dind # alias: docker - before_script: + script: - docker info - # script: # - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY # - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . # - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -- GitLab From 06e3c4d642cba5eeafec7448a46f9947bed2262b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 14:57:35 +0000 Subject: [PATCH 15/97] used dind --- .gitlab-ci.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c15112d..7e8cfcf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,18 +5,15 @@ stages: build_docker_image: stage: build image: docker:24.0.5 + services: + - name: docker:24.0.5-dind variables: - # DOCKER_DRIVER: overlay2 - DOCKER_HOST: tcp://localhost:2375 - # DOCKER_TLS_CERTDIR: "" - # services: - # - name: docker:24.0.4-dind - # alias: docker + DOCKER_HOST: tcp://docker:2375 script: - docker info - # - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - # - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . - # - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . + - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG deploy: stage: deploy -- GitLab From 4251d242aeb838d34aefff27ea7891f0e7df8ace Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 15:00:17 +0000 Subject: [PATCH 16/97] removed TLS certs --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e8cfcf..c3b6dba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ build_docker_image: - name: docker:24.0.5-dind variables: DOCKER_HOST: tcp://docker:2375 + DOCKER_TLS_CERTDIR: "" script: - docker info - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY -- GitLab From be0bbc199be978c4499fd72c481345ce29acc67b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 15:02:45 +0000 Subject: [PATCH 17/97] added fix for dind --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3b6dba..9d57cc7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,8 +7,11 @@ build_docker_image: image: docker:24.0.5 services: - name: docker:24.0.5-dind + entrypoint: ["env", "-u", "DOCKER_HOST"] + command: ["dockerd-entrypoint.sh"] variables: - DOCKER_HOST: tcp://docker:2375 + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" script: - docker info -- GitLab From a7a5c3c7ead22393edd812f13158836b99a1086b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 17:40:23 +0000 Subject: [PATCH 18/97] removed debug command --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d57cc7..08ddeee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,6 @@ build_docker_image: DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" script: - - docker info - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -- GitLab From 15203e12df16ce651aa91bb9d2d3f9adc8f8d3cc Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 17:48:03 +0000 Subject: [PATCH 19/97] used different docker host --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08ddeee..ffda6e1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,9 +10,7 @@ build_docker_image: entrypoint: ["env", "-u", "DOCKER_HOST"] command: ["dockerd-entrypoint.sh"] variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 - DOCKER_TLS_CERTDIR: "" + DOCKER_HOST: "unix:///var/run/docker.sock" script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From 825d395732cd238ae90fb468f9417fa054609496 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 17:55:08 +0000 Subject: [PATCH 20/97] added alias to service --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffda6e1..50796de 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,8 +7,9 @@ build_docker_image: image: docker:24.0.5 services: - name: docker:24.0.5-dind - entrypoint: ["env", "-u", "DOCKER_HOST"] - command: ["dockerd-entrypoint.sh"] + alias: docker + # entrypoint: ["env", "-u", "DOCKER_HOST"] + # command: ["dockerd-entrypoint.sh"] variables: DOCKER_HOST: "unix:///var/run/docker.sock" script: -- GitLab From 3ab43b3a72d180ba159e82efb36cfcbf064a6cc5 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 17:56:59 +0000 Subject: [PATCH 21/97] removed DOCKER_HOST var --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 50796de..c277885 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,8 @@ build_docker_image: alias: docker # entrypoint: ["env", "-u", "DOCKER_HOST"] # command: ["dockerd-entrypoint.sh"] - variables: - DOCKER_HOST: "unix:///var/run/docker.sock" + # variables: + # DOCKER_HOST: "unix:///var/run/docker.sock" script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From 9b89712a115a1fccefc23cac3176bff261f118d0 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 18:08:47 +0000 Subject: [PATCH 22/97] used localhost for DOCKER_HOST --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c277885..df72943 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,9 @@ build_docker_image: alias: docker # entrypoint: ["env", "-u", "DOCKER_HOST"] # command: ["dockerd-entrypoint.sh"] - # variables: - # DOCKER_HOST: "unix:///var/run/docker.sock" + variables: + DOCKER_HOST: tcp://localhost:2375 + # DOCKER_HOST: "unix:///var/run/docker.sock" script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From 9cf6b7acc1aec0982f133f73c318cd0071d3272b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 18:11:58 +0000 Subject: [PATCH 23/97] used docker for docker host --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df72943..32f5aab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ build_docker_image: # entrypoint: ["env", "-u", "DOCKER_HOST"] # command: ["dockerd-entrypoint.sh"] variables: - DOCKER_HOST: tcp://localhost:2375 + DOCKER_HOST: "tcp://docker:2375" # DOCKER_HOST: "unix:///var/run/docker.sock" script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY -- GitLab From 0abf534e511eece3ab176ad7a9896dbebbcb3adf Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 18:43:06 +0000 Subject: [PATCH 24/97] used alias and DOCKER_DRIVER --- .gitlab-ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 32f5aab..47e2f0e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,13 +6,11 @@ build_docker_image: stage: build image: docker:24.0.5 services: - - name: docker:24.0.5-dind + - image: docker:24.0.5-dind alias: docker - # entrypoint: ["env", "-u", "DOCKER_HOST"] - # command: ["dockerd-entrypoint.sh"] variables: DOCKER_HOST: "tcp://docker:2375" - # DOCKER_HOST: "unix:///var/run/docker.sock" + DOCKER_DRIVER: overlay2 script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From b15a95c53badca19c9436face21017c1ea88818b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 18:44:32 +0000 Subject: [PATCH 25/97] used name instead of image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 47e2f0e..829a355 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ build_docker_image: stage: build image: docker:24.0.5 services: - - image: docker:24.0.5-dind + - name: docker:24.0.5-dind alias: docker variables: DOCKER_HOST: "tcp://docker:2375" -- GitLab From 204e0c35bc21cf74b03684d23897443b58addba1 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 18:46:35 +0000 Subject: [PATCH 26/97] ommitted DOCKER_HOST --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 829a355..ecf2988 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ build_docker_image: - name: docker:24.0.5-dind alias: docker variables: - DOCKER_HOST: "tcp://docker:2375" + # DOCKER_HOST: "tcp://docker:2375" DOCKER_DRIVER: overlay2 script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY -- GitLab From 1a194d15c6e66170616b12b18d6b228db0923126 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 14 Dec 2023 18:48:18 +0000 Subject: [PATCH 27/97] simplified script --- .gitlab-ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ecf2988..ae63437 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,11 +6,7 @@ build_docker_image: stage: build image: docker:24.0.5 services: - - name: docker:24.0.5-dind - alias: docker - variables: - # DOCKER_HOST: "tcp://docker:2375" - DOCKER_DRIVER: overlay2 + - docker:24.0.5-dind script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . -- GitLab From 24acbe194be9a4c438f46e0a46b708a865930e11 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 09:27:36 +0000 Subject: [PATCH 28/97] used kaniko instead of docker --- .gitlab-ci.yml | 33 ++++++++++++++++++++++++++------- Dockerfile.tmfapi => Dockerfile | 0 2 files changed, 26 insertions(+), 7 deletions(-) rename Dockerfile.tmfapi => Dockerfile (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae63437..349c98e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,15 +2,34 @@ stages: - build - deploy -build_docker_image: +build_image: stage: build - image: docker:24.0.5 - services: - - docker:24.0.5-dind + image: + name: gcr.io/kaniko-project/executor:v1.14.0-debug + entrypoint: [""] + before_script: + - | + if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then + export IMAGE_TAG=$CI_COMMIT_TAG + export ADDITIONAL_TAG="latest" + elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then + export IMAGE_TAG="develop" + fi + - echo "Building Docker image with tag: $IMAGE_TAG" script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -f Dockerfile.tmfapi . - - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + - /kaniko/executor + --context "${CI_PROJECT_DIR}" + --dockerfile "${CI_PROJECT_DIR}/Dockerfile" + --destination "${CI_REGISTRY_IMAGE}:$IMAGE_TAG" + - | + if [ ! -z "$ADDITIONAL_TAG" ]; then + /kaniko/executor + --context "${CI_PROJECT_DIR}" + --dockerfile "${CI_PROJECT_DIR}/Dockerfile" + --destination "${CI_REGISTRY_IMAGE}:$ADDITIONAL_TAG" + fi + rules: + - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" || $CI_COMMIT_REF_NAME == "develop"' deploy: stage: deploy diff --git a/Dockerfile.tmfapi b/Dockerfile similarity index 100% rename from Dockerfile.tmfapi rename to Dockerfile -- GitLab From fd8d6a797ec181b2b45301c10d7ddd91974c0468 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 09:28:46 +0000 Subject: [PATCH 29/97] minor syntax fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 349c98e..4f7aa9b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ build_image: name: gcr.io/kaniko-project/executor:v1.14.0-debug entrypoint: [""] before_script: - - | + - > if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then export IMAGE_TAG=$CI_COMMIT_TAG export ADDITIONAL_TAG="latest" -- GitLab From a439cd83bc48d9b84ec125f187b3637745eca15c Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:07:03 +0000 Subject: [PATCH 30/97] minor syntax fix --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f7aa9b..0cd7480 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,14 +8,14 @@ build_image: name: gcr.io/kaniko-project/executor:v1.14.0-debug entrypoint: [""] before_script: - - > + - | if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then export IMAGE_TAG=$CI_COMMIT_TAG export ADDITIONAL_TAG="latest" elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then export IMAGE_TAG="develop" fi - - echo "Building Docker image with tag: $IMAGE_TAG" + - echo "Building Docker image with tag $IMAGE_TAG" script: - /kaniko/executor --context "${CI_PROJECT_DIR}" -- GitLab From f881d0e0ad2ebfb0819559065f46dd65f3a2e535 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:12:22 +0000 Subject: [PATCH 31/97] debugging issue with tag --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0cd7480..b06b20a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ build_image: before_script: - | if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then - export IMAGE_TAG=$CI_COMMIT_TAG + export IMAGE_TAG=$(echo $CI_COMMIT_REF_NAME | tr -cd '[:alnum:]._-') # $CI_COMMIT_TAG export ADDITIONAL_TAG="latest" elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then export IMAGE_TAG="develop" -- GitLab From bbfdb6458ef2aa3b50b8a130a314223c9f6d4002 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:15:41 +0000 Subject: [PATCH 32/97] removed MAINTAINER from Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7fbc6c2..886550a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -MAINTAINER openslice.io RUN mkdir /opt/shareclasses RUN mkdir -p /opt/openslice/lib/ COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -- GitLab From 1468e00a19b979219f70881c1de225f3ec08d100 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:18:56 +0000 Subject: [PATCH 33/97] added debug command --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b06b20a..cfdbb6f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,6 +21,7 @@ build_image: --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$IMAGE_TAG" + --verbosity=debug - | if [ ! -z "$ADDITIONAL_TAG" ]; then /kaniko/executor -- GitLab From bfb8a8a2dbbc8a7703d1d67469c970d694729904 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:24:12 +0000 Subject: [PATCH 34/97] added job to fetch mvn artifact --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cfdbb6f..d90362a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,17 @@ stages: + - prepare - build - deploy +download_jar: + stage: prepare + image: maven:3.9.5-ibm-semeru-17-focal + script: + - mvn dependency:get -Dartifact=org.etsi.osl.tmf.api:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ + artifacts: + paths: + - target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar + build_image: stage: build image: -- GitLab From 9181d6850d5ab30df07ca3a1bb8afbb5a05eb956 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:26:39 +0000 Subject: [PATCH 35/97] added mvn config to fetch command --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d90362a..a5dcfa6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ download_jar: stage: prepare image: maven:3.9.5-ibm-semeru-17-focal script: - - mvn dependency:get -Dartifact=org.etsi.osl.tmf.api:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ + - mvn --settings ci_settings.xml dependency:get -Dartifact=org.etsi.osl.tmf.api:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ artifacts: paths: - target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar -- GitLab From 22d183efa24adf66f1972e7d0483610a8daa88dc Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:28:17 +0000 Subject: [PATCH 36/97] added ci_settings.xml --- .gitlab-ci.yml | 2 +- ci_settings.xml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ci_settings.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a5dcfa6..3f6d2b7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ download_jar: stage: prepare image: maven:3.9.5-ibm-semeru-17-focal script: - - mvn --settings ci_settings.xml dependency:get -Dartifact=org.etsi.osl.tmf.api:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ + - mvn -s ci_settings.xml dependency:get -Dartifact=org.etsi.osl.tmf.api:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ artifacts: paths: - target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar diff --git a/ci_settings.xml b/ci_settings.xml new file mode 100644 index 0000000..69ad06e --- /dev/null +++ b/ci_settings.xml @@ -0,0 +1,16 @@ + + + + gitlab-maven + + + + Job-Token + ${CI_JOB_TOKEN} + + + + + + -- GitLab From eeca3a42de8c16d4d8efe04494dc19707c5346a2 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:29:28 +0000 Subject: [PATCH 37/97] updated pom to match updated version --- pom.xml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f112fd2..7614473 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,6 @@ org.etsi.osl org.etsi.osl.main 1.2.0-SNAPSHOT - ../org.etsi.osl.main @@ -27,7 +26,23 @@ 1.18.28 - + + + gitlab-maven + https://labs.etsi.org/rep/api/v4/groups/260/-/packages/maven + + + + + gitlab-maven + ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven + + + gitlab-maven + ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven + + + -- GitLab From ff36727cb9ddde9d75649b74a48b4851edc60dcb Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:38:44 +0000 Subject: [PATCH 38/97] minor mvn path fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f6d2b7..1aeba29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ download_jar: stage: prepare image: maven:3.9.5-ibm-semeru-17-focal script: - - mvn -s ci_settings.xml dependency:get -Dartifact=org.etsi.osl.tmf.api:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ + - mvn -s ci_settings.xml dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ artifacts: paths: - target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar -- GitLab From baec863c15fc88fe80f82b125a63ba3e6a46a6e4 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:42:26 +0000 Subject: [PATCH 39/97] added quiet mode to mvn pull --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1aeba29..f0eb12a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ download_jar: stage: prepare image: maven:3.9.5-ibm-semeru-17-focal script: - - mvn -s ci_settings.xml dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ + - mvn -s ci_settings.xml -q dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ artifacts: paths: - target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar -- GitLab From 03ecb4d2cff93814b1d5cc18c1836369bcc5c793 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:44:03 +0000 Subject: [PATCH 40/97] added batch logging strategy --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f0eb12a..20e266e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ download_jar: stage: prepare image: maven:3.9.5-ibm-semeru-17-focal script: - - mvn -s ci_settings.xml -q dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ + - mvn -s ci_settings.xml -B dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ artifacts: paths: - target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar -- GitLab From 361abdc485b9801f71a1a9e989da46c1de529430 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:50:33 +0000 Subject: [PATCH 41/97] added variable for logging strategy --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20e266e..acacc08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,9 +5,12 @@ stages: download_jar: stage: prepare + variables: + LOGGING_STRATEGY: "-q" image: maven:3.9.5-ibm-semeru-17-focal script: - - mvn -s ci_settings.xml -B dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ + - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." + - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ artifacts: paths: - target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar -- GitLab From f7f70dbdf84d825201d3e06445ecd2a14ef4d09f Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:53:33 +0000 Subject: [PATCH 42/97] debugging commands --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index acacc08..3f26d01 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,14 +6,15 @@ stages: download_jar: stage: prepare variables: - LOGGING_STRATEGY: "-q" + LOGGING_STRATEGY: "" image: maven:3.9.5-ibm-semeru-17-focal script: - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ + - ls artifacts: paths: - - target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar + - target/ build_image: stage: build -- GitLab From 79e9aefc8a2461a354d1697b7c53d74dfa033dd6 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 10:56:54 +0000 Subject: [PATCH 43/97] added copy command to move jar --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f26d01..2f50b08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,8 @@ download_jar: image: maven:3.9.5-ibm-semeru-17-focal script: - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." - - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -Ddest=target/ - - ls + - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT + - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -DoutputDirectory=target/ artifacts: paths: - target/ -- GitLab From c117601cfe6501e5970364a898a535e451e9600f Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:01:13 +0000 Subject: [PATCH 44/97] added quiet LOGGING STRATEGY --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f50b08..14a9007 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: download_jar: stage: prepare variables: - LOGGING_STRATEGY: "" + LOGGING_STRATEGY: "-q" image: maven:3.9.5-ibm-semeru-17-focal script: - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." -- GitLab From e601bdb2f5da26d2cb449f4e5d264af70a6c0f94 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:06:41 +0000 Subject: [PATCH 45/97] changed kaniko version --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14a9007..2c8db13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ download_jar: build_image: stage: build image: - name: gcr.io/kaniko-project/executor:v1.14.0-debug + name: gcr.io/kaniko-project/executor:v1.9.0-debug entrypoint: [""] before_script: - | -- GitLab From ac61e998fd0f2e39e170bb217617aaa4351feeb3 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:16:17 +0000 Subject: [PATCH 46/97] used different base image --- .gitlab-ci.yml | 1 + Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c8db13..83faf83 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,7 @@ download_jar: - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -DoutputDirectory=target/ + - ls artifacts: paths: - target/ diff --git a/Dockerfile b/Dockerfile index 886550a..3add391 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ibm-semeru-runtimes:open-17.0.7_7-jdk +FROM openjdk:17-jdk RUN mkdir /opt/shareclasses RUN mkdir -p /opt/openslice/lib/ COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -- GitLab From 217c21fa87e3b2ef1aabb99c672c27bcc1e6b776 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:23:54 +0000 Subject: [PATCH 47/97] added debug command / reverted base image --- .gitlab-ci.yml | 4 ++-- Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 83faf83..36aefe1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ download_jar: - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -DoutputDirectory=target/ - - ls + - ls target artifacts: paths: - target/ @@ -20,7 +20,7 @@ download_jar: build_image: stage: build image: - name: gcr.io/kaniko-project/executor:v1.9.0-debug + name: gcr.io/kaniko-project/executor:debug entrypoint: [""] before_script: - | diff --git a/Dockerfile b/Dockerfile index 3add391..886550a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:17-jdk +FROM ibm-semeru-runtimes:open-17.0.7_7-jdk RUN mkdir /opt/shareclasses RUN mkdir -p /opt/openslice/lib/ COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -- GitLab From 81be5be743534345fd703b008d5f87e4fffd5505 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:31:11 +0000 Subject: [PATCH 48/97] added version as variable and renamed --- .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36aefe1..fa8d5a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,9 @@ stages: - build - deploy +variables: + APP_VERSION: "1.2.0-SNAPSHOT" + download_jar: stage: prepare variables: @@ -10,8 +13,9 @@ download_jar: image: maven:3.9.5-ibm-semeru-17-focal script: - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." - - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT - - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:1.2.0-SNAPSHOT -DoutputDirectory=target/ + - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION + - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -DoutputDirectory=target/ + - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}.jar - ls target artifacts: paths: -- GitLab From a1177993e124705dc921324f613b2079fd82b36b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:32:58 +0000 Subject: [PATCH 49/97] minor naming fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa8d5a6..52990fe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ download_jar: - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -DoutputDirectory=target/ - - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}.jar + - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}-exec.jar - ls target artifacts: paths: -- GitLab From 95e97ea5b305df1df04134199e1026d0af30aed2 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:40:20 +0000 Subject: [PATCH 50/97] added registry credentials to kaniko --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52990fe..21527f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,6 +36,7 @@ build_image: fi - echo "Building Docker image with tag $IMAGE_TAG" script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" -- GitLab From 79eb182b1a3baaa99a18fceeec4a2ab93b5a1f21 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:43:50 +0000 Subject: [PATCH 51/97] added docker config dir --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 21527f6..09a2876 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,6 +36,7 @@ build_image: fi - echo "Building Docker image with tag $IMAGE_TAG" script: + - mkdir -p /kaniko/.docker - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context "${CI_PROJECT_DIR}" -- GitLab From 45687fccd626ab1070c6f1922d45c1377f96cb0f Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:50:13 +0000 Subject: [PATCH 52/97] dockerfile debug --- Dockerfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 886550a..de4f2e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ -FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -RUN mkdir /opt/shareclasses -RUN mkdir -p /opt/openslice/lib/ -COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -EXPOSE 13082 \ No newline at end of file +FROM openjdk:17-jdk +CMD ["java", "-version"] + +# FROM ibm-semeru-runtimes:open-17.0.7_7-jdk +# RUN mkdir /opt/shareclasses +# RUN mkdir -p /opt/openslice/lib/ +# COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ +# CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] +# EXPOSE 13082 \ No newline at end of file -- GitLab From 3e7d02264dffbc937cd9c7467c9fcc8722373f33 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:55:32 +0000 Subject: [PATCH 53/97] debugging --- .gitlab-ci.yml | 4 ++-- Dockerfile | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09a2876..35c51b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,11 +44,11 @@ build_image: --destination "${CI_REGISTRY_IMAGE}:$IMAGE_TAG" --verbosity=debug - | - if [ ! -z "$ADDITIONAL_TAG" ]; then + if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" - --destination "${CI_REGISTRY_IMAGE}:$ADDITIONAL_TAG" + --destination "${CI_REGISTRY_IMAGE}:latest" fi rules: - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" || $CI_COMMIT_REF_NAME == "develop"' diff --git a/Dockerfile b/Dockerfile index de4f2e0..1ecd880 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,4 @@ -FROM openjdk:17-jdk -CMD ["java", "-version"] - -# FROM ibm-semeru-runtimes:open-17.0.7_7-jdk +FROM ibm-semeru-runtimes:open-17.0.7_7-jdk # RUN mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -- GitLab From dc92c3ca845365593cbc7ce4b22d13acb5a62dbd Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 11:58:02 +0000 Subject: [PATCH 54/97] debugging auth --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 35c51b4..835d8b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,8 +36,8 @@ build_image: fi - echo "Building Docker image with tag $IMAGE_TAG" script: - - mkdir -p /kaniko/.docker - - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + # - mkdir -p /kaniko/.docker + # - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" @@ -45,6 +45,7 @@ build_image: --verbosity=debug - | if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then + echo "Executing Kaniko build for additional tag $ADDITIONAL_TAG" /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" -- GitLab From 3472d57e44d802df8bb17ba2b3b7a8e02c9b386e Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:02:50 +0000 Subject: [PATCH 55/97] debugging --- .gitlab-ci.yml | 42 +++++++++++++++++++++--------------------- Dockerfile | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 835d8b0..31eee7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,20 +6,20 @@ stages: variables: APP_VERSION: "1.2.0-SNAPSHOT" -download_jar: - stage: prepare - variables: - LOGGING_STRATEGY: "-q" - image: maven:3.9.5-ibm-semeru-17-focal - script: - - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." - - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION - - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -DoutputDirectory=target/ - - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}-exec.jar - - ls target - artifacts: - paths: - - target/ +# download_jar: +# stage: prepare +# variables: +# LOGGING_STRATEGY: "-q" +# image: maven:3.9.5-ibm-semeru-17-focal +# script: +# - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." +# - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION +# - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -DoutputDirectory=target/ +# - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}-exec.jar +# - ls target +# artifacts: +# paths: +# - target/ build_image: stage: build @@ -44,18 +44,18 @@ build_image: --destination "${CI_REGISTRY_IMAGE}:$IMAGE_TAG" --verbosity=debug - | - if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then + if [ ! -z "$ADDITIONAL_TAG" ]; then echo "Executing Kaniko build for additional tag $ADDITIONAL_TAG" /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" - --destination "${CI_REGISTRY_IMAGE}:latest" + --destination "${CI_REGISTRY_IMAGE}:$ADDITIONAL_TAG" fi rules: - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" || $CI_COMMIT_REF_NAME == "develop"' -deploy: - stage: deploy - image: maven:3.9.5-ibm-semeru-17-focal - script: - - mvn deploy -s ci_settings.xml -DskipTests +# deploy: +# stage: deploy +# image: maven:3.9.5-ibm-semeru-17-focal +# script: +# - mvn deploy -s ci_settings.xml -DskipTests diff --git a/Dockerfile b/Dockerfile index 1ecd880..ef3f6b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -# RUN mkdir /opt/shareclasses +RUN mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ # CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -- GitLab From 84a421bb9218c8fded086cdace40d37cc2722df3 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:04:47 +0000 Subject: [PATCH 56/97] used different base image --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ef3f6b3..e39a70a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM ibm-semeru-runtimes:open-17.0.7_7-jdk +# FROM ibm-semeru-runtimes:open-17.0.7_7-jdk +FROM openjdk:17-jdk RUN mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -- GitLab From c6caeee43904aff971b1903e9f6ff9e82d0262ad Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:06:05 +0000 Subject: [PATCH 57/97] updated kaniko version --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 31eee7c..8cdc202 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ variables: build_image: stage: build image: - name: gcr.io/kaniko-project/executor:debug + name: gcr.io/kaniko-project/executor:latest entrypoint: [""] before_script: - | -- GitLab From 42d23c477d3e8a039fb6479299095400375d2e92 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:09:13 +0000 Subject: [PATCH 58/97] reverted base image --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e39a70a..ef3f6b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -# FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -FROM openjdk:17-jdk +FROM ibm-semeru-runtimes:open-17.0.7_7-jdk RUN mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -- GitLab From 4db29df6f1b2ea0e8e338bce3d4ec29ec7637e42 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:10:12 +0000 Subject: [PATCH 59/97] debugging dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ef3f6b3..3bd5c71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -RUN mkdir /opt/shareclasses +RUN ls +# RUN mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ # CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -- GitLab From 75d78e02c956286d787f1ee08ef96d35a4e45a4b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:17:37 +0000 Subject: [PATCH 60/97] added sudo mkdir --- .gitlab-ci.yml | 2 +- Dockerfile | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8cdc202..31eee7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ variables: build_image: stage: build image: - name: gcr.io/kaniko-project/executor:latest + name: gcr.io/kaniko-project/executor:debug entrypoint: [""] before_script: - | diff --git a/Dockerfile b/Dockerfile index 3bd5c71..5dd8afe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -RUN ls -# RUN mkdir /opt/shareclasses +RUN sudo mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ # CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -- GitLab From 4642e7d7179ff95acde79388b7382eab54d474d0 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:23:29 +0000 Subject: [PATCH 61/97] debugging --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 31eee7c..15ecce9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ variables: build_image: stage: build image: - name: gcr.io/kaniko-project/executor:debug + name: gcr.io/kaniko-project/executor:debug-a1af057f997316bfb1c4d2d82719d78481a02a79 entrypoint: [""] before_script: - | -- GitLab From 6840b8a9499217a521419e8ebead2765e537f2e8 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:25:33 +0000 Subject: [PATCH 62/97] checking docker info --- .gitlab-ci.yml | 1 + Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15ecce9..e3b9c09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,7 @@ build_image: export IMAGE_TAG="develop" fi - echo "Building Docker image with tag $IMAGE_TAG" + - docker info script: # - mkdir -p /kaniko/.docker # - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json diff --git a/Dockerfile b/Dockerfile index 5dd8afe..ef3f6b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -RUN sudo mkdir /opt/shareclasses +RUN mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ # CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -- GitLab From 6b612dd12c9aefae6245056b8e20f4915e9803ae Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:58:02 +0000 Subject: [PATCH 63/97] debugging --- .gitlab-ci.yml | 4 ++-- Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3b9c09..3d0cec2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,8 +37,8 @@ build_image: - echo "Building Docker image with tag $IMAGE_TAG" - docker info script: - # - mkdir -p /kaniko/.docker - # - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" diff --git a/Dockerfile b/Dockerfile index ef3f6b3..ae7b3be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -RUN mkdir /opt/shareclasses +RUN touch tempfile +# RUN mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ # CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -- GitLab From 3f5b9eb25ea55c194ae0be5a222d9149ab28658c Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 12:58:24 +0000 Subject: [PATCH 64/97] removed docker info --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d0cec2..e7ed436 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,6 @@ build_image: export IMAGE_TAG="develop" fi - echo "Building Docker image with tag $IMAGE_TAG" - - docker info script: - mkdir -p /kaniko/.docker - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json -- GitLab From 381400f7cbab96ee7be6eed0063ceafc6ea22550 Mon Sep 17 00:00:00 2001 From: Andreas Polychronopoulos Date: Fri, 15 Dec 2023 13:03:49 +0000 Subject: [PATCH 65/97] test --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ae7b3be..b6e4166 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -RUN touch tempfile +RUN touch /var/tmp/tempfile # RUN mkdir /opt/shareclasses # RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -- GitLab From d7c434dc3953422e83ae7b301167a2982bab1d64 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 15 Dec 2023 13:21:06 +0000 Subject: [PATCH 66/97] removed Dockerfile comments and reverted kaniko image --- .gitlab-ci.yml | 2 +- Dockerfile | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7ed436..82e23f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ variables: build_image: stage: build image: - name: gcr.io/kaniko-project/executor:debug-a1af057f997316bfb1c4d2d82719d78481a02a79 + name: gcr.io/kaniko-project/executor:debug entrypoint: [""] before_script: - | diff --git a/Dockerfile b/Dockerfile index b6e4166..886550a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -RUN touch /var/tmp/tempfile -# RUN mkdir /opt/shareclasses -# RUN mkdir -p /opt/openslice/lib/ -# COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -# CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -# EXPOSE 13082 \ No newline at end of file +RUN mkdir /opt/shareclasses +RUN mkdir -p /opt/openslice/lib/ +COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ +CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] +EXPOSE 13082 \ No newline at end of file -- GitLab From fee42de6eea25da96ab4cfc6de615ea92d1e66b4 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 08:36:12 +0000 Subject: [PATCH 67/97] debugging --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 886550a..ef3f6b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk RUN mkdir /opt/shareclasses -RUN mkdir -p /opt/openslice/lib/ -COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -EXPOSE 13082 \ No newline at end of file +# RUN mkdir -p /opt/openslice/lib/ +# COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ +# CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] +# EXPOSE 13082 \ No newline at end of file -- GitLab From 0c482934b9a88b473efa2d93afaed1425f73f29f Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 08:37:51 +0000 Subject: [PATCH 68/97] debugging Dockerfile --- .gitlab-ci.yml | 3 +-- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82e23f0..352bb84 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ build_image: image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] - before_script: + script: - | if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then export IMAGE_TAG=$(echo $CI_COMMIT_REF_NAME | tr -cd '[:alnum:]._-') # $CI_COMMIT_TAG @@ -35,7 +35,6 @@ build_image: export IMAGE_TAG="develop" fi - echo "Building Docker image with tag $IMAGE_TAG" - script: - mkdir -p /kaniko/.docker - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor diff --git a/Dockerfile b/Dockerfile index ef3f6b3..5f12b5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk RUN mkdir /opt/shareclasses -# RUN mkdir -p /opt/openslice/lib/ +RUN mkdir -p /opt/openslice/lib/ # COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ # CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] # EXPOSE 13082 \ No newline at end of file -- GitLab From 0e48138867818f0968d71a5a5d25d43769e3da80 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 08:40:21 +0000 Subject: [PATCH 69/97] debugging --- .gitlab-ci.yml | 4 +++- Dockerfile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 352bb84..c71f192 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ build_image: image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] - script: + before_script: - | if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then export IMAGE_TAG=$(echo $CI_COMMIT_REF_NAME | tr -cd '[:alnum:]._-') # $CI_COMMIT_TAG @@ -35,6 +35,7 @@ build_image: export IMAGE_TAG="develop" fi - echo "Building Docker image with tag $IMAGE_TAG" + script: - mkdir -p /kaniko/.docker - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor @@ -45,6 +46,7 @@ build_image: - | if [ ! -z "$ADDITIONAL_TAG" ]; then echo "Executing Kaniko build for additional tag $ADDITIONAL_TAG" + echo "${CI_REGISTRY_IMAGE}:$ADDITIONAL_TAG" /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" diff --git a/Dockerfile b/Dockerfile index 5f12b5f..4b2c41e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk RUN mkdir /opt/shareclasses RUN mkdir -p /opt/openslice/lib/ -# COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ +COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ # CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] # EXPOSE 13082 \ No newline at end of file -- GitLab From 9d0574ac8e8eafa44ee6fa087d5a2da884e92c5b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 08:43:50 +0000 Subject: [PATCH 70/97] testing all jobs --- .gitlab-ci.yml | 38 +++++++++++++++++++------------------- Dockerfile | 4 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c71f192..bb8c749 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,20 +6,20 @@ stages: variables: APP_VERSION: "1.2.0-SNAPSHOT" -# download_jar: -# stage: prepare -# variables: -# LOGGING_STRATEGY: "-q" -# image: maven:3.9.5-ibm-semeru-17-focal -# script: -# - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." -# - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -# - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -DoutputDirectory=target/ -# - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}-exec.jar -# - ls target -# artifacts: -# paths: -# - target/ +download_jar: + stage: prepare + variables: + LOGGING_STRATEGY: "-q" + image: maven:3.9.5-ibm-semeru-17-focal + script: + - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." + - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION + - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -DoutputDirectory=target/ + - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}-exec.jar + - ls target + artifacts: + paths: + - target/ build_image: stage: build @@ -55,8 +55,8 @@ build_image: rules: - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" || $CI_COMMIT_REF_NAME == "develop"' -# deploy: -# stage: deploy -# image: maven:3.9.5-ibm-semeru-17-focal -# script: -# - mvn deploy -s ci_settings.xml -DskipTests +deploy: + stage: deploy + image: maven:3.9.5-ibm-semeru-17-focal + script: + - mvn deploy -s ci_settings.xml -DskipTests diff --git a/Dockerfile b/Dockerfile index 4b2c41e..886550a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,5 +2,5 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk RUN mkdir /opt/shareclasses RUN mkdir -p /opt/openslice/lib/ COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ -# CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -# EXPOSE 13082 \ No newline at end of file +CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] +EXPOSE 13082 \ No newline at end of file -- GitLab From e414af798eddf4790db11d98c9d659b5851e6cb2 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 08:47:38 +0000 Subject: [PATCH 71/97] syntax fix for latest tag --- .gitlab-ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb8c749..84f9791 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,14 +42,12 @@ build_image: --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$IMAGE_TAG" - --verbosity=debug - | if [ ! -z "$ADDITIONAL_TAG" ]; then echo "Executing Kaniko build for additional tag $ADDITIONAL_TAG" - echo "${CI_REGISTRY_IMAGE}:$ADDITIONAL_TAG" - /kaniko/executor - --context "${CI_PROJECT_DIR}" - --dockerfile "${CI_PROJECT_DIR}/Dockerfile" + /kaniko/executor \ + --context "${CI_PROJECT_DIR}" \ + --dockerfile "${CI_PROJECT_DIR}/Dockerfile" \ --destination "${CI_REGISTRY_IMAGE}:$ADDITIONAL_TAG" fi rules: -- GitLab From a09d4546cf4f5589558b9974b470b369363752c7 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 08:49:53 +0000 Subject: [PATCH 72/97] removed mkdir command due to conflict --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 886550a..0d36beb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ibm-semeru-runtimes:open-17.0.7_7-jdk -RUN mkdir /opt/shareclasses +# RUN mkdir /opt/shareclasses RUN mkdir -p /opt/openslice/lib/ COPY target/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar /opt/openslice/lib/ CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.tmf.api-1.2.0-SNAPSHOT-exec.jar"] -- GitLab From 914f2ff823011abcb220368b3520502ba0d83184 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 10:22:53 +0000 Subject: [PATCH 73/97] cleanup stages and jobs --- .gitlab-ci.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 84f9791..1736c88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,18 @@ stages: - - prepare - - build - - deploy + - java_build + - docker_build variables: APP_VERSION: "1.2.0-SNAPSHOT" +deploy_jar: + stage: java_build + image: maven:3.9.5-ibm-semeru-17-focal + script: + - mvn deploy -s ci_settings.xml -DskipTests + download_jar: - stage: prepare + stage: docker_build variables: LOGGING_STRATEGY: "-q" image: maven:3.9.5-ibm-semeru-17-focal @@ -22,7 +27,7 @@ download_jar: - target/ build_image: - stage: build + stage: docker_build image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] @@ -52,9 +57,5 @@ build_image: fi rules: - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" || $CI_COMMIT_REF_NAME == "develop"' - -deploy: - stage: deploy - image: maven:3.9.5-ibm-semeru-17-focal - script: - - mvn deploy -s ci_settings.xml -DskipTests + needs: + - download_jar \ No newline at end of file -- GitLab From acb717ba0bacd2f97b3f61be7f135382aaccfe8d Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:07:17 +0000 Subject: [PATCH 74/97] cleanup and added tagging rules --- .gitlab-ci.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1736c88..dd30273 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,6 @@ download_jar: - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -DoutputDirectory=target/ - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}-exec.jar - - ls target artifacts: paths: - target/ @@ -33,29 +32,26 @@ build_image: entrypoint: [""] before_script: - | - if [ "$CI_COMMIT_REF_NAME" = "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" ]; then - export IMAGE_TAG=$(echo $CI_COMMIT_REF_NAME | tr -cd '[:alnum:]._-') # $CI_COMMIT_TAG - export ADDITIONAL_TAG="latest" + if [ "$CI_COMMIT_REF_NAME" = "main" ]; then + if [ -n "$CI_COMMIT_TAG" ]; then + IMAGE_TAG=$CI_COMMIT_TAG + else + IMAGE_TAG="latest" # Default tag if no specific tag is found + fi elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then - export IMAGE_TAG="develop" + IMAGE_TAG="develop" + else + IMAGE_TAG=$APP_VERSION fi - - echo "Building Docker image with tag $IMAGE_TAG" + echo "Building Docker image with tag $IMAGE_TAG" script: - - mkdir -p /kaniko/.docker - - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$IMAGE_TAG" - - | - if [ ! -z "$ADDITIONAL_TAG" ]; then - echo "Executing Kaniko build for additional tag $ADDITIONAL_TAG" - /kaniko/executor \ - --context "${CI_PROJECT_DIR}" \ - --dockerfile "${CI_PROJECT_DIR}/Dockerfile" \ - --destination "${CI_REGISTRY_IMAGE}:$ADDITIONAL_TAG" - fi rules: - - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry" || $CI_COMMIT_REF_NAME == "develop"' + - if: '$CI_COMMIT_REF_NAME == "main"' + - if: '$CI_COMMIT_REF_NAME == "develop"' + - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry"' needs: - - download_jar \ No newline at end of file + - download_jar -- GitLab From 628246004599ac9914330cb822fbc4ca527fe299 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:17:18 +0000 Subject: [PATCH 75/97] unified logic for VERSIONING everything --- .gitlab-ci.yml | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dd30273..16efd41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,13 +3,23 @@ stages: - docker_build variables: - APP_VERSION: "1.2.0-SNAPSHOT" + DEFAULT_TAG: "1.2.0-SNAPSHOT" + +before_script: + - | + if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then + export APP_VERSION=$CI_COMMIT_TAG + elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then + export APP_VERSION="develop" + else + export APP_VERSION=$DEFAULT_TAG + fi deploy_jar: stage: java_build image: maven:3.9.5-ibm-semeru-17-focal script: - - mvn deploy -s ci_settings.xml -DskipTests + - mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION download_jar: stage: docker_build @@ -24,31 +34,14 @@ download_jar: artifacts: paths: - target/ - + build_image: stage: docker_build image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] - before_script: - - | - if [ "$CI_COMMIT_REF_NAME" = "main" ]; then - if [ -n "$CI_COMMIT_TAG" ]; then - IMAGE_TAG=$CI_COMMIT_TAG - else - IMAGE_TAG="latest" # Default tag if no specific tag is found - fi - elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then - IMAGE_TAG="develop" - else - IMAGE_TAG=$APP_VERSION - fi - echo "Building Docker image with tag $IMAGE_TAG" script: - - /kaniko/executor - --context "${CI_PROJECT_DIR}" - --dockerfile "${CI_PROJECT_DIR}/Dockerfile" - --destination "${CI_REGISTRY_IMAGE}:$IMAGE_TAG" + - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$APP_VERSION" rules: - if: '$CI_COMMIT_REF_NAME == "main"' - if: '$CI_COMMIT_REF_NAME == "develop"' -- GitLab From 75339df940c424f75b3d472ba1fcd927b43f27e9 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:24:45 +0000 Subject: [PATCH 76/97] latest tag also added when from main --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 16efd41..122ad6f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,6 +42,11 @@ build_image: entrypoint: [""] script: - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$APP_VERSION" + - | + if [ "$CI_COMMIT_REF_NAME" = "main" ]; then + echo "Pushing Docker image with tag 'latest'" + /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest" + fi rules: - if: '$CI_COMMIT_REF_NAME == "main"' - if: '$CI_COMMIT_REF_NAME == "develop"' -- GitLab From 97b2ca763f1ea2dffa62f391dabd1bda2cc82501 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:33:40 +0000 Subject: [PATCH 77/97] made all jobs run only on certain branch push --- .gitlab-ci.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 122ad6f..211dbe5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,13 @@ stages: - java_build - docker_build +# Define default rules as a YAML anchor +.default_rules: &default_rules + rules: + - if: '$CI_COMMIT_REF_NAME == "main"' + - if: '$CI_COMMIT_REF_NAME == "develop"' + - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry"' + variables: DEFAULT_TAG: "1.2.0-SNAPSHOT" @@ -20,6 +27,7 @@ deploy_jar: image: maven:3.9.5-ibm-semeru-17-focal script: - mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION + <<: *default_rules download_jar: stage: docker_build @@ -34,6 +42,7 @@ download_jar: artifacts: paths: - target/ + <<: *default_rules build_image: stage: docker_build @@ -47,9 +56,6 @@ build_image: echo "Pushing Docker image with tag 'latest'" /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest" fi - rules: - - if: '$CI_COMMIT_REF_NAME == "main"' - - if: '$CI_COMMIT_REF_NAME == "develop"' - - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry"' + <<: *default_rules needs: - download_jar -- GitLab From 2301cd24315bfccbad2e4dff4e3f8484f0b204fd Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:41:24 +0000 Subject: [PATCH 78/97] comment cleanup --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 211dbe5..2daca00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,8 @@ stages: - java_build - docker_build + - mr_build -# Define default rules as a YAML anchor .default_rules: &default_rules rules: - if: '$CI_COMMIT_REF_NAME == "main"' -- GitLab From 64b2fbce3d85874199300228f332f6ebda226cce Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:41:42 +0000 Subject: [PATCH 79/97] minor cleanup --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2daca00..1e0483e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ stages: - java_build - docker_build - - mr_build .default_rules: &default_rules rules: -- GitLab From d486f73e5c93c3aac162246e1d1cbe94b56b518f Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:53:01 +0000 Subject: [PATCH 80/97] removed intermediate job --- .gitlab-ci.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e0483e..8fa3c0b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,29 +21,20 @@ before_script: export APP_VERSION=$DEFAULT_TAG fi -deploy_jar: +java_build: stage: java_build image: maven:3.9.5-ibm-semeru-17-focal script: - mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION - <<: *default_rules - -download_jar: - stage: docker_build - variables: - LOGGING_STRATEGY: "-q" - image: maven:3.9.5-ibm-semeru-17-focal - script: - - echo "Maven logging strategy set to quiet. For more verbosity, change LOGGING_STRATEGY in the job configuration." - - mvn -s ci_settings.xml $LOGGING_STRATEGY dependency:get -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION - - mvn -s ci_settings.xml dependency:copy -Dartifact=org.etsi.osl:org.etsi.osl.tmf.api:$APP_VERSION -DoutputDirectory=target/ + - ls + - ls target/ - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}-exec.jar artifacts: paths: - target/ <<: *default_rules -build_image: +docker_build: stage: docker_build image: name: gcr.io/kaniko-project/executor:debug -- GitLab From c7e1b1df34ad672317cd67e3d8e82bc26029ae95 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:53:23 +0000 Subject: [PATCH 81/97] removed needs section --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8fa3c0b..e610fb0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,5 +47,3 @@ docker_build: /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest" fi <<: *default_rules - needs: - - download_jar -- GitLab From abbb956cb98d5d6a2c4c9d892c3d8ad54c11ad9b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 12:55:33 +0000 Subject: [PATCH 82/97] removed debug commands --- .gitlab-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e610fb0..ac828af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,9 +26,6 @@ java_build: image: maven:3.9.5-ibm-semeru-17-focal script: - mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION - - ls - - ls target/ - - mv target/org.etsi.osl.tmf.api-*.jar target/org.etsi.osl.tmf.api-${APP_VERSION}-exec.jar artifacts: paths: - target/ -- GitLab From 3451ead7ce98a584bd4b5d4c118c4100e53d3ad7 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 14:55:43 +0000 Subject: [PATCH 83/97] testing inheritance --- .gitlab-ci.yml | 52 +++++++------------------------------------------- 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac828af..9514faf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,46 +1,8 @@ -stages: - - java_build - - docker_build - -.default_rules: &default_rules - rules: - - if: '$CI_COMMIT_REF_NAME == "main"' - - if: '$CI_COMMIT_REF_NAME == "develop"' - - if: '$CI_COMMIT_REF_NAME == "12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry"' - -variables: - DEFAULT_TAG: "1.2.0-SNAPSHOT" - -before_script: - - | - if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then - export APP_VERSION=$CI_COMMIT_TAG - elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then - export APP_VERSION="develop" - else - export APP_VERSION=$DEFAULT_TAG - fi - +include: + - project: 'org.etsi.osl.main' + ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + file: '.gitlab-ci.yml' + java_build: - stage: java_build - image: maven:3.9.5-ibm-semeru-17-focal - script: - - mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION - artifacts: - paths: - - target/ - <<: *default_rules - -docker_build: - stage: docker_build - image: - name: gcr.io/kaniko-project/executor:debug - entrypoint: [""] - script: - - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$APP_VERSION" - - | - if [ "$CI_COMMIT_REF_NAME" = "main" ]; then - echo "Pushing Docker image with tag 'latest'" - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest" - fi - <<: *default_rules + extends: java_build + \ No newline at end of file -- GitLab From 867f3c5a42ab711a5c2cf52c4ff43c6ee2efb1f4 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 15:07:31 +0000 Subject: [PATCH 84/97] fixed project path --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9514faf..e87bf8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ include: - - project: 'org.etsi.osl.main' + - project: 'rep/osl/code/org.etsi.osl.main' ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main file: '.gitlab-ci.yml' -- GitLab From e8fcfba3c92aff0f6eacf501e72d5899929b9486 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 15:08:09 +0000 Subject: [PATCH 85/97] updated project path --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e87bf8b..4a7417d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ include: - - project: 'rep/osl/code/org.etsi.osl.main' + - project: 'osl/code/org.etsi.osl.main' ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main file: '.gitlab-ci.yml' -- GitLab From a26585067873cfdc7247e08c349f603faa8a5c41 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 15:09:58 +0000 Subject: [PATCH 86/97] solved circular dpendency --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a7417d..62358ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,6 @@ include: ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main file: '.gitlab-ci.yml' -java_build: +jar_build: extends: java_build \ No newline at end of file -- GitLab From 6c7cc97e629b66217d35ce1199cb3a9dd7e1e7d7 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 15:20:03 +0000 Subject: [PATCH 87/97] added stages --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62358ea..6ae73c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,13 @@ +stages: + - java_build +# - docker_build + include: - project: 'osl/code/org.etsi.osl.main' ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main file: '.gitlab-ci.yml' jar_build: + stage: java_build extends: java_build \ No newline at end of file -- GitLab From c893609fb1abf2cbb1d77e4098eb37075222e7d8 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 15:21:46 +0000 Subject: [PATCH 88/97] debugging --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ae73c1..6283693 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ -stages: - - java_build +# stages: +# - java_build # - docker_build include: @@ -8,6 +8,6 @@ include: file: '.gitlab-ci.yml' jar_build: - stage: java_build + # stage: java_build extends: java_build \ No newline at end of file -- GitLab From b18787530742aa7d04d98cdcb2e938d411116292 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 16:12:36 +0000 Subject: [PATCH 89/97] simplified ci with includes --- .gitlab-ci.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6283693..5bd3922 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,7 @@ -# stages: -# - java_build -# - docker_build - include: - - project: 'osl/code/org.etsi.osl.main' + - project: osl/code/org.etsi.osl.main ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main - file: '.gitlab-ci.yml' - -jar_build: - # stage: java_build - extends: java_build - \ No newline at end of file + file: 'ci-templates/build.yml' + +maven_build: + extends: .maven_build -- GitLab From 4fadef0f85edd90f982f4a831a63bb66b8f13e69 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 16:13:39 +0000 Subject: [PATCH 90/97] also included base gitlab ci --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5bd3922..853647b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,9 @@ include: - project: osl/code/org.etsi.osl.main ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main - file: 'ci-templates/build.yml' + file: + - '.gitlab-ci.yml' + - 'ci-templates/build.yml' maven_build: extends: .maven_build -- GitLab From 7a19fd46acfb36cb47b8177ca2c9e7c66e62a5bc Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 16:14:54 +0000 Subject: [PATCH 91/97] added docker build job --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 853647b..8787a3c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,3 +7,6 @@ include: maven_build: extends: .maven_build + +docker_build: + extends: .docker_build -- GitLab From c1796f866c74bbbd919684297a2f145e087927df Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 16:26:28 +0000 Subject: [PATCH 92/97] added job dependency --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8787a3c..bd21353 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,3 +10,5 @@ maven_build: docker_build: extends: .docker_build + needs: + - maven_build -- GitLab From 00d3897d9f81e15d7d650645111c1b6ba6b21244 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 16:49:04 +0000 Subject: [PATCH 93/97] fixed job dependency and inclusion --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd21353..e2a6cb7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ include: - project: osl/code/org.etsi.osl.main ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main file: - - '.gitlab-ci.yml' + - 'ci-templates/default.yml' - 'ci-templates/build.yml' maven_build: -- GitLab From c8065cacb6d0a765877ea1fd4ee3f3a9b8710ee4 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 16:53:59 +0000 Subject: [PATCH 94/97] cosmetic changes --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2a6cb7..92f4697 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,8 +2,8 @@ include: - project: osl/code/org.etsi.osl.main ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main file: - - 'ci-templates/default.yml' - - 'ci-templates/build.yml' + - ci-templates/default.yml + - ci-templates/build.yml maven_build: extends: .maven_build -- GitLab From 910f591717d8bb27539f90532adb4a791c65cac1 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 16:56:59 +0000 Subject: [PATCH 95/97] testing --- .gitlab-ci.yml | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92f4697..19f9abb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,37 @@ -include: - - project: osl/code/org.etsi.osl.main - ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main - file: - - ci-templates/default.yml - - ci-templates/build.yml +# include: +# - project: osl/code/org.etsi.osl.main +# ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main +# file: +# - ci-templates/default.yml +# - ci-templates/build.yml -maven_build: - extends: .maven_build +# maven_build: +# extends: .maven_build + +# docker_build: +# extends: .docker_build +# needs: +# - maven_build -docker_build: - extends: .docker_build - needs: - - maven_build +.default: + variables: + DEFAULT_TAG: "1.2.0-SNAPSHOT" + before_script: + - | + if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then + export APP_VERSION=$CI_COMMIT_TAG + elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then + export APP_VERSION="develop" + else + export APP_VERSION=$DEFAULT_TAG + fi + +maven_build: + extends: .default + stage: build + image: maven:3.9.5-ibm-semeru-17-focal + script: + - mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION + artifacts: + paths: + - target/ \ No newline at end of file -- GitLab From 48aa2c5abcecc1f03b24f6620fdf3ad9f6b5d1f4 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Mon, 18 Dec 2023 17:05:03 +0000 Subject: [PATCH 96/97] final cleanup --- .gitlab-ci.yml | 47 ++++++++++++----------------------------------- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19f9abb..92f4697 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,37 +1,14 @@ -# include: -# - project: osl/code/org.etsi.osl.main -# ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main -# file: -# - ci-templates/default.yml -# - ci-templates/build.yml - -# maven_build: -# extends: .maven_build - -# docker_build: -# extends: .docker_build -# needs: -# - maven_build - -.default: - variables: - DEFAULT_TAG: "1.2.0-SNAPSHOT" - before_script: - - | - if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then - export APP_VERSION=$CI_COMMIT_TAG - elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then - export APP_VERSION="develop" - else - export APP_VERSION=$DEFAULT_TAG - fi +include: + - project: osl/code/org.etsi.osl.main + ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + file: + - ci-templates/default.yml + - ci-templates/build.yml maven_build: - extends: .default - stage: build - image: maven:3.9.5-ibm-semeru-17-focal - script: - - mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION - artifacts: - paths: - - target/ \ No newline at end of file + extends: .maven_build + +docker_build: + extends: .docker_build + needs: + - maven_build -- GitLab From 5b51366b04ac931d7daa2902999f46642f68b916 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 13:50:45 +0000 Subject: [PATCH 97/97] used dynamic ref in inheritance --- .gitlab-ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92f4697..8ea78d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,27 @@ include: - project: osl/code/org.etsi.osl.main - ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + ref: main file: - ci-templates/default.yml - ci-templates/build.yml + rules: + - if: '$CI_COMMIT_REF_NAME == "main"' + + - project: osl/code/org.etsi.osl.main + ref: develop + file: + - ci-templates/default.yml + - ci-templates/build.yml + rules: + - if: '$CI_COMMIT_REF_NAME == "develop"' + + - project: osl/code/org.etsi.osl.main + ref: develop + file: + - ci-templates/default.yml + - ci-templates/build_unprotected.yml + rules: + - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"' maven_build: extends: .maven_build -- GitLab