Initial setup

This commit is contained in:
Thomas Peetz
2019-06-17 18:49:23 +02:00
commit fa3286c8e2
13 changed files with 582 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
stages:
- build
- test
- deploy
- notify
before_script:
- go get -u github.com/jstemmer/go-junit-report
- go get -u github.com/t-yuki/gocover-cobertura
Create Documentation:
stage: build
script:
- chmod +x docs/gradlew
- cd docs; ./gradlew --no-daemon asciidoctor
artifacts:
paths:
- docs/build/asciidoc/pdf/kalorienmanager.pdf
Compile Go Application:
stage: build
script: make build
Test Go Application:
stage: test
script:
- make test
- GOPATH=$HOME/go go test -v ./... 2>&1 | /home/gitlab-runner/go/bin/go-junit-report > report.xml
- GOPATH=$HOME/go go vet ./...
artifacts:
reports:
junit: report.xml
Deploy To Staging:
stage: deploy
script:
- make build
- ssh kalorienmanager /home/kalorienmanager/app-test_service stop
- rsync -av templates kalorienmanager:/home/kalorienmanager/staging
- rsync -av bin/kalorienmanager kalorienmanager:/home/kalorienmanager/staging
- ssh kalorienmanager /home/kalorienmanager/app-test_service start
environment:
name: staging
only:
- master
Deploy to Production:
stage: deploy
script:
- make build
- ssh kalorienmanager /home/kalorienmanager/app_service stop
- rsync -av templates kalorienmanager:/home/kalorienmanager/production
- rsync -av bin/kalorienmanager kalorienmanager:/home/kalorienmanager/production
- ssh kalorienmanager /home/kalorienmanager/app_service start
environment:
name: production
only:
- master
when: manual
Notify Telegram:
stage: notify
script:
- sh .ci-notify.sh ✅