docker-backuppc/.circleci/config.yml
2018-09-16 12:29:15 +02:00

51 lines
1.2 KiB
YAML

# Configure CircleCI
version: 2
jobs:
build:
machine: true
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
command:
docker build -t adferrand/backuppc:${CIRCLE_TAG} .
- run:
command: |
mkdir -p workspace
docker save adferrand/backuppc:${CIRCLE_TAG} > workspace/docker-backuppc.tar
- persist_to_workspace:
root: workspace
paths:
- docker-backuppc.tar
deploy:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- setup_remote_docker:
docker_layer_caching: true
- 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:
tags:
only: ^[0-9.]+
- deploy:
requires:
- build
filters:
tags:
only: ^[0-9.]+