2018-09-16 11:40:58 +02:00
|
|
|
# Configure CircleCI
|
2018-09-16 11:39:13 +02:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
2018-09-16 12:29:15 +02:00
|
|
|
machine: true
|
2018-09-16 11:39:13 +02:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command:
|
|
|
|
docker build -t adferrand/backuppc:${CIRCLE_TAG} .
|
|
|
|
- run:
|
2018-09-16 12:03:05 +02:00
|
|
|
command: |
|
|
|
|
mkdir -p workspace
|
|
|
|
docker save adferrand/backuppc:${CIRCLE_TAG} > workspace/docker-backuppc.tar
|
2018-09-16 11:39:13 +02:00
|
|
|
- persist_to_workspace:
|
2018-09-16 12:03:05 +02:00
|
|
|
root: workspace
|
2018-09-16 11:39:13 +02:00
|
|
|
paths:
|
|
|
|
- docker-backuppc.tar
|
|
|
|
deploy:
|
2018-09-16 12:29:15 +02:00
|
|
|
machine: true
|
2018-09-16 11:39:13 +02:00
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /tmp/workspace
|
|
|
|
- run:
|
|
|
|
command:
|
|
|
|
docker load < /tmp/workspace/docker-backuppc.tar
|
|
|
|
- run:
|
|
|
|
command:
|
|
|
|
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
|
|
|
|
- deploy:
|
|
|
|
command:
|
|
|
|
docker push adferrand/backuppc:${CIRCLE_TAG}
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build-n-deploy:
|
|
|
|
jobs:
|
|
|
|
- build:
|
|
|
|
filters:
|
2018-09-16 11:49:57 +02:00
|
|
|
tags:
|
|
|
|
only: ^[0-9.]+
|
2018-09-16 11:39:13 +02:00
|
|
|
- deploy:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
filters:
|
2018-09-16 11:49:57 +02:00
|
|
|
tags:
|
|
|
|
only: ^[0-9.]+
|