diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index c2c8719..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,178 +0,0 @@ ---- -version: 2.1 - -executors: - golang: - description: > - Golang container executor - parameters: - version: - description: Go version - type: string - resource_class: - description: Resource class - type: string - - resource_class: << parameters.resource_class >> - docker: - - image: circleci/golang:<< parameters.version >> - -commands: - setup_environment: - description: > - Setup the minimal environment for the CI. - steps: - - checkout - - run: make promu - - setup_build_environment: - description: > - Setup the environment for building the container images. - steps: - - setup_environment - - setup_remote_docker: - version: 18.06.0-ce - - run: docker run --privileged linuxkit/binfmt:v0.6 - - attach_workspace: - at: . - - publish_images: - description: > - Build and publish images to a container image registry. - parameters: - registry: - description: Registry address - type: string - organization: - description: Registry organization - type: string - login_variable: - description: Environment variable holding the registry login - type: env_var_name - password_variable: - description: Environment variable holding the registry password - type: env_var_name - - steps: - - run: make docker DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - - run: docker images - - run: docker login -u $<< parameters.login_variable >> -p $<< parameters.password_variable >> << parameters.registry >> - - run: make docker-publish DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - - run: make docker-manifest DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - - store_artifact: - description: > - Store a file as a build artifact. - parameters: - file: - description: source file - type: string - directory: - description: destination directory - type: string - default: /build - - steps: - - store_artifacts: - path: << parameters.file >> - destination: << parameters.directory >>/<< parameters.file >> - - run: rm -v << parameters.file >> - - publish_release_images: - description: > - Build and publish release images to a container image registry. - parameters: - registry: - description: Registry address - type: string - organization: - description: Registry organization - type: string - login_variable: - description: Environment variable holding the registry login - type: env_var_name - password_variable: - description: Environment variable holding the registry password - type: env_var_name - - steps: - - run: make docker DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - - run: docker images - - run: docker login -u $<< parameters.login_variable >> -p $<< parameters.password_variable >> << parameters.registry >> - - run: make docker-publish DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - - run: make docker-manifest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - - run: | - if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then - make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - make docker-publish DOCKER_IMAGE_TAG="latest" DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - make docker-manifest DOCKER_IMAGE_TAG="latest" DOCKER_REPO=<< parameters.registry >>/<< parameters.organization >> - fi - -jobs: - build: - machine: - enabled: true - - steps: - - setup_environment - - run: promu crossbuild -v - - persist_to_workspace: - root: . - paths: - - .build - - store_artifacts: - path: .build - destination: /build - - publish_master: - docker: - - image: circleci/golang - - steps: - - setup_build_environment - - publish_images: - registry: docker.io - organization: damoun - login_variable: DOCKER_LOGIN - password_variable: DOCKER_PASSWORD - - publish_release: - docker: - - image: circleci/golang - - steps: - - setup_build_environment - - run: promu crossbuild tarballs - - run: promu checksum .tarballs - - run: promu release .tarballs - - store_artifacts: - path: .tarballs - destination: releases - - publish_release_images: - registry: docker.io - organization: damoun - login_variable: DOCKER_LOGIN - password_variable: DOCKER_PASSWORD - -workflows: - version: 2 - prometheus: - jobs: - - build: - filters: - tags: - only: /.*/ - - publish_master: - requires: - - build - filters: - branches: - only: master - - publish_release: - requires: - - build - filters: - tags: - only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/ - branches: - ignore: /.*/