Skip to content

Commit 77986d3

Browse files
authored
fix release and extract e2e tests (#317)
1 parent d157086 commit 77986d3

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

.circleci/config.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ references:
1313
sha256sum vault_1.21.4_linux_amd64.zip | grep 889b681990fe221b884b7932fa9c9dd0ee9811b9349554f1aa287ab63c9f3dae
1414
unzip vault_1.21.4_linux_amd64.zip
1515
mv vault /usr/bin/vault
16-
install_vault_machine: &install_vault_machine
17-
run:
18-
name: install hashicorp vault
19-
command: |
20-
sudo apt-get update -y && sudo apt-get install -y curl unzip
21-
cd /tmp
22-
curl -LO https://releases.hashicorp.com/vault/1.21.4/vault_1.21.4_linux_amd64.zip
23-
echo '889b681990fe221b884b7932fa9c9dd0ee9811b9349554f1aa287ab63c9f3dae vault_1.21.4_linux_amd64.zip' | sha256sum -c
24-
unzip -o vault_1.21.4_linux_amd64.zip
25-
sudo mv vault /usr/bin/vault
2616
setup_qemu_binfmt: &setup_qemu_binfmt
2717
run:
2818
name: Setup QEMU for multi-arch Docker builds
@@ -79,45 +69,46 @@ jobs:
7969
- run: mkdir snapshot-artifacts && cp dist/*.tar.gz dist/*.txt dist/*.json snapshot-artifacts
8070
- store_artifacts:
8171
path: snapshot-artifacts
82-
release:
83-
machine:
84-
image: ubuntu-2204:current
72+
e2e:
73+
working_directory: /home/circleci/go/src/github.com/fairwindsops/insights-cli
8574
resource_class: large
86-
shell: /bin/bash
75+
docker:
76+
- image: goreleaser/goreleaser:v2.15.4
8777
steps:
8878
- checkout
8979
- run: ./.circleci/scripts/e2e-env.sh
90-
- *install_vault_machine
80+
- *install_vault
9181
- rok8s/get_vault_env:
9282
vault_path: repo/global/env
9383
- rok8s/get_vault_env:
9484
vault_path: repo/insights-cli/env
95-
- run: |
96-
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin v2.11.2
97-
golangci-lint run -v --timeout 2m0s
98-
go test -tags e2e ./pkg/...
99-
- rok8s/docker_login:
100-
registry: "quay.io"
101-
username: $FAIRWINDS_QUAY_USER
102-
password-variable: FAIRWINDS_QUAY_TOKEN
103-
- *setup_qemu_binfmt
10485
- run:
105-
name: Run GoReleaser release
86+
name: lint and e2e tests
10687
command: |
107-
export GORELEASER_CURRENT_TAG="${CIRCLE_TAG}"
108-
docker run --rm \
109-
-v /var/run/docker.sock:/var/run/docker.sock \
110-
-v "$(pwd):/workspace" -w /workspace \
111-
-v "${HOME}/.docker:/root/.docker" \
112-
-e GORELEASER_CURRENT_TAG -e CIRCLE_TAG -e CIRCLE_SHA1 \
113-
-e GO111MODULE=on \
114-
-e GITHUB_TOKEN \
115-
goreleaser/goreleaser:v2.15.4 release
88+
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin v2.11.2
89+
golangci-lint run -v --timeout 2m0s
90+
go test -tags e2e ./pkg/...
91+
go vet ./...
92+
release:
93+
working_directory: /home/circleci/go/src/github.com/fairwindsops/insights-cli
94+
resource_class: large
95+
shell: /bin/bash
96+
docker:
97+
- image: goreleaser/goreleaser:v2.15.4
98+
environment:
99+
GO111MODULE: "on"
100+
steps:
101+
- checkout
102+
- setup_remote_docker
103+
- *install_vault
104+
- rok8s/get_vault_env:
105+
vault_path: repo/global/env
106+
- rok8s/get_vault_env:
107+
vault_path: repo/insights-cli/env
116108
- run:
117-
name: docker login Google Artifact Registry
109+
name: docker login
118110
command: |
119111
docker login -u _json_key -p "$(echo $GCP_ARTIFACTREADWRITE_JSON_KEY | base64 -d)" us-docker.pkg.dev
120-
- run: echo 'export GORELEASER_CURRENT_TAG="${CIRCLE_TAG}"' >> $BASH_ENV
121112
- run: goreleaser
122113

123114
workflows:
@@ -135,8 +126,17 @@ workflows:
135126
ignore: /.*/
136127
release:
137128
jobs:
129+
- e2e:
130+
context: org-global
131+
filters:
132+
branches:
133+
ignore: /.*/
134+
tags:
135+
only: /.*/
138136
- release:
139137
context: org-global
138+
requires:
139+
- e2e
140140
filters:
141141
branches:
142142
ignore: /.*/

0 commit comments

Comments
 (0)