Update .gitlab-ci.yml

This commit is contained in:
an 2017-12-18 11:00:39 +00:00
parent 93ba4b5ac5
commit e09e514acc
1 changed files with 4 additions and 9 deletions

View File

@ -9,7 +9,6 @@ before_script:
variables: variables:
VERSIONGO: version.go VERSIONGO: version.go
BUILDDATEGO: builddate.go
stages: stages:
- build - build
@ -29,14 +28,10 @@ build:
- echo -n " FlokatiBuild = \"" >>$VERSIONGO - echo -n " FlokatiBuild = \"" >>$VERSIONGO
- echo -n "$REV" >>$VERSIONGO - echo -n "$REV" >>$VERSIONGO
- echo "\"" >>$VERSIONGO - echo "\"" >>$VERSIONGO
- echo -n " FlokatiBuilddate = \"" >>$VERSIONGO
- echo -n "$BUILDDATE" >>$VERSIONGO
- echo "\"" >>$VERSIONGO
- echo ")" >>$VERSIONGO - echo ")" >>$VERSIONGO
- echo "package main" >$BUILDDATEGO
- echo "" >>$BUILDDATEGO
- echo "const (" >>$BUILDDATEGO
- echo -n " FlokatiBuilddate = \"" >>$BUILDDATEGO
- echo -n "$BUILDDATE" >>$BUILDDATEGO
- echo "\"" >>$BUILDDATEGO
- echo ")" >>$BUILDDATEGO
- cat version.go - cat version.go
- docker build -t "$IMAGE:$BRANCH-$REV" . - docker build -t "$IMAGE:$BRANCH-$REV" .
- docker push "$IMAGE:$BRANCH-$REV" - docker push "$IMAGE:$BRANCH-$REV"
@ -57,7 +52,7 @@ deploy:
- chmod 700 .ssh - chmod 700 .ssh
- echo "$K8S_SSH_PRIVATE_KEY" >.ssh/id_rsa - echo "$K8S_SSH_PRIVATE_KEY" >.ssh/id_rsa
- chmod 600 .ssh/id_rsa - chmod 600 .ssh/id_rsa
- echo "$K8S_SSH_PUBIC_KEY" >.ssh/id_rsa.pub - echo "$K8S_SSH_PUBLIC_KEY" >.ssh/id_rsa.pub
- chmod 600 .ssh/id_rsa.pub - chmod 600 .ssh/id_rsa.pub
- ssh -oStrictHostKeyChecking=no root@node04 "kubectl set image deployment/mmflokati-flokati mmflokati-flokati=dr.dnix.de/mmflokati:$BRANCH-$REV -n northbrigade" - ssh -oStrictHostKeyChecking=no root@node04 "kubectl set image deployment/mmflokati-flokati mmflokati-flokati=dr.dnix.de/mmflokati:$BRANCH-$REV -n northbrigade"
- ssh -oStrictHostKeyChecking=no root@node04 "kubectl set image deployment/mmflokati-armleuchter mmflokati-armleuchter=dr.dnix.de/mmflokati:$BRANCH-$REV -n northbrigade" - ssh -oStrictHostKeyChecking=no root@node04 "kubectl set image deployment/mmflokati-armleuchter mmflokati-armleuchter=dr.dnix.de/mmflokati:$BRANCH-$REV -n northbrigade"