-
Notifications
You must be signed in to change notification settings - Fork 2
/
circle.yml
40 lines (36 loc) · 1.68 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
machine:
services:
- docker
environment:
IMAGE_NAME: micros-baseimage
dependencies:
cache_directories:
- "~/docker"
override:
- docker info
- docker login -u $ARTIFACTORY_USER -p $ARTIFACTORY_PASSWORD -e developers@vimond.com $DOCKER_PRIVATE_REPO
- if [[ -e ~/docker/image.tgz ]]; then gunzip -c ~/docker/image.tgz | docker load ; fi
- docker build -t $IMAGE_NAME:$CIRCLE_BUILD_NUM .
- mkdir -p ~/docker; docker save $IMAGE_NAME:$CIRCLE_BUILD_NUM | gzip -c > ~/docker/image.tgz;
# - if [[ ! -e ~/docker/image.tgz ]]; then mkdir -p ~/docker; docker save $IMAGE_NAME:$CIRCLE_BUILD_NUM | gzip -c > ~/docker/image.tgz; fi
test:
override:
- docker run $IMAGE_NAME:$CIRCLE_BUILD_NUM ls
# - curl --retry 10 --retry-delay 5 -v http://localhost:80 (or something similar)
deployment:
# hub:
# branch: master
# commands:
# - docker login -e developers@vimond.com -u $DOCKERHUB_USER -p $DOCKERHUB_PASSWORD
# - docker tag -f $IMAGE_NAME:$CIRCLE_BUILD_NUM vimond/$IMAGE_NAME:latest
# - docker tag $IMAGE_NAME:$CIRCLE_BUILD_NUM vimond/$IMAGE_NAME:$CIRCLE_BUILD_NUM
# - docker push vimond/$IMAGE_NAME:$CIRCLE_BUILD_NUM
# - docker push vimond/$IMAGE_NAME:latest
docker:
branch: master
commands:
- docker login -u $ARTIFACTORY_USER -p $ARTIFACTORY_PASSWORD -e developers@vimond.com $DOCKER_PRIVATE_REPO
- docker tag -f $IMAGE_NAME:$CIRCLE_BUILD_NUM $DOCKER_PRIVATE_REPO/$IMAGE_NAME:latest
- docker tag $IMAGE_NAME:$CIRCLE_BUILD_NUM $DOCKER_PRIVATE_REPO/$IMAGE_NAME:$CIRCLE_BUILD_NUM
- docker push $DOCKER_PRIVATE_REPO/$IMAGE_NAME:$CIRCLE_BUILD_NUM
- docker push $DOCKER_PRIVATE_REPO/$IMAGE_NAME:latest