Skip to content
Snippets Groups Projects
setenv 996 B
Newer Older
TonyFord's avatar
TonyFord committed
#!/bin/bash

export RUNNER_UID=`id -u`
export RUNNER_GID=`id -g`

CI_PROJECT_NAME=${PWD##*/}

F=`ls -p ./env | grep -v /`
for f in $F
do
    v=`echo -n ${!f}`
    if [ "${!f}" != "" ]
    then
      echo "${f}=${!f}" > ./env/${f}
    fi
done

if [[ -d "./env_file" ]]
then
  F=`ls -p ./env_file | grep -v /`
  for f in $F
  do
     echo ${f}=./env_file/${f} > ./env/${f}
  done
fi

# link to gitlab-runner env files if exists ####
if [[ -d "../${CI_PROJECT_NAME}.tmp" ]]
then
  F=`ls -p ../${CI_PROJECT_NAME}.tmp | grep -v /`
  for f in $F
  do
     echo ${f}=${PWD}/../${CI_PROJECT_NAME}.tmp/${f} > ./env/${f}
  done
fi

# export env vars
export `cat ./env/*`

# set executable to console and deployment commands
chmod +x console/jekyll
TonyFord's avatar
TonyFord committed
chmod +x console/php-server
TonyFord's avatar
TonyFord committed
chmod +x console/help
chmod +x console/ps

chmod +x deploy/help
TonyFord's avatar
TonyFord committed
chmod +x deploy/build
TonyFord's avatar
TonyFord committed
chmod +x deploy/start
chmod +x deploy/jekyll_debug
chmod +x deploy/update
chmod +x deploy/stop
chmod +x deploy/uninstall
TonyFord's avatar
TonyFord committed
chmod +x deploy/remove