Tag filter not triggering build

circle.yml

#1

I am migrating from CircleCI 1.0 to 2.0, but my tag filter does not appear to be triggering any builds. What am I missing?

version: 2
        
jobs:
    build:
        working_directory: /go/src/github.com/turnercode/ams-guardian-api
        docker:
            - image: circleci/golang:1.8

        steps:
            - checkout
            - setup_remote_docker

            - run: 
                name: Login to Docker Registry
                command: docker login -u="${DOCKER_USER}" -p="${DOCKER_PASS}" quay.io

            - run:
                name: Build App
                command: |
                    # docker-compose throws error even though .env is not used during build.
                    # The .env file referenced by docker-compose for local builds
                    touch environments/dev/.env 
                    if [ -z $CIRCLE_TAG ] 
                    then
                        VERSION_NUM=v0.1.0-build.$CIRCLE_BUILD_NUM docker-compose -f environments/dev/docker-compose.yml build
                    else
                        VERSION_NUM=$CIRCLE_TAG.$CIRCLE_BUILD_NUM docker-compose -f environments/dev/docker-compose.yml build
                    fi
                    
            - run: 
                name: Test App
                command: |
                    go get -u -v github.com/Masterminds/glide
                    glide install
                    go test -v $(glide novendor)

workflows:
    version: 2
    build-n-deploy:
    jobs:
        - build:
            filters:
                tags:
                    only: /.*/
                    


#2

I found the solution under this topic.

After updating the indention spacing, It is working now.


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.