forked from meteorhacks/meteord
-
Notifications
You must be signed in to change notification settings - Fork 129
/
circle.yml
61 lines (53 loc) · 1.89 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
54
55
56
57
58
59
60
61
machine:
node:
version: 12.20.0
services:
- docker
environment:
NODE_VERSION: 12.20.0
dependencies:
pre:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install -y libstdc++-4.9-dev
override:
- if [ ! -f $HOME/.meteor/meteor ]; then curl https://install.meteor.com | sh; fi
- sudo ln -s $HOME/.meteor/meteor /usr/bin/meteor
cache_directories:
- ../.meteor
test:
override:
- cd tests && bash run_tests.sh
deployment:
docker:
branch: /^node-[0-9.]+$/
commands:
- docker images
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- |
IMAGES="
base
onbuild
devbuild
binbuild
"
NODE_MAJOR="$(echo $NODE_VERSION | cut -d '.' -f1)"
DOCKER_HUB_REPO="abernix/meteord"
BASE_IMAGE_NAME="${DOCKER_HUB_REPO}:node-"
IMAGE_NAME_VERSION="${BASE_IMAGE_NAME}${NODE_VERSION}"
IMAGE_NAME_MAJOR="${BASE_IMAGE_NAME}${NODE_MAJOR}"
# Push the full versions for each image type.
echo "$IMAGES" | xargs -n1 -I% docker push "${IMAGE_NAME_VERSION}-%"
# Tag them as the major version too, for each image type.
echo "$IMAGES" | xargs -n1 -I% docker tag "${IMAGE_NAME_VERSION}-%" "${IMAGE_NAME_MAJOR}-%"
# Push those major version tags.
echo "$IMAGES" | xargs -n1 -I% docker push "${IMAGE_NAME_MAJOR}-%"
# If this is the default track, tag them with the bare tags.
if [ "$NODE_MAJOR" = "4" ]
then
echo "$IMAGES" | xargs -n1 -I% docker tag "${IMAGE_NAME_VERSION}-%" "${DOCKER_HUB_REPO}:%"
echo "$IMAGES" | xargs -n1 -I% docker push "${DOCKER_HUB_REPO}:%"
# Also tag base as 'latest'
docker tag "${DOCKER_HUB_REPO}:base" "${DOCKER_HUB_REPO}:latest"
docker push "${DOCKER_HUB_REPO}:latest"
fi