diff --git a/.circleci/config.yml b/.circleci/config.yml index 14946e7..531980d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,53 +1,54 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # These environment variables must be set in CircleCI UI # # DOCKERHUB_REPO - docker hub repo, format: / # DOCKER_EMAIL - login info for docker hub # DOCKER_USER # DOCKER_PASS version: 2 jobs: build: docker: - image: docker:18.06 steps: - setup_remote_docker - checkout - run: name: Install pip command: | apk add --no-cache bash python3 && \ python3 -m ensurepip && \ rm -r /usr/lib/python*/ensurepip && \ pip3 install --upgrade pip && \ if [[ ! -e /usr/bin/pip ]]; then ln -s pip3 /usr/bin/pip; fi && \ if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \ rm -r /root/.cache - run: name: Install Dependencies command: pip install -r requirements.txt && pip install docker-compose - run: name: Create phabext.json command: | invoke version > phabext.json && \ mkdir /artifacts && \ cp phabext.json /artifacts/phabext.json - run: invoke build - run: invoke build_test - run: invoke test - run: docker inspect $(invoke imageid) - run: invoke imageid | tee /artifacts/docker-image-shasum256.txt - deploy: + name: Deploy to docker hub command: | [[ -n "$DOCKERHUB_REPO" && -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]] || exit 0 docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" docker tag "${DOCKERHUB_REPO}" "${DOCKERHUB_REPO}:${CIRCLE_SHA1}" docker push "${DOCKERHUB_REPO}:${CIRCLE_SHA1}" if [[ "$CIRCLE_BRANCH" == "master" ]]; then docker push "${DOCKERHUB_REPO}:latest" fi - store_artifacts: path: /artifacts