github.com/weaveworks/common@v0.0.0-20230728070032-dd9e68f319d5/tools/.circleci/config.yml (about)

     1  version: 2
     2  jobs:
     3    build:
     4      # Use 'machine' type so we can run the lint step with directory mounted
     5      machine:
     6        docker_layer_caching: true
     7      working_directory: /home/circleci/src/github.com/weaveworks/build-tools
     8      environment:
     9        GOPATH: /home/circleci/
    10      steps:
    11      - checkout
    12      - run: cd build; make
    13      - run: docker run --rm -v "$PWD:$PWD" -w "$PWD" --entrypoint sh weaveworks/build-golang -c ./lint .
    14      - run: cd cover; make
    15      # Socks makefile needs to overwrite Go std library
    16      - run: sudo chmod a+wr --recursive /usr/local/go/pkg
    17      - run: cd socks; make
    18      - run: cd runner; make
    19  
    20      - deploy:
    21          command: |
    22            if [ "${CIRCLE_BRANCH}" == "master" ]; then
    23              cd build
    24              docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD
    25              for image in $(make images); do
    26                # Push all tags - latest and git-tag
    27                docker push "${image}"
    28  
    29                # Tag the built images with something derived from the base images in
    30                # their respective Dockerfiles. So "FROM golang:1.8.0-stretch" as a
    31                # base image would lead to a tag of "1.8.0-stretch"
    32                IMG_TAG=$(make "imagetag-${image#weaveworks/build-}")
    33                docker tag "${image}:latest" "${image}:${IMG_TAG}"
    34                docker push "${image}:${IMG_TAG}"
    35              done
    36            fi