From bbb28a384d8e5b8b2e730c763be9892d451cae65 Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Sun, 5 Aug 2018 19:09:53 -0700
Subject: [PATCH] Update with latest CI template

---
 .gitlab-ci.yml | 57 +++++++++++++++++++++++---------------------------
 1 file changed, 26 insertions(+), 31 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4dcfd1d..a428e66 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,45 +1,40 @@
 # This file is a template, and might need editing before it works on your project.
 image: golang:latest
 
+variables:
+  REPO_NAME: git.ethitter.com/debian/eth-log-alerting
+
 # The problem is that to be able to use go get, one needs to put
 # the repository in the $GOPATH. So for example if your gitlab domain
-# is mydomainperso.com, and that your repository is repos/projectname, and
+# is gitlab.com, and that your repository is namespace/project, and
 # the default GOPATH being /go, then you'd need to have your
-# repository in /go/src/mydomainperso.com/repos/projectname 
+# repository in /go/src/gitlab.com/namespace/project
 # Thus, making a symbolic link corrects this.
 before_script:
-    - ln -s /builds /go/src/git.ethitter.com
-    - cd /go/src/git.ethitter.com/debian/eth-log-alerting
-    - go version
+  - mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
+  - ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
+  - cd $GOPATH/src/$REPO_NAME
+
+  - go version
+
+  - go get github.com/asaskevich/govalidator
+  - go get github.com/ashwanthkumar/slack-go-webhook
+  - go get github.com/hpcloud/tail
 
 stages:
-    - test
-    - build
+  - test
+  - build
 
 format:
-    stage: test
-    script:
-        # Add here all the dependencies, or use glide/govendor to get
-        # them automatically.
-        # - curl https://glide.sh/get | sh
-        - go get github.com/asaskevich/govalidator
-        - go get github.com/ashwanthkumar/slack-go-webhook
-        - go get github.com/hpcloud/tail
-        - go get github.com/alecthomas/kingpin
-        - go tool vet -composites=false -shadow=true *.go
-        - go test -race $(go list ./... | grep -v /vendor/)
+  stage: test
+  script:
+    - go tool vet -composites=false -shadow=true *.go
+    - go test -race $(go list ./... | grep -v /vendor/)
 
 compile:
-    stage: build
-    script:
-        # Add here all the dependencies, or use glide/govendor/...
-        # to get them automatically.
-        - go get github.com/42wim/matterbridge/matterhook
-        - go get github.com/asaskevich/govalidator
-        - go get github.com/hpcloud/tail
-        - go get github.com/alecthomas/kingpin
-        # Better put this in a Makefile
-        - go build -race -ldflags "-extldflags '-static'" -o eth-log-alerting
-    artifacts:
-        paths:
-            - eth-log-alerting
+  stage: build
+  script:
+    - go build -race -ldflags "-extldflags '-static'" -o eth-log-alerting
+  artifacts:
+    paths:
+      - eth-log-alerting
-- 
GitLab