-
Notifications
You must be signed in to change notification settings - Fork 70
102 lines (100 loc) · 4.25 KB
/
image.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
name: Build Docker Image
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
variant:
- "4"
- "4/fastcgi"
steps:
- uses: actions/checkout@v4
- name: Build the image.
id: build
run: |
printf "::group::Sending context\n"
IMAGE=adminer:${VARIANT/\//-}-$(date +%s)
docker build "$VARIANT" --tag "$IMAGE" |sed 's/^Step/::endgroup::\n::group::Step/'
printf "::endgroup::\n"
printf "::set-output name=%s::%s\n" "image" "$IMAGE"
printf "::set-output name=%s::%s\n" "version" "$(awk '/^ENV\s+ADMINER_VERSION/{print $3}' "$VARIANT/Dockerfile")"
env:
VARIANT: ${{ matrix.variant }}
- name: Smoketest
run: |
docker run --name $container_name -d ${{ steps.build.outputs.image }}
env:
container_name: adminer_smoke
- name: Verify a restart works.
if: ${{ ! contains(steps.build.outputs.image, 'fastcgi') }}
run: |
docker run --name $container_name -d ${{ steps.build.outputs.image }}
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/
docker restart $container_name
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/
env:
container_name: adminer_restart
- name: Verify version.
if: ${{ ! contains(steps.build.outputs.image, 'fastcgi') }}
run: |
docker run --name $container_name -d ${{ steps.build.outputs.image }}
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/ \
|grep '<span class=\"version\">'${{ steps.build.outputs.version }}
env:
container_name: adminer_version
- name: Verify that no warnings appear.
if: ${{ ! contains(steps.build.outputs.image, 'fastcgi') }}
run: |
docker run --name $container_name -d ${{ steps.build.outputs.image }}
! docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/ \
|grep '<b>Warning</b>:'
env:
container_name: adminer_warnings
- name: Verify that the design works.
if: ${{ ! contains(steps.build.outputs.image, 'fastcgi') }}
run: |
docker run --name $container_name -d -e ADMINER_DESIGN=nette ${{ steps.build.outputs.image }}
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/ \
|grep 'adminer.css'
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/adminer.css \
|grep 'Nette'
env:
container_name: adminer_design
- name: Verify that the design works (Submodule).
if: ${{ ! contains(steps.build.outputs.image, 'fastcgi') }}
run: |
docker run --name $container_name -d -e ADMINER_DESIGN=hydra ${{ steps.build.outputs.image }}
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/ \
|grep 'adminer.css'
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/adminer.css \
|grep 'Hydra-Dark-Theme-for-Adminer'
env:
container_name: adminer_design2
- name: Verify that the default server works.
if: ${{ ! contains(steps.build.outputs.image, 'fastcgi') }}
run: |
docker run --name $container_name -d -e ADMINER_DEFAULT_SERVER=ADMINER_DEFAULT_SERVER_WORKS ${{ steps.build.outputs.image }}
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
curl -fsSL http://$container_name:8080/ \
|grep 'ADMINER_DEFAULT_SERVER_WORKS'
env:
container_name: adminer_defaultserver
- name: Show Containers and Images
run: |
printf "::group::docker ps -a\n"
docker ps -a
printf "::endgroup::\n"
printf "::group::docker images\n"
docker images
printf "::endgroup::\n"