[Bug 1473089] Migrate telemetry-analysis-service to circle2.0 (#1216)

This commit is contained in:
haroldwoo 2018-07-16 08:26:46 -07:00 коммит произвёл GitHub
Родитель 10bdef5051
Коммит d62d747273
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 63 добавлений и 45 удалений

61
.circleci/config.yml Normal file
Просмотреть файл

@ -0,0 +1,61 @@
# These environment variables must be set in CircleCI UI
#
# DOCKERHUB_REPO - docker hub repo, format: <username>/<repo>
# DOCKER_USER
# DOCKER_PASS
#
version: 2
jobs:
build:
machine:
enable: true
working_directory: ~/mozilla/telemetry-analysis-service
steps:
- checkout
- run: ./bin/build
test:
machine:
enable: true
working_directory: ~/mozilla/telemetry-analysis-service
steps:
- checkout
- run: sudo apt-get update
- run: sudo apt-get install python-dev
- run: sudo pip install --upgrade pip
- run: pip install docker-compose
- run: docker info
- run: docker --version
- run: ./bin/test
deploy:
machine:
enable: true
working_directory: ~/mozilla/telemetry-analysis-service
steps:
- checkout
- run: ./bin/build && ./bin/deploy
workflows:
version: 2
build-test-deploy:
jobs:
- build:
filters:
tags:
only: /.*/
- test:
filters:
tags:
only: /.*/
- deploy:
requires:
- test
filters:
tags:
only: /.*/
branches:
only: master

Просмотреть файл

@ -22,7 +22,7 @@ function retry() {
}
echo "Logging into Docker hub"
retry 3 docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USER" -p="$DOCKER_PASS"
retry 3 docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
echo "Tagging app:build with $CIRCLE_TAG"
docker tag app:build "$DOCKERHUB_REPO:$CIRCLE_TAG" ||
@ -32,4 +32,4 @@ echo "Pushing tag $CIRCLE_TAG to $DOCKERHUB_REPO"
retry 3 docker push "$DOCKERHUB_REPO:$CIRCLE_TAG" ||
(echo "Couldn't push $DOCKERHUB_REPO:$CIRCLE_TAG" && false)
echo "Pushed $DOCKERHUB_REPO:$TAG"
echo "Pushed $DOCKERHUB_REPO:$TAG"

Просмотреть файл

@ -1,43 +0,0 @@
# These environment variables must be set in CircleCI UI
#
# DOCKERHUB_REPO - docker hub repo, format: <username>/<repo>
# DOCKER_EMAIL - login info for docker hub
# DOCKER_USER
# DOCKER_PASS
#
machine:
pre:
# Install CircleCI's fork for Docker 1.10.0
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
- chmod -R 777 $CIRCLE_TEST_REPORTS $CIRCLE_ARTIFACTS
services:
- docker
dependencies:
pre:
- docker info
- sudo apt-get update
- sudo apt-get install python-dev
# run tests using an upgraded version of docker-compose
- pip install --upgrade docker-compose
override:
# build Docker image first to make sure it'll build correctly
- ./bin/build
test:
override:
# run the tests using our test script
- ./bin/test
deployment:
latest:
branch: master
commands:
# appropriately tag and push the container to dockerhub
- ./bin/deploy
tags:
# push all tags
tag: /.*/
commands:
- ./bin/deploy