7 Commits

3 changed files with 51 additions and 20 deletions

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,29 @@ 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
- if [ "$CI_COMMIT_TAG" != "" ]; then
sed -i -e 's/GITTAGVERSION/'"$CI_COMMIT_TAG"':'"$CI_COMMIT_SHORT_SHA"'/' ./src/app/navigation/navigation.component.html;
fi
- 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 +61,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}

View File

@ -18,4 +18,9 @@
.spacer {
flex: 1 1 auto;
}
.gittagversion {
font-size: x-small;
margin-right: 5em;
}

View File

@ -20,6 +20,7 @@
</button>
<span>Nober Grundbesitz GbR Hausverwaltung</span>
<span class="spacer"></span>
<span class="gittagversion">GITTAGVERSION</span>
<a *ngIf="!authenticated" mat-button routerLink="/login">Login</a>
<a *ngIf="authenticated" mat-button routerLink="/logout">Logout</a>
</mat-toolbar>