From c2c2809ff1ca154d7796f7a573874095911cf37c Mon Sep 17 00:00:00 2001 From: Quentin Duchemin <quentinduchemin@tuta.io> Date: Mon, 9 Dec 2019 14:12:29 +0100 Subject: [PATCH] Remove deployment utilities --- decrypt-secrets.sh | 29 ----------------------------- get-host-by-image.sh | 9 --------- pica-ci/Dockerfile | 6 +----- 3 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 decrypt-secrets.sh delete mode 100644 get-host-by-image.sh diff --git a/decrypt-secrets.sh b/decrypt-secrets.sh deleted file mode 100644 index eaa4d9a3..00000000 --- a/decrypt-secrets.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# import the PGP key for the right environment -if [ "$PICA_ENVIRONMENT" = "TEST" ]; -then - echo "$PRIVATE_GPG_KEY_TEST" > /tmp/pgp-key -elif [ "$PICA_ENVIRONMENT" = "PRODUCTION" ]; -then - echo "$PRIVATE_GPG_KEY_PRODUCTION" > /tmp/pgp-key -else - exit -1 -fi -cat /tmp/pgp-key | gpg --import - -# decrypt the secrets -SECRETS_PATH=$MODIFIED_IMAGE/secrets/encrypted-variables-$(echo $PICA_ENVIRONMENT | tr '[:upper:]' '[:lower:]') -echo $SECRETS_PATH - -for container_secrets_folder in $SECRETS_PATH/*; -do - CONTAINER_NAME=$(basename $container_secrets_folder) - for encrypted_secret in $container_secrets_folder/*; - do - SECRET_NAME=$(basename $encrypted_secret) - ( echo -n "$SECRET_NAME=" ; gpg --quiet --decrypt $encrypted_secret ) >> $MODIFIED_IMAGE/secrets/$CONTAINER_NAME.secrets - done -done - -ls -al pica-etherpad/secrets/ \ No newline at end of file diff --git a/get-host-by-image.sh b/get-host-by-image.sh deleted file mode 100644 index f725c73a..00000000 --- a/get-host-by-image.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# return the host the service is hosted on -case $MODIFIED_IMAGE in - pica-etherpad) RES="PICA02" - ;; - pica-dokuwiki) RES="PICA02" -esac -echo $RES diff --git a/pica-ci/Dockerfile b/pica-ci/Dockerfile index 71a72753..91ba05aa 100644 --- a/pica-ci/Dockerfile +++ b/pica-ci/Dockerfile @@ -6,9 +6,5 @@ COPY . /workdir/ RUN chmod +x get-modified-image.sh get-host-by-image.sh decrypt-secrets.sh && \ export MODIFIED_IMAGE_FULL=$(./get-modified-image.sh) && \ export MODIFIED_IMAGE=$(echo $MODIFIED_IMAGE_FULL | cut -d ':' -f1) && \ - export CONTAINER_NAME=$(cat $MODIFIED_IMAGE/docker-compose.yml | grep $MODIFIED_IMAGE -B1 | head -n1 | cut -d ':' -f1 | xargs) && \ - export HOST=$(./get-host-by-image.sh) && \ echo "MODIFIED_IMAGE=$MODIFIED_IMAGE" >> /etc/profile.d/ci-variables && \ - echo "MODIFIED_IMAGE_FULL=$MODIFIED_IMAGE_FULL" >> /etc/profile.d/ci-variables && \ - echo "CONTAINER_NAME=$CONTAINER_NAME" >> /etc/profile.d/ci-variables && \ - echo "HOST=$HOST" >> /etc/profile.d/ci-variables + echo "MODIFIED_IMAGE_FULL=$MODIFIED_IMAGE_FULL" >> /etc/profile.d/ci-variables -- GitLab