From c77180dc709618d2ec070159af69ca74666e0663 Mon Sep 17 00:00:00 2001 From: Vitor Lima Date: Tue, 18 Jun 2024 16:36:44 -0300 Subject: [PATCH] feat: test dockerhub --- Dockerfile | 5 +++++ dockerhub.sh | 17 ----------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4601cdf..71a07a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,11 @@ RUN export CARGO_SERVER_SSL_CA=$(echo "${CARGO_SERVER_SSL_CA}" | base64 -d) RUN export CARGO_SERVER_SSL_CERT=$(echo "${CARGO_SERVER_SSL_CERT}" | base64 -d) RUN export CARGO_SERVER_SSL_KEY=$(echo "${CARGO_SERVER_SSL_KEY}" | base64 -d) +# Validate that the SSL environment variables are set +RUN /bin/bash -c 'if [ -z "$CARGO_SERVER_SSL_CA" ]; then echo "Error: CARGO_SERVER_SSL_CA is not set"; exit 1; fi && \ + if [ -z "$CARGO_SERVER_SSL_CERT" ]; then echo "Error: CARGO_SERVER_SSL_CERT is not set"; exit 1; fi && \ + if [ -z "$CARGO_SERVER_SSL_KEY" ]; then echo "Error: CARGO_SERVER_SSL_KEY is not set"; exit 1; fi' + RUN apt update RUN apt install -y protobuf-compiler libssl-dev gcc pkg-config build-essential diff --git a/dockerhub.sh b/dockerhub.sh index 257fc57..c0fcf7e 100644 --- a/dockerhub.sh +++ b/dockerhub.sh @@ -35,23 +35,6 @@ CARGO_SERVER_SSL_KEY_BASE64=$(echo "$CARGO_SERVER_SSL_KEY" | base64) echo "CARGO_SERVER_SSL_CA_BASE64: $CARGO_SERVER_SSL_CA_BASE64" echo "CARGO_SERVER_SSL_CERT_BASE64: $CARGO_SERVER_SSL_CERT_BASE64" echo "CARGO_SERVER_SSL_KEY_BASE64: $CARGO_SERVER_SSL_KEY_BASE64" - -# Validate if CARGO_SERVER_SSL_CA, CARGO_SERVER_SSL_CERT, and CARGO_SERVER_SSL_KEY are in base64 format -if ! [[ "$CARGO_SERVER_SSL_CA_BASE64" =~ ^[A-Za-z0-9+/=]+$ ]]; then - echo "Error: CARGO_SERVER_SSL_CA is not in base64 format." - exit 1 -fi - -if ! [[ "$CARGO_SERVER_SSL_CERT_BASE64" =~ ^[A-Za-z0-9+/=]+$ ]]; then - echo "Error: CARGO_SERVER_SSL_CERT is not in base64 format." - exit 1 -fi - -if ! [[ "$CARGO_SERVER_SSL_KEY_BASE64" =~ ^[A-Za-z0-9+/=]+$ ]]; then - echo "Error: CARGO_SERVER_SSL_KEY is not in base64 format." - exit 1 -fi - # Alpine # docker buildx build --push --build-arg TAGORELAY_VERSION=${FULL_VERSION} \ # --platform linux/arm64/v8,linux/amd64 \