Skip to content

Commit

Permalink
feat: test dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorfdl committed Jun 18, 2024
1 parent 78e7270 commit c77180d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 0 additions & 17 deletions dockerhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit c77180d

Please sign in to comment.