From 16029f00eca8429d5e2f8b43a3bd9422aa6bb6db Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Fri, 18 Jun 2021 21:02:19 +0200 Subject: [PATCH] add ci script --- .gitlab-ci.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..11623ae --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,58 @@ +stages: + - build + - check + - dockerize + +variables: + IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH + +build: + image: node:14-buster + stage: build + tags: + - hottis + - linux + - docker + rules: + - if: $CI_COMMIT_TAG + artifacts: + paths: + - dist.tgz + expire_in: 1 day + script: + - cd hv2-ui + - npm install + - ./node_modules/.bin/ng build --prod + - tar -czf ../dist.tgz dist + +check: + image: registry.hottis.de/dockerized/base-build-env:latest + stage: check + tags: + - hottis + - linux + - docker + rules: + - if: $CI_COMMIT_TAG + script: + - checksemver.py -v + --versionToValidate "$CI_COMMIT_TAG" + --validateMessage + --messageToValidate "$CI_COMMIT_MESSAGE" + +dockerize: + image: registry.hottis.de/dockerized/docker-bash:latest + stage: dockerize + tags: + - hottis + - linux + - docker + rules: + - if: $CI_COMMIT_TAG + script: + - tar -xzf dist.tgz + - docker build --tag $IMAGE_NAME:latest --tag $IMAGE_NAME:$CI_COMMIT_TAG . + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker push $IMAGE_NAME:latest + - docker push $IMAGE_NAME:$CI_COMMIT_TAG +