V2 build running as v1

Hi,

I’ve given a lot of posts a read about this - but as yet haven’t found a solution.

I’ve got a file at .circleci/config.yml which seems to be the correct location and it validates using the circleci cli tool.

It looks like the below… but it won’t build as v2 - only as v1.
I can’t work out what is going wrong - anyone got any ideas?

As I said I’ve checked everything I’ve read in the other posts about this stuff.

version: 2
jobs:
  build:
    working_directory: /go/src/github.com/repo...
    docker:
      - image: circleci/golang:1.9

    # Start test and build process.
    steps:
      - checkout

      - run: ls -lart
      - run: make test

      # Ensure we can use Docker.
      - setup_remote_docker


      # Save the Docker image.
      #
      # Only pushes to the unstable branch for now.
      - deploy:
          name: Save Docker image to AWS.
          command: |
            sudo apt-get install python-pip
            pip install awscli --upgrade --user
            ls -lart ~
            export PATH=~/.local/bin:$PATH

            if [ "${CIRCLE_BRANCH}" == "develop" ] || [ "${CIRCLE_BRANCH}" == "master" ]; then              
              
              # run the build script - build and push to AWS
              ./scripts/build.sh ${CIRCLE_BRANCH}

            else 
              echo "no valid deployment branch"
            fi

This seems to have switch now. very odd.

Anyway, all good.

The main reasons for this is getting the folder name wrong (e.g. .circle) or the file (e.g. config.yaml). Not sure what happened in this case, pleased you got it working!

Hi,

Yeah it seems all of our repos have switch to 2.0 suddenly, having been running v2.0 configs for the last 6 months but reporting v1.0 builds.

:slight_smile: anyway, it’s working now so that’s all that matters.

Cheers,

1 Like

Out of interest, did the jobs being flagged as 1.0 still run correctly? I’ve not used 1.0 but the two systems are rather different, and I believe the 2.0 YAML config cannot be run under the 1.0, even if it is reported as such.

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