-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
config.yml
87 lines (87 loc) · 2.77 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
defaults: &defaults
docker:
- image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:go1.13
environment:
TERRATEST_LOG_PARSER_VERSION: NONE
TERRAFORM_VERSION: NONE
TERRAGRUNT_VERSION: NONE
PACKER_VERSION: NONE
GRUNTWORK_INSTALLER_VERSION: v0.0.35
MODULE_CI_VERSION: v0.33.1
GOLANG_VERSION: 1.16
GO111MODULE: auto
CGO_ENABLED: 1
install_gruntwork_utils: &install_gruntwork_utils
name: Install gruntwork utils
command: |
curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version "${GRUNTWORK_INSTALLER_VERSION}"
gruntwork-install --module-name "gruntwork-module-circleci-helpers" --repo "https://github.com/gruntwork-io/terraform-aws-ci" --tag "${MODULE_CI_VERSION}"
configure-environment-for-gruntwork-module \
--terraform-version ${TERRAFORM_VERSION} \
--terragrunt-version ${TERRAGRUNT_VERSION} \
--packer-version ${PACKER_VERSION} \
--go-version ${GOLANG_VERSION}
version: 2
jobs:
pre-commit:
<<: *defaults
steps:
- checkout
- run:
command: |
pip install pre-commit
go get golang.org/x/tools/cmd/goimports
export GOPATH=~/go/bin && export PATH=$PATH:$GOPATH
pre-commit install
pre-commit run --all-files
test:
<<: *defaults
steps:
- checkout
- run:
command: |
# The go tests create a disposable local repo at runtime to execute git commands against, so we need to set any arbitrary options here to avoid an error message
git config --global user.email "grunty@gruntwork.io"
git config --global user.name "Grunty"
- run:
name: run git-xargs tests
command: run-go-tests --timeout 45m
no_output_timeout: 45m
when: always
build-and-deploy:
<<: *defaults
steps:
- checkout
- run:
<<: *install_gruntwork_utils
- run: build-go-binaries --app-name git-xargs --src-path ./ --dest-path bin --ld-flags "-X main.VERSION=$CIRCLE_TAG"
- run: cd bin && sha256sum * > SHA256SUMS
- run: upload-github-release-assets bin/*
workflows:
version: 2
build-and-test:
jobs:
- pre-commit:
filters:
tags:
only: /^v.*/
context:
- Gruntwork Admin
- test:
requires:
- pre-commit
filters:
tags:
only: /^v.*/
context:
- Gruntwork Admin
- build-and-deploy:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
context:
- Gruntwork Admin