Skip to content

Commit a31d1a8

Browse files
authored
Merge pull request #14 from devilbox/release-0.19
Use latest vhost-gen version
2 parents 7873fa4 + b2352a3 commit a31d1a8

File tree

12 files changed

+63
-176
lines changed

12 files changed

+63
-176
lines changed

.ci/.lib.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ set -u
55
set -o pipefail
66

77

8-
###
9-
### Variables
10-
###
11-
CWD="$( dirname "${0}" )"
12-
13-
148
###
159
### Run
1610
###
@@ -45,9 +39,3 @@ function get_random_name() {
4539
done
4640
echo "${name}"
4741
}
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}"

.ci/00.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -u
55
set -o pipefail
66

77
CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
8+
DOCKER_NAME="${1}"
89

910

1011
###
@@ -23,12 +24,6 @@ RAND_NAME="$( get_random_name )"
2324
run "echo \"hello world\" > ${RAND_DIR}/index.html"
2425

2526

26-
###
27-
### Build container
28-
###
29-
run "docker build -t ${DOCKER_NAME} ${CWD}/.."
30-
31-
3227
###
3328
### Startup container
3429
###
@@ -48,8 +43,8 @@ run "docker run -d --rm \
4843
run "sleep 5"
4944
run "docker ps"
5045
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'"
5348

5449

5550
###

.ci/01.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -u
55
set -o pipefail
66

77
CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
8+
DOCKER_NAME="${1}"
89

910

1011
###

.ci/start-ci.sh

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,11 @@ IFS=$'\n'
1212

1313
# Current directory
1414
CWD="$( dirname "${0}" )"
15+
IMAGE="${1}"
1516

1617
declare -a TESTS=()
1718

1819

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-
3620
###
3721
### Run tests
3822
###
@@ -44,13 +28,13 @@ for f in ${FILES}; do
4428
done
4529

4630
# 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}"
4933

5034
# Run all tests
5135
else
5236
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}"
5539
done
5640
fi

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ install:
5252
- 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
5353
- docker version
5454
script:
55-
- .ci/start-ci.sh "${TEST}" "${IMAGE}"
55+
- make build
56+
- make test ARG=${TEST}
5657

5758

5859
###

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
FROM httpd:2.4
22
MAINTAINER "cytopia" <[email protected]>
33

4+
LABEL \
5+
name="cytopia's apache 2.4 image" \
6+
image="devilbox/apache-2.4" \
7+
vendor="devilbox" \
8+
license="MIT"
49

510
###
611
### Build arguments
712
###
8-
ARG VHOST_GEN_GIT_REF=0.7
13+
ARG VHOST_GEN_GIT_REF=0.10
914
ARG CERT_GEN_GIT_REF=0.2
1015

1116
ENV BUILD_DEPS \

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ It allows any of the following combinations:
255255
## Version
256256

257257
```
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
261261
Server loaded: APR 1.5.1, APR-UTIL 1.5.4
262262
Compiled using: APR 1.5.1, APR-UTIL 1.5.4
263263
Architecture: 64-bit

build/docker-build.sh

Lines changed: 0 additions & 65 deletions
This file was deleted.

build/docker-rebuild.sh

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)