update circleci

This commit is contained in:
CatDeployed 2018-08-03 06:36:10 +02:00
parent b02c468d63
commit 2c0604bf97

View File

@ -6,12 +6,12 @@ jobs:
steps: steps:
- checkout: - checkout:
path: ~/repo path: ~/repo
- run: - run:
name: Build Postal Docker Container name: Build Postal Docker Container
command: docker build -t catdeployed/postal:latest -t catdeployed/postal:alpine . command: docker build -t catdeployed/postal:latest -t catdeployed/postal:alpine .
- run: - run:
name: Export Container name: Export Container
command: mkdir workspace && cd workspace && docker save --output postal_alpine.tar catdeployed/postal:alpine command: mkdir workspace && cd workspace && docker save --output postal_alpine.tar catdeployed/postal:alpine
- persist_to_workspace: - persist_to_workspace:
root: workspace root: workspace
paths: paths:
@ -59,6 +59,39 @@ jobs:
- run: - run:
name: Push Latest Container to Docker Hub name: Push Latest Container to Docker Hub
command: docker push catdeployed/postal:latest command: docker push catdeployed/postal:latest
deploy-dev:
machine: true
working_directory: ~/repo/ubuntu
steps:
- attach_workspace:
at: /tmp/workspace
- run:
name: Load Alpine Image
command: docker load --input /tmp/workspace/postal_alpine.tar
- run:
name: Load Ubuntu Image
command: docker load --input /tmp/workspace/postal_ubuntu.tar
- run:
name: Rename Alpine Image Tag
command: docker tag catdeployed/postal:alpine catdeployed/postal:alpine-dev
- run:
name: Rename Ubuntu Image Tag
command: docker tag catdeployed/ubuntu:ubuntu catdeployed/postal:ubuntu-dev
- run:
name: Tag alpine image as latest
command: docker tag catdeployed/postal:alpine catdeployed/postal:latest-dev
- run:
name: Login to Docker Hub
command: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Push Ubuntu Container to Docker Hub
command: docker push catdeployed/postal:ubuntu-dev
- run:
name: Push Alpine Container to Docker Hub
command: docker push catdeployed/postal:alpine-dev
- run:
name: Push Latest Container to Docker Hub
command: docker push catdeployed/postal:latest-dev
workflows: workflows:
version: 2 version: 2
nightly: nightly:
@ -69,7 +102,6 @@ workflows:
branches: branches:
only: only:
- master - master
- dev
jobs: jobs:
- build-alpine - build-alpine
- build-ubuntu - build-ubuntu
@ -79,9 +111,8 @@ workflows:
- build-ubuntu - build-ubuntu
filters: filters:
branches: branches:
only: only:
- master - master
- dev
commit: commit:
jobs: jobs:
- build-alpine - build-alpine
@ -94,7 +125,11 @@ workflows:
branches: branches:
only: only:
- master - master
- deploy-dev:
requires:
- build-alpine
- build-ubuntu
filters:
branches:
only:
- dev - dev
notify:
webhooks:
- url: https://hooks.microbadger.com/images/catdeployed/postal/K0vCLtQnFFKukT-LuAEBmGD0cHs=