Skip to content

Commit 0f45307

Browse files
committed
Rename the image tag to use :testing so it's distinct from any other built image
1 parent b13b091 commit 0f45307

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
load: true
6666
cache-from: type=gha
6767
cache-to: type=gha,mode=max
68-
tags: "mendhak/http-https-echo:latest"
68+
tags: "mendhak/http-https-echo:testing"
6969
labels: ${{ steps.meta.outputs.labels }}
7070

7171
- name: Build the image single platform and run tests

tests.sh

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ if ! [ -x "$(command -v jq)" ]; then
2727
fi
2828

2929
message " Check if we're in Github Actions "
30-
if [ -n "${GITHUB_ACTIONS}" ]; then
30+
if [ -n "${GITHUB_ACTIONS:-}" ]; then
3131
docker images
32-
if [ -z "$(docker images -q mendhak/http-https-echo:latest 2> /dev/null)" ]; then
33-
echo "Docker image mendhak/http-https-echo:latest not found. Exiting."
32+
if [ -z "$(docker images -q mendhak/http-https-echo:testing 2> /dev/null)" ]; then
33+
echo "Docker image mendhak/http-https-echo:testing not found. Exiting."
3434
exit 1
3535
fi
3636
else
3737
message " Local run. Build image "
38-
docker build -t mendhak/http-https-echo:latest .
38+
docker build -t mendhak/http-https-echo:testing .
3939
fi
4040

4141

@@ -46,7 +46,7 @@ message " Cleaning up from previous test run "
4646
docker ps -aq --filter "name=http-echo-tests" | grep -q . && docker stop http-echo-tests && docker rm -f http-echo-tests
4747

4848
message " Start container normally "
49-
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
49+
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
5050
sleep 5
5151

5252

@@ -159,7 +159,7 @@ docker stop http-echo-tests
159159
sleep 5
160160

161161
message " Start container with different internal ports "
162-
docker run -d --rm -e HTTP_PORT=8888 -e HTTPS_PORT=9999 --name http-echo-tests -p 8080:8888 -p 8443:9999 -t mendhak/http-https-echo
162+
docker run -d --rm -e HTTP_PORT=8888 -e HTTPS_PORT=9999 --name http-echo-tests -p 8080:8888 -p 8443:9999 -t mendhak/http-https-echo:testing
163163
sleep 5
164164

165165
message " Make http(s) request, and test the path, method and header. "
@@ -193,7 +193,7 @@ docker stop http-echo-tests
193193
sleep 5
194194

195195
message " Start container with empty responses "
196-
docker run -d --rm -e ECHO_BACK_TO_CLIENT=false --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
196+
docker run -d --rm -e ECHO_BACK_TO_CLIENT=false --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
197197
sleep 5
198198
REQUEST=$(curl -s -k http://localhost:8080/a/b/c)
199199
if [[ -z ${REQUEST} ]]
@@ -210,7 +210,7 @@ docker stop http-echo-tests
210210
sleep 5
211211

212212
message " Start container with response body only "
213-
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
213+
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
214214
sleep 5
215215
RESPONSE=$(curl -s -k -X POST -d 'cauliflower' http://localhost:8080/a/b/c?response_body_only=true)
216216
if [[ ${RESPONSE} == "cauliflower" ]]
@@ -228,7 +228,7 @@ docker stop http-echo-tests
228228
sleep 5
229229

230230
message " Start container with JWT_HEADER "
231-
docker run -d --rm -e JWT_HEADER=Authentication --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
231+
docker run -d --rm -e JWT_HEADER=Authentication --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
232232
sleep 5
233233

234234
REQUEST=$(curl -s -k -H "Authentication: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" https://localhost:8443/ )
@@ -249,7 +249,7 @@ sleep 5
249249

250250

251251
message " Start container with LOG_IGNORE_PATH "
252-
docker run -d --rm -e LOG_IGNORE_PATH=/ping --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
252+
docker run -d --rm -e LOG_IGNORE_PATH=/ping --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
253253
sleep 5
254254
curl -s -k -X POST -d "banana" https://localhost:8443/ping > /dev/null
255255

@@ -269,7 +269,7 @@ docker stop http-echo-tests
269269
sleep 5
270270

271271
message " Start container with DISABLE_REQUEST_LOGS "
272-
docker run -d --rm -e DISABLE_REQUEST_LOGS=true --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
272+
docker run -d --rm -e DISABLE_REQUEST_LOGS=true --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
273273
sleep 5
274274
curl -s -k -X GET https://localhost:8443/strawberry > /dev/null
275275
if [ $(docker logs http-echo-tests | grep -c "GET /strawberry HTTP/1.1") -eq 0 ]
@@ -288,7 +288,7 @@ sleep 5
288288
message " Start container with CORS_CONFIG"
289289
docker run -d --rm \
290290
-e CORS_ALLOW_ORIGIN="http://example.com" -e CORS_ALLOW_HEADERS="x-custom-test-header" \
291-
--name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
291+
--name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
292292
sleep 5
293293
# Check if the expected CORS headers are present in the response
294294
if curl -s -i http://localhost:8080/ 2>&1 | grep -q -E \
@@ -307,7 +307,7 @@ docker stop http-echo-tests
307307
sleep 5
308308

309309
message " Start container with LOG_WITHOUT_NEWLINE "
310-
docker run -d --rm -e LOG_WITHOUT_NEWLINE=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
310+
docker run -d --rm -e LOG_WITHOUT_NEWLINE=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
311311
sleep 5
312312
curl -s -k -X POST -d "tiramisu" https://localhost:8443/ > /dev/null
313313

@@ -327,7 +327,7 @@ docker stop http-echo-tests
327327
sleep 5
328328

329329
message " Check that container is running as a NON ROOT USER by default"
330-
docker run -d --name http-echo-tests --rm mendhak/http-https-echo
330+
docker run -d --name http-echo-tests --rm mendhak/http-https-echo:testing
331331

332332
WHOAMI=$(docker exec http-echo-tests whoami)
333333

@@ -344,9 +344,9 @@ docker stop http-echo-tests
344344
sleep 5
345345

346346
message " Check that container is running as user different that the user defined in image"
347-
IMAGE_USER="$(docker image inspect mendhak/http-https-echo -f '{{ .Config.User }}')"
347+
IMAGE_USER="$(docker image inspect mendhak/http-https-echo:testing -f '{{ .Config.User }}')"
348348
CONTAINER_USER="$((IMAGE_USER + 1000000))"
349-
docker run -d --name http-echo-tests --rm -u "${CONTAINER_USER}" -p 8080:8080 mendhak/http-https-echo
349+
docker run -d --name http-echo-tests --rm -u "${CONTAINER_USER}" -p 8080:8080 mendhak/http-https-echo:testing
350350
sleep 5
351351
curl -s http://localhost:8080 > /dev/null
352352

@@ -369,7 +369,7 @@ message " Check that mTLS server responds with client certificate details"
369369
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout privkey.pem -out fullchain.pem \
370370
-subj "/CN=client.example.net" \
371371
-addext "subjectAltName=DNS:client.example.net"
372-
docker run -d --rm -e MTLS_ENABLE=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
372+
docker run -d --rm -e MTLS_ENABLE=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
373373
sleep 5
374374
COMMON_NAME="$(curl -sk --cert fullchain.pem --key privkey.pem https://localhost:8443/ | jq -r '.clientCertificate.subject.CN')"
375375
SAN="$(curl -sk --cert fullchain.pem --key privkey.pem https://localhost:8443/ | jq -r '.clientCertificate.subjectaltname')"
@@ -422,7 +422,7 @@ docker run -d --rm \
422422
-e HTTPS_CERT_FILE="${container_https_cert_file}" \
423423
-v "${https_key_file}:${container_https_key_file}:ro,z" \
424424
-e HTTPS_KEY_FILE="${container_https_key_file}" \
425-
--name http-echo-tests -p 8443:8443 -t mendhak/http-https-echo
425+
--name http-echo-tests -p 8443:8443 -t mendhak/http-https-echo:testing
426426
sleep 5
427427

428428
REQUEST_WITH_STATUS_CODE="$(curl -s --cacert "$(pwd)/server_fullchain.pem" -o /dev/null -w "%{http_code}" \
@@ -440,7 +440,7 @@ docker stop http-echo-tests
440440
sleep 5
441441

442442
message " Check that environment variables returned in response if enabled"
443-
docker run -d --rm -e ECHO_INCLUDE_ENV_VARS=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
443+
docker run -d --rm -e ECHO_INCLUDE_ENV_VARS=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
444444
sleep 5
445445
RESPONSE_BODY="$(curl -sk https://localhost:8443/ | jq -r '.env.ECHO_INCLUDE_ENV_VARS')"
446446

@@ -457,7 +457,7 @@ docker stop http-echo-tests
457457
sleep 5
458458

459459
message " Check that environment variables are not present in response by default"
460-
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
460+
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
461461
sleep 5
462462
RESPONSE_BODY_ENV_CHECK="$(curl -sk https://localhost:8443/ | jq 'has("env")')"
463463

@@ -474,7 +474,7 @@ docker stop http-echo-tests
474474
sleep 5
475475

476476
message " Start container with PROMETHEUS disabled "
477-
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
477+
docker run -d --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
478478
sleep 5
479479
curl -s -k -X POST -d "tiramisu" https://localhost:8443/ > /dev/null
480480

@@ -495,7 +495,7 @@ docker stop http-echo-tests
495495
sleep 5
496496

497497
message " Start container with PROMETHEUS enabled "
498-
docker run -d -e PROMETHEUS_ENABLED=true --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo
498+
docker run -d -e PROMETHEUS_ENABLED=true --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
499499
sleep 5
500500
curl -s -k -X POST -d "tiramisu" https://localhost:8443/ > /dev/null
501501

0 commit comments

Comments
 (0)