2016-12-03 04:35:23 +05:30
|
|
|
stages:
|
2017-08-18 03:43:24 +05:30
|
|
|
- test
|
2016-12-03 04:35:23 +05:30
|
|
|
- build
|
|
|
|
- push
|
|
|
|
|
|
|
|
variables:
|
|
|
|
CONTAINER_IMAGE: registry.ely.by/elyby/skinsystem
|
|
|
|
|
2017-08-18 03:43:24 +05:30
|
|
|
test:
|
|
|
|
image: golang:1.8.3-stretch
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- mkdir -p $GOPATH/src/$CI_PROJECT_NAMESPACE
|
|
|
|
- cp -r $(pwd) $GOPATH/src/$CI_PROJECT_PATH
|
|
|
|
- cd $GOPATH/src/$CI_PROJECT_PATH
|
|
|
|
- go get -u github.com/golang/dep/cmd/dep
|
|
|
|
- $GOPATH/bin/dep ensure
|
2017-08-21 21:15:27 +05:30
|
|
|
- ./script/coverage
|
2017-08-18 03:43:24 +05:30
|
|
|
|
2016-12-03 04:35:23 +05:30
|
|
|
build:
|
2017-08-18 03:43:24 +05:30
|
|
|
image: docker:latest
|
2016-12-03 04:35:23 +05:30
|
|
|
stage: build
|
2017-08-18 03:43:24 +05:30
|
|
|
before_script:
|
|
|
|
- docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by
|
2016-12-03 04:35:23 +05:30
|
|
|
script:
|
|
|
|
- export IMAGE_NAME="$CONTAINER_IMAGE:dev"
|
|
|
|
- docker build --pull -t $IMAGE_NAME .
|
|
|
|
- docker push $IMAGE_NAME
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
|
|
|
|
push_tags:
|
2017-08-18 03:43:24 +05:30
|
|
|
image: docker:latest
|
2016-12-03 04:35:23 +05:30
|
|
|
stage: push
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2017-08-18 03:43:24 +05:30
|
|
|
before_script:
|
|
|
|
- docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by
|
2016-12-03 04:35:23 +05:30
|
|
|
script:
|
|
|
|
- export IMAGE_NAME="$CONTAINER_IMAGE:$CI_BUILD_TAG"
|
|
|
|
- docker tag $CONTAINER_IMAGE:dev $CONTAINER_IMAGE:latest
|
|
|
|
- docker tag $CONTAINER_IMAGE:latest $IMAGE_NAME
|
|
|
|
- docker push $IMAGE_NAME
|
|
|
|
- docker push $CONTAINER_IMAGE:latest
|
|
|
|
only:
|
|
|
|
- tags
|