Commit 8a45321b authored by Jürgen Haas's avatar Jürgen Haas
Browse files

bitegra/portal/drupal/projects/portal-default#8 Add script to always write...

bitegra/portal/drupal/projects/portal-default#8 Add script to always write project and branch info to .env file
parent 0fa0c367
Pipeline #81289 passed with stage
in 1 minute and 37 seconds
#!/bin/bash
URL=$(git config --get remote.origin.url)
FILE=$(basename $URL)
PROJECT_NAME=$(echo "$FILE" | sed -r 's/\.git//g')
PROJECT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
PROJECT_BRANCH_SANITIZED=$(echo "$PROJECT_BRANCH" | sed -r 's/[\/_]+/-/g')
echo "PROJECT_NAME=${PROJECT_NAME}" >>.env
echo "PROJECT_BRANCH=${PROJECT_BRANCH}" >>.env
echo "PROJECT_BRANCH_SANITIZED=${PROJECT_BRANCH_SANITIZED}" >>.env
if [[ -f ".env" ]]; then
env -i $(cat .env | xargs) >.env
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment