Skip to content

Commit

Permalink
ci: tagging and releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
lanathlor committed Nov 14, 2024
1 parent debb0d7 commit ca6d4b6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
37 changes: 33 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ test clearndr:
image: git.stamus-networks.com:4567/devel/stamus-ctl/cli:main
tags:
- k8s
rules:
- if: $CI_COMMIT_BRANCH
when: on_success
variables:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: '/certs'
Expand Down Expand Up @@ -50,9 +53,9 @@ tests:
"${CI_PROJECT_DIR}/."
-f "${CI_PROJECT_DIR}/Dockerfile"
--build-arg "path=/tests"
-t "${CI_REGISTRY_IMAGE}/tests:${CI_COMMIT_SHORT_SHA}"
-t "${CI_REGISTRY_IMAGE}/tests:${CI_COMMIT_REF_NAME}"
-t "${CI_REGISTRY_IMAGE}/tests:${CI_COMMIT_BRANCH}"
- docker push ${CI_REGISTRY_IMAGE}/tests:${CI_COMMIT_SHORT_SHA}
- docker push ${CI_REGISTRY_IMAGE}/tests:${CI_COMMIT_REF_NAME}
- docker push ${CI_REGISTRY_IMAGE}/tests:${CI_COMMIT_BRANCH}


Expand All @@ -74,9 +77,9 @@ clearndr:
"${CI_PROJECT_DIR}/."
-f "${CI_PROJECT_DIR}/Dockerfile"
--build-arg "path=/clearndr"
-t "${CI_REGISTRY_IMAGE}/clearndr:${CI_COMMIT_SHORT_SHA}"
-t "${CI_REGISTRY_IMAGE}/clearndr:${CI_COMMIT_REF_NAME}"
-t "${CI_REGISTRY_IMAGE}/clearndr:${CI_COMMIT_BRANCH}"
- docker push ${CI_REGISTRY_IMAGE}/clearndr:${CI_COMMIT_SHORT_SHA}
- docker push ${CI_REGISTRY_IMAGE}/clearndr:${CI_COMMIT_REF_NAME}
- docker push ${CI_REGISTRY_IMAGE}/clearndr:${CI_COMMIT_BRANCH}

release-to-github:
Expand All @@ -94,3 +97,29 @@ release-to-github:
- git branch --set-upstream-to github/next
- git pull --rebase
- git push github HEAD:next


create-tags:
stage: release
image: bitnami/git
allow_failure: true
rules:
- if: '$CI_COMMIT_BRANCH == "latest"'
when: on_success
script:
- git config --global user.email $GITLAB_USER_EMAIL
- git config --global user.name $GITLAB_USER_NAME
- tag=$(cat version.txt)
- git tag "$tag"
- git push --tags https://repo-token:$ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git HEAD:main

create release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "running release_job"
release:
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'
1 change: 0 additions & 1 deletion values.txt

This file was deleted.

2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.2
0.0.1-rc1

0 comments on commit ca6d4b6

Please sign in to comment.