3 Commits
0.0.1 ... 0.0.2

Author SHA1 Message Date
d916ab7b28 fix ci script for deploy 2021-07-01 16:26:34 +02:00
15082f5434 fix ci script for deploy 2021-07-01 16:24:31 +02:00
57a5fcffcb deploy 2021-07-01 16:23:41 +02:00

View File

@ -1,30 +1,12 @@
stages:
- build
- check
- build
- dockerize
- deploy
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
@ -40,6 +22,26 @@ check:
--validateMessage
--messageToValidate "$CI_COMMIT_MESSAGE"
build:
image: node:14-buster
stage: build
tags:
- hottis
- linux
- docker
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
dockerize:
image: registry.hottis.de/dockerized/docker-bash:latest
stage: dockerize
@ -56,3 +58,23 @@ dockerize:
- docker push $IMAGE_NAME:latest
- docker push $IMAGE_NAME:$CI_COMMIT_TAG
deploy:
stage: deploy
image: registry.hottis.de/dockerized/docker-bash:latest
only:
- tags
tags:
- hottis
- linux
- docker
variables:
GIT_STRATEGY: none
script:
- CONTAINER_NAME=$CI_PROJECT_NAME
- docker stop $CONTAINER_NAME || echo "$CONTAINER_NAME not running, anyway okay"
- docker rm $CONTAINER_NAME || echo "$CONTAINER_NAME not exsting, anyway okay"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY;
- docker pull $IMAGE_NAME:${CI_COMMIT_TAG}
- docker run -d --restart always --name $CONTAINER_NAME --network docker-server --ip 172.16.10.39 $IMAGE_NAME:${CI_COMMIT_TAG}