From 1a6353dff0186d3481e28d4b35afde4e233ffa46 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 9 Dec 2021 11:47:29 +0100 Subject: [PATCH 1/6] Add image version badge generation to pipeline --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 047524d..c7a8452 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,3 +43,8 @@ build-image: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker build -t $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER . - docker push $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER + - curl https://img.shields.io/badge/image\ version-$GITLAB_SHORT_VER-informational -o image_version.svg + artifacts: + paths: + - image_version.svg + expire_in: 1 month From de5c2685b8a2a4067604d369f2a4b8779af9ddf7 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 9 Dec 2021 12:01:31 +0100 Subject: [PATCH 2/6] Add missing curl dependency --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7a8452..9ad349d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ build-image: script: - source .env.update - if [ "$NEED_UPDATE" = false ]; then exit 0; fi - - apk add git wget + - apk add git wget curl - git clone https://gitlab.com/gitlab-org/omnibus-gitlab - cd omnibus-gitlab - "GITLAB_VER=$(git tag | sort -V | grep -v rc | grep ce | tail -1)" From 344e361693e01e960effdc526fb4d1db3240ee6b Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 9 Dec 2021 12:05:32 +0100 Subject: [PATCH 3/6] Fix curl url format for badge creation --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ad349d..a5f5bec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,7 +43,7 @@ build-image: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker build -t $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER . - docker push $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER - - curl https://img.shields.io/badge/image\ version-$GITLAB_SHORT_VER-informational -o image_version.svg + - curl "https://img.shields.io/badge/image\ version-$GITLAB_SHORT_VER-informational" -o image_version.svg artifacts: paths: - image_version.svg From b8951a21bc72d87891736a221e2ad4719c7ec8a8 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 9 Dec 2021 12:20:00 +0100 Subject: [PATCH 4/6] Switch from curl to wget for badge generation --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a5f5bec..45f0c70 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ build-image: script: - source .env.update - if [ "$NEED_UPDATE" = false ]; then exit 0; fi - - apk add git wget curl + - apk add git wget - git clone https://gitlab.com/gitlab-org/omnibus-gitlab - cd omnibus-gitlab - "GITLAB_VER=$(git tag | sort -V | grep -v rc | grep ce | tail -1)" @@ -43,7 +43,7 @@ build-image: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker build -t $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER . - docker push $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER - - curl "https://img.shields.io/badge/image\ version-$GITLAB_SHORT_VER-informational" -o image_version.svg + - wget "https://img.shields.io/badge/image\ version-$GITLAB_SHORT_VER-informational" -O image_version.svg artifacts: paths: - image_version.svg From 053cb6787e45968c719552dd837ca2c04d888f5c Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 9 Dec 2021 12:23:07 +0100 Subject: [PATCH 5/6] Change path of image_version.svg --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 45f0c70..c442f42 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,7 +43,7 @@ build-image: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker build -t $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER . - docker push $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER - - wget "https://img.shields.io/badge/image\ version-$GITLAB_SHORT_VER-informational" -O image_version.svg + - wget "https://img.shields.io/badge/image\ version-$GITLAB_SHORT_VER-informational" -O ../../image_version.svg artifacts: paths: - image_version.svg From a533a35b74b9eaa5cce2c5860b86e838bd42ce2b Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 9 Dec 2021 12:26:50 +0100 Subject: [PATCH 6/6] Remove backslash from wget request --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c442f42..795326e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,7 +43,7 @@ build-image: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker build -t $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER . - docker push $CI_REGISTRY/athens-school/gitlab:$GITLAB_SHORT_VER - - wget "https://img.shields.io/badge/image\ version-$GITLAB_SHORT_VER-informational" -O ../../image_version.svg + - wget "https://img.shields.io/badge/image version-$GITLAB_SHORT_VER-informational" -O ../../image_version.svg artifacts: paths: - image_version.svg