File tree Expand file tree Collapse file tree 12 files changed +63
-176
lines changed Expand file tree Collapse file tree 12 files changed +63
-176
lines changed Original file line number Diff line number Diff line change 5
5
set -o pipefail
6
6
7
7
8
- # ##
9
- # ## Variables
10
- # ##
11
- CWD=" $( dirname " ${0} " ) "
12
-
13
-
14
8
# ##
15
9
# ## Run
16
10
# ##
@@ -45,9 +39,3 @@ function get_random_name() {
45
39
done
46
40
echo " ${name} "
47
41
}
48
-
49
-
50
- DOCKER_IMAGE=" $( grep ' image=".*"' " ${CWD} /../Dockerfile" | sed ' s/^[[:space:]]*//g' | awk -F' "' ' {print $2}' ) "
51
- DOCKER_VENDOR=" $( grep ' vendor=".*"' " ${CWD} /../Dockerfile" | sed ' s/^[[:space:]]*//g' | awk -F' "' ' {print $2}' ) "
52
- # shellcheck disable=SC2034
53
- DOCKER_NAME=" ${DOCKER_VENDOR} /${DOCKER_IMAGE} "
Original file line number Diff line number Diff line change 5
5
set -o pipefail
6
6
7
7
CWD=" $( cd -P -- " $( dirname -- " $0 " ) " && pwd -P) "
8
+ DOCKER_NAME=" ${1} "
8
9
9
10
10
11
# ##
@@ -23,12 +24,6 @@ RAND_NAME="$( get_random_name )"
23
24
run " echo \" hello world\" > ${RAND_DIR} /index.html"
24
25
25
26
26
- # ##
27
- # ## Build container
28
- # ##
29
- run " docker build -t ${DOCKER_NAME} ${CWD} /.."
30
-
31
-
32
27
# ##
33
28
# ## Startup container
34
29
# ##
@@ -48,8 +43,8 @@ run "docker run -d --rm \
48
43
run " sleep 5"
49
44
run " docker ps"
50
45
run " docker logs ${RAND_NAME} "
51
- run " curl localhost"
52
- run " curl localhost | grep 'hello world'"
46
+ run " curl -sS localhost/index.html "
47
+ run " curl -sS localhost/index.html | grep 'hello world'"
53
48
54
49
55
50
# ##
Original file line number Diff line number Diff line change 5
5
set -o pipefail
6
6
7
7
CWD=" $( cd -P -- " $( dirname -- " $0 " ) " && pwd -P) "
8
+ DOCKER_NAME=" ${1} "
8
9
9
10
10
11
# ##
Original file line number Diff line number Diff line change @@ -12,27 +12,11 @@ IFS=$'\n'
12
12
13
13
# Current directory
14
14
CWD=" $( dirname " ${0} " ) "
15
+ IMAGE=" ${1} "
15
16
16
17
declare -a TESTS=()
17
18
18
19
19
- # ##
20
- # ## Sanity checks
21
- # ##
22
-
23
- # Check Dockerfile
24
- if [ ! -f " ${CWD} /../Dockerfile" ]; then
25
- echo " Dockerfile not found in: ${CWD} /../Dockerfile."
26
- exit 1
27
- fi
28
-
29
- # Check docker Name
30
- if ! grep -q ' image=".*"' " ${CWD} /../Dockerfile" > /dev/null 2>&1 ; then
31
- echo " No 'image' LABEL found"
32
- exit
33
- fi
34
-
35
-
36
20
# ##
37
21
# ## Run tests
38
22
# ##
@@ -44,13 +28,13 @@ for f in ${FILES}; do
44
28
done
45
29
46
30
# Start a single test
47
- if [ " ${# } " -eq " 1 " ]; then
48
- sh -c " ${TESTS[${1}] } "
31
+ if [ " ${# } " -eq " 2 " ]; then
32
+ sh -c " ${TESTS[${2}]} ${IMAGE }"
49
33
50
34
# Run all tests
51
35
else
52
36
for i in " ${TESTS[@]} " ; do
53
- echo " sh -c ${CWD} /${i} "
54
- sh -c " ${i} "
37
+ echo " sh -c ${CWD} /${i} ${IMAGE} "
38
+ sh -c " ${i} ${IMAGE} "
55
39
done
56
40
fi
Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ install:
52
52
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce; then break; else i=$((i+1)); fi done
53
53
- docker version
54
54
script :
55
- - .ci/start-ci.sh "${TEST}" "${IMAGE}"
55
+ - make build
56
+ - make test ARG=${TEST}
56
57
57
58
58
59
# ##
Original file line number Diff line number Diff line change 1
1
FROM httpd:2.4
2
2
MAINTAINER "cytopia" <
[email protected] >
3
3
4
+ LABEL \
5
+ name="cytopia's apache 2.4 image" \
6
+ image="devilbox/apache-2.4" \
7
+ vendor="devilbox" \
8
+ license="MIT"
4
9
5
10
# ##
6
11
# ## Build arguments
7
12
# ##
8
- ARG VHOST_GEN_GIT_REF=0.7
13
+ ARG VHOST_GEN_GIT_REF=0.10
9
14
ARG CERT_GEN_GIT_REF=0.2
10
15
11
16
ENV BUILD_DEPS \
Original file line number Diff line number Diff line change
1
+ image = devilbox/apache-2.4
2
+
3
+ help :
4
+ @printf " %s\n" " make build: Build"
5
+ @printf " %s\n" " make rebuild: Rebuild"
6
+ @printf " %s\n" " make test: Test"
7
+
8
+
9
+ build : pull
10
+ docker build -t $(image ) .
11
+ cd build; ./gen-readme.sh $(image )
12
+
13
+ rebuild : pull
14
+ docker build --no-cache -t $(image ) .
15
+ cd build; ./gen-readme.sh $(image )
16
+
17
+ test :
18
+ .ci/start-ci.sh $(image ) $(ARG )
19
+
20
+ pull :
21
+ docker pull $(shell grep FROM Dockerfile | sed 's/^FROM//g'; done)
Original file line number Diff line number Diff line change @@ -255,9 +255,9 @@ It allows any of the following combinations:
255
255
## Version
256
256
257
257
```
258
- Server version: Apache/2.4.33 (Unix)
259
- Server built: Apr 30 2018 04:30:01
260
- Server's Module Magic Number: 20120211:76
258
+ Server version: Apache/2.4.34 (Unix)
259
+ Server built: Jul 31 2018 16:48:40
260
+ Server's Module Magic Number: 20120211:79
261
261
Server loaded: APR 1.5.1, APR-UTIL 1.5.4
262
262
Compiled using: APR 1.5.1, APR-UTIL 1.5.4
263
263
Architecture: 64-bit
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments