Skip to content

Commit

Permalink
Merge pull request cloudability#76 from DavidXArnold/gomod
Browse files Browse the repository at this point in the history
Gomod
  • Loading branch information
DavidXArnold authored Mar 2, 2020
2 parents 7ce2646 + a0683c8 commit 40d214f
Show file tree
Hide file tree
Showing 14 changed files with 427 additions and 702 deletions.
67 changes: 55 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
version: 2
version: 2.1
orbs:
snyk: snyk/[email protected]

jobs:

snyk_scan:
docker:
- image: 'circleci/golang:1.14'
steps:
- checkout
- snyk/scan:
fail-on-issues: true
organization: cloudability
monitor-on-build: true
severity-threshold: medium


build:
docker:
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/
- image: circleci/golang:1.11
- image: circleci/golang:1.14

working_directory: /go/src/github.com/cloudability/metrics-agent

Expand All @@ -15,16 +31,10 @@ jobs:

- run: mkdir -p $TEST_RESULTS

- run:
name: Install / run dep
command: |
go get -u github.com/golang/dep/cmd/dep
dep ensure -v
- run:
name: Install golangci-lint
command: |
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.20.0
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.23.7
- run:
name: Lint
Expand All @@ -35,6 +45,29 @@ jobs:
name: Run Tests
command: make test

- setup_remote_docker:
version: 17.07.0-ce

- run:
name: build docker container
command: make -e container-build

- store_test_results:
path: /tmp/test-results

deploy:
docker:
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/
- image: circleci/golang:1.14

working_directory: /go/src/github.com/cloudability/metrics-agent

environment:
TEST_RESULTS: /tmp/test-results

steps:
- checkout

- setup_remote_docker:
version: 17.07.0-ce

Expand All @@ -47,8 +80,18 @@ jobs:
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}
make -e dockerhub-push
make -e dockerhub-push
fi
- store_test_results:
path: /tmp/test-results
workflows:
workflow:
jobs:
- snyk_scan:
context: snyk
- build
- deploy:
context: metrics-agent-master-build
filters:
branches:
only:
- master
Loading

0 comments on commit 40d214f

Please sign in to comment.