Commit 6ac47902 authored by zauberstuhl's avatar zauberstuhl
Browse files

Add gitlab CI config file

see https://docs.gitlab.com/ee/ci/yaml

* Add dependency stage
* Use stretch image instead of alpine
* Add nodejs dependencies
* Add custom project dir (see XXX sections)
parent a3d37311
Pipeline #26 passed with stages
in 15 minutes and 12 seconds
image: golang:1.9-stretch
services:
- postgres:latest
variables:
POSTGRES_DB: ganggo
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
UPDATE_CHANNEL: alpha
#PATH: $PATH:$GOPATH/bin
#VERSION: $(git describe --abbrev=0 --tags)
BUILD_GOOS: linux
BUILD_GOARCH: amd64
# XXX not working yet see https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/876
CI_PROJECT_DIR: $GOPATH/src/github.com/ganggo/ganggo
stages:
- test
- package
- deploy
before_script:
- export VERSION=$(git describe --abbrev=0 --tags)
- curl -sL https://deb.nodesource.com/setup_10.x | bash -
- apt-get install -y nodejs
# XXX remove clone workaround if CI_PROJECT_DIR is implemented
- mkdir -p $GOPATH/src/github.com/ganggo
- ln -s $(pwd) $GOPATH/src/github.com/ganggo/ganggo
# XXX end
- cd $GOPATH/src/github.com/ganggo/ganggo && make install
running unit tests:
stage: test
script:
# if we define GOARCH, GOOS and GOARM directly
# it will be resetted after calling install/script function
# to avoid it we wrap the values in the BUILD-variables
- GOARCH=$BUILD_GOARCH GOOS=$BUILD_GOOS GOARM=$BUILD_GOARM make test
build update package:
stage: package
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- updater.*
script:
- GOARCH=$BUILD_GOARCH GOOS=$BUILD_GOOS GOARM=$BUILD_GOARM make release
after_script:
- export LABEL=$BUILD_GOOS-$BUILD_GOARCH.$UPDATE_CHANNEL
- mv updater updater.$LABEL
......@@ -95,7 +95,7 @@ endif
cp $(srcdir)/conf/app.conf.example $(srcdir)/conf/app.conf
# XXX revel will not print error stacks to console
# (see https://github.com/revel/cmd/issues/121)
revel test $(package) travis || { \
revel test $(package) ci || { \
cd $(srcdir) && bash tests/scripts/test_results.sh ;\
exit 1 ;\
}
......
......@@ -15,12 +15,12 @@ address = "localhost:9000"
db.driver = "postgres"
db.user = "postgres"
db.password = ""
db.host = ""
db.host = "postgres"
db.database = "ganggo"
# mysql
#db.dsn = "%s:%s@tcp(%s)/%s?parseTime=true"
# postgres
db.dsn = "user=%s password=%s host=%s dbname=%s sslmode=disable"
db.dsn = "postgres://%s:%s@%s/%s?sslmode=disable"
# The relay is disabled on default
# in respect of privacy matters
......@@ -238,9 +238,9 @@ log.error.flags = 3
log.request.output = off
################################################################################
# Section: travis
# Section: ci
# This section is dedicated to the continuous integration service only
[travis]
[ci]
mode.dev = true
results.pretty = true
watch = false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment