forked from gct-faisal/bitnami-docker-memcached
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
53 lines (50 loc) · 2.01 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
41
42
43
44
45
46
47
48
49
50
51
52
53
machine:
services:
- docker
environment:
IMAGE_NAME: memcached
DOCKER_PROJECT: bitnami
GCLOUD_PROJECT: bitnami-containers
dependencies:
override:
- docker info
- gcloud version
- docker pull $DOCKER_PROJECT/$IMAGE_NAME:_ || true
test:
override:
- docker build --rm=false -t $DOCKER_PROJECT/$IMAGE_NAME:$CIRCLE_BUILD_NUM .
deployment:
cache:
branch: master
commands:
- >
if [ -n "$DOCKER_PASS" ]; then
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
docker build --rm=false -t $DOCKER_PROJECT/$IMAGE_NAME:_ .
docker push $DOCKER_PROJECT/$IMAGE_NAME:_
fi
release:
tag: /^[0-9].*-r[0-9]+$/
commands:
- >
if [ -n "$DOCKER_PASS" ]; then
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
docker build --rm=false -t $DOCKER_PROJECT/$IMAGE_NAME:$CIRCLE_TAG .
docker tag $DOCKER_PROJECT/$IMAGE_NAME:$CIRCLE_TAG $DOCKER_PROJECT/$IMAGE_NAME:latest
docker push $DOCKER_PROJECT/$IMAGE_NAME:$CIRCLE_TAG
docker push $DOCKER_PROJECT/$IMAGE_NAME:latest
fi
- >
if [ -n "$GCLOUD_SERVICE_KEY" ]; then
echo $GCLOUD_SERVICE_KEY | base64 --decode > ${HOME}/gcloud-service-key.json
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
echo 'ENV BITNAMI_CONTAINER_ORIGIN=GCR' >> Dockerfile
docker build --rm=false -t gcr.io/$GCLOUD_PROJECT/$IMAGE_NAME:$CIRCLE_TAG .
docker tag gcr.io/$GCLOUD_PROJECT/$IMAGE_NAME:$CIRCLE_TAG gcr.io/$GCLOUD_PROJECT/$IMAGE_NAME:latest
gcloud docker -- push gcr.io/$GCLOUD_PROJECT/$IMAGE_NAME:$CIRCLE_TAG
gcloud docker -- push gcr.io/$GCLOUD_PROJECT/$IMAGE_NAME:latest
fi
- >
if [ -n "$STACKSMITH_API_KEY" ]; then
curl "https://stacksmith.bitnami.com/api/v1/components/$IMAGE_NAME/versions?api_key=$STACKSMITH_API_KEY" -H 'Content-Type: application/json' --data '{"version": "'"${CIRCLE_TAG%-r*}"'", "revision": "'"${CIRCLE_TAG#*-r}"'", "published": true}'
fi