From eb7488333c0ea840fdc02a1a0667ec0c6c8abd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=81=A3?= <⁣> Date: Thu, 18 Jun 2020 23:35:23 +0200 Subject: [PATCH] Use local CA in dev env --- sh/tests/Dockerfile | 2 ++ sh/tests/solutions/myfamily.sh | 6 +----- sh/tests/solutions/who-are-you.sh | 6 +----- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sh/tests/Dockerfile b/sh/tests/Dockerfile index 63f5fd320..dfbc03ec9 100644 --- a/sh/tests/Dockerfile +++ b/sh/tests/Dockerfile @@ -2,5 +2,7 @@ FROM debian:stable-slim RUN apt-get update RUN apt-get -y install jq curl git +COPY --from=mkcert-ca . /usr/local/share/ca-certificates +RUN update-ca-certificates COPY . /app ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"] diff --git a/sh/tests/solutions/myfamily.sh b/sh/tests/solutions/myfamily.sh index c2ed75ff6..a1549631b 100755 --- a/sh/tests/solutions/myfamily.sh +++ b/sh/tests/solutions/myfamily.sh @@ -5,9 +5,5 @@ set -euo pipefail IFS=' ' -f="" -# --insecure flag to make it work with dev environment (self-signed certificate) -test "$DOMAIN" = "localhost" && f="--insecure" - -curl $f --compressed --silent --show-error --max-time 10 https://$DOMAIN/assets/superhero/all.json | +curl --compressed --silent --show-error --max-time 10 https://$DOMAIN/assets/superhero/all.json | jq ".[] | select(.id == $HERO_ID)" | grep relatives | cut -d'"' -f4 diff --git a/sh/tests/solutions/who-are-you.sh b/sh/tests/solutions/who-are-you.sh index 27681479b..6eb82adf6 100755 --- a/sh/tests/solutions/who-are-you.sh +++ b/sh/tests/solutions/who-are-you.sh @@ -5,9 +5,5 @@ set -euo pipefail IFS=' ' -f="" -# --insecure flag to make it work with dev environment (self-signed certificate) -test "$DOMAIN" = "localhost" && f="--insecure" - -curl $f --compressed --silent --show-error --max-time 10 https://$DOMAIN/assets/superhero/all.json | +curl --compressed --silent --show-error --max-time 10 "https://$DOMAIN/assets/superhero/all.json" | jq '.[] | select(.id == 70) | .name'