From eec6b384b70bfdf479120d55f47e27ddc1001be1 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Fri, 18 Aug 2017 01:13:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B2=D0=BA=D0=BB=D1=8E=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=B2=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 96ed414..86932c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,27 @@ -image: docker:latest - stages: + - test - build - push -before_script: - - docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by - variables: CONTAINER_IMAGE: registry.ely.by/elyby/skinsystem +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 + - go test $(go list ./... | grep -v /vendor/) + build: + image: docker:latest stage: build + before_script: + - docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by script: - export IMAGE_NAME="$CONTAINER_IMAGE:dev" - docker build --pull -t $IMAGE_NAME . @@ -20,9 +30,12 @@ build: - develop push_tags: + image: docker:latest stage: push variables: GIT_STRATEGY: none + before_script: + - docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by script: - export IMAGE_NAME="$CONTAINER_IMAGE:$CI_BUILD_TAG" - docker tag $CONTAINER_IMAGE:dev $CONTAINER_IMAGE:latest