From 34ae1ef7ffb7c27b8f09a62b3eb7029ababcab2b Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 21 Jan 2018 21:53:05 -0600 Subject: [PATCH] add basic gitlab ci --- .gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..64c1efe --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,39 @@ +# build the go app, then wrap it in an image +stages: + - build + - image + +build:app: + stage: build + image: golang:1.6 + tags: + - runner:k8s + script: + - go get + - go build + artifacts: + paths: + - home-dns + expire_in: 1 hour + +build:image: + stage: image + image: docker + services: + - docker:dind + tags: + - runner:k8s + script: + # prep secrets + - mkdir /root/.docker + - ln -s /secrets/docker /root/.docker/config.json + - docker info + # build it + - docker build -t $IMAGE_TAG . + - docker push $IMAGE_TAG + dependencies: + - build:app + variables: + DOCKER_DRIVER: overlay2 + DOCKER_HOST: tcp://localhost:2375 + IMAGE_TAG: ssube/home-dns:$CI_COMMIT_REF_SLUG