-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy path.travis.yml
119 lines (108 loc) · 3 KB
/
.travis.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
os: linux
dist: bionic
language: shell
services:
- docker
env:
matrix:
- VARIANT=php7.4/apache
BRANCH=stable
- VARIANT=php7.4/fpm
BRANCH=stable
- VARIANT=php7.3/apache
BRANCH=stable
- VARIANT=php7.3/fpm
BRANCH=stable
- VARIANT=php7.2/apache
BRANCH=stable
- VARIANT=php7.2/fpm
BRANCH=stable
- VARIANT=php7.1/apache
BRANCH=stable
- VARIANT=php7.1/fpm
BRANCH=stable
- VARIANT=php7.4/apache
BRANCH=edge
- VARIANT=php7.4/fpm
BRANCH=edge
- VARIANT=php7.3/apache
BRANCH=edge
- VARIANT=php7.3/fpm
BRANCH=edge
- VARIANT=php7.2/apache
BRANCH=edge
- VARIANT=php7.2/fpm
BRANCH=edge
- VARIANT=php7.1/apache
BRANCH=edge
- VARIANT=php7.1/fpm
BRANCH=edge
- VARIANT=php7.4/apache
BRANCH=develop
- VARIANT=php7.4/fpm
BRANCH=develop
- VARIANT=php7.3/apache
BRANCH=develop
- VARIANT=php7.3/fpm
BRANCH=develop
- VARIANT=php7.2/apache
BRANCH=develop
- VARIANT=php7.2/fpm
BRANCH=develop
- VARIANT=php7.1/apache
BRANCH=develop
- VARIANT=php7.1/fpm
BRANCH=develop
install:
- git clone https://github.com/docker-library/official-images.git ~/official-images
before_script:
- docker -v
- source version
- IMAGE='aspendigital/octobercms';
SLASH='/';
if [ "$BRANCH" == "stable" ]; then
DOCKERFILE="Dockerfile";
BUILD="build.$OCTOBERCMS_BUILD";
TAG="${VARIANT//$SLASH/-}";
TAG_LONG="$BUILD-$TAG";
elif [ "$BRANCH" == "edge" ]; then
DOCKERFILE="Dockerfile.edge";
BUILD="edge-build.$OCTOBERCMS_EDGE_BUILD";
TAG="edge-${VARIANT//$SLASH/-}";
TAG_LONG="$BUILD-${VARIANT//$SLASH/-}";
elif [ "$BRANCH" == "develop" ]; then
DOCKERFILE="Dockerfile.develop";
TAG="develop-${VARIANT//$SLASH/-}";
fi;
echo "$TAG | $DOCKERFILE";
- cd "$VARIANT"
script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- docker build -t "$IMAGE:$TAG" -f $DOCKERFILE .
- ~/official-images/test/run.sh "$IMAGE:$TAG"
- docker run --rm "$IMAGE:$TAG" php --version
- docker run --rm "$IMAGE:$TAG" composer --version
- docker run --rm "$IMAGE:$TAG" composer info | grep october
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker push "$IMAGE:$TAG";
if [ ! -z "$TAG_LONG" ]; then
docker build -t "$IMAGE:$TAG_LONG" -f $DOCKERFILE .;
docker push "$IMAGE:$TAG_LONG";
fi
if [ "$VARIANT" == "php7.2/apache" ]; then
if [ ! -z "$BUILD" ]; then
docker build -t "$IMAGE:$BUILD" -f $DOCKERFILE .;
docker push "$IMAGE:$BUILD";
fi
if [ "$BRANCH" == "stable" ]; then
docker build -t "$IMAGE:latest" -f $DOCKERFILE .;
docker push "$IMAGE:latest";
else
docker build -t "$IMAGE:$BRANCH" -f $DOCKERFILE .;
docker push "$IMAGE:$BRANCH";
fi
fi
fi
- docker images;
- docker run --rm "$IMAGE:$TAG" vendor/bin/phpunit