I’m trying to setup a ci to build docker images when a release is cut. But the workflows aren’t triggering.
here is my config.yaml
version: 2.1
jobs:
setup-go:
docker:
- image: cimg/go:1.17.7
environment:
GO111MODULE: "on"
GOFLAGS: -mod=vendor
steps:
- checkout
- run:
name: get deps
command: go mod vendor
- persist_to_workspace:
root: .
paths:
- .
lint-go:
docker:
- image: cimg/go:1.17.7
environment:
GOFLAGS: -mod=vendor
LINT_VER: v1.44.0
steps:
- attach_workspace:
at: .
- run:
name: install golangci-lint
command: curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/${LINT_VER}/install.sh" | sh -s -- -b "$(go env GOPATH)/bin" "${LINT_VER}"
- run:
name: lint
command: golangci-lint --timeout 5m run
test-go:
docker:
- image: cimg/go:1.17.7
environment:
MAX_UNIT_TEST_CONCURRENCY: 128
GOFLAGS: -mod=vendor
steps:
- attach_workspace:
at: .
- run:
name: create directory
command:
mkdir test
- run:
name: run test race
command: go test -v -race ./...
- run:
name: run test
command: go test -covermode=count -coverprofile=test/coverage.txt ./...
- persist_to_workspace:
root: .
paths:
- test
upload-coverage-go:
docker:
- image: cimg/go:1.17.7
environment:
MAX_UNIT_TEST_CONCURRENCY: 128
GOFLAGS: -mod=vendor
steps:
- attach_workspace:
at: .
- run:
name: upload
command: bash <(curl -s https://codecov.io/bash)
build-go:
docker:
- image: cimg/go:1.17.7
environment:
CGO_ENABLED: 0
GOFLAGS: -mod=vendor
steps:
- attach_workspace:
at: .
- run:
name: build
command: go build -o=./build/go/goober ./app
- persist_to_workspace:
root: .
paths:
- .
deploy-go:
docker:
- image: cimg/go:1.17.7
steps:
- attach_workspace:
at: .
- setup_remote_docker
- run:
name: login
command: echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
- run:
name: build image
command: docker build -f Dockerfile_App -t kevinaanthony/goober-app:latest -t kevinaanthony/goober-app:$CIRCLE_BUILD_NUM .
- run:
name: push image
command: docker push kevinaanthony/goober-app --all-tags
setup-node:
docker:
- image: cimg/node:17.9
steps:
- checkout
- run:
name: install node_modules
command: |
npm install
- persist_to_workspace:
root: .
paths:
- .
- node_modules
build-node:
docker:
- image: cimg/node:17.9
steps:
- attach_workspace:
at: .
- run:
name: build
command: npm run build
- persist_to_workspace:
root: .
paths:
- .
deploy-node:
docker:
- image: cimg/node:17.9
steps:
- attach_workspace:
at: .
- setup_remote_docker
- run:
name: login
command: echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
- run:
name: build image
command: docker build -f Dockerfile_Web -t kevinaanthony/goober-web:latest -t kevinaanthony/goober-web:$CIRCLE_BUILD_NUM .
- run:
name: push image
command: docker push kevinaanthony/goober-web --all-tags
workflows:
go:
jobs:
- setup-go
- lint-go:
requires:
- setup-go
- test-go:
requires:
- setup-go
- upload-coverage-go:
requires:
- test-go
- build-go:
requires:
- lint-go
- test-go
- deploy-go:
requires:
- build-go
filters:
tags:
only: /^release.*/
node:
jobs:
- setup-node
- build-node:
requires:
- setup-node
- deploy-node:
requires:
- build-node
filters:
tags:
only: /^release.*/
branches:
ignore: /.*/
I’ve tried a lot of iterations and it’s still not building. Can someone help me figure out what is wrong?