Skip to content
Snippets Groups Projects
Verified Commit c2c2809f authored by Quentin Duchemin's avatar Quentin Duchemin
Browse files

Remove deployment utilities

parent 768a0d83
No related branches found
No related tags found
1 merge request!44Optimize CI and remove deployment steps, add Mattermost and update Etherpad
Pipeline #51054 failed
#!/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
#!/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
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment