Skip to content

Commit

Permalink
update circleci config to use docker go image
Browse files Browse the repository at this point in the history
Was using an old ubuntu based machine image, installing Go manually.
This brings it closer in line with the other projects setup, using the
Go docker image.

It also uses the new cimg/go docker image.
  • Loading branch information
eikenb committed Jan 4, 2022
1 parent 2abd8b1 commit 465f3d3
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,22 @@ version: 2.1
jobs:
build:
environment:
GO_VERSION: 1.16
GO111MODULE: "on"
CONSUL_VERSION: 1.10.2
machine:
image: ubuntu-1604:201903-01
working_directory: ~/consul-esm
CONSUL_VERSION: 1.10.6
docker:
- image: docker.mirror.hashicorp.services/cimg/go:1.17
steps:
- checkout
- restore_cache:
keys:
- ct-modcache-v2-{{ checksum "go.mod" }}
- run: |
gopkg="go${GO_VERSION}.linux-amd64.tar.gz"
curl -sLo $HOME/go.tar.gz https://dl.google.com/go/$gopkg
tar -C $HOME/ -xzf ~/go.tar.gz
- ct-modcache-v1-{{ checksum "go.mod" }}
- run: |
curl -sLo consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip
unzip consul.zip
sudo cp consul /usr/local/bin/
- run: |
export GO111MODULE=on
export PATH="$HOME/go/bin:$PATH"
export GOPATH="$HOME/go"
make test
- save_cache:
key: ct-modcache-v2-{{ checksum "go.mod" }}
key: ct-modcache-v1-{{ checksum "go.mod" }}
paths:
- /home/circleci/go/pkg/mod

- /go/pkg/mod

0 comments on commit 465f3d3

Please sign in to comment.