Commit d81b20fc authored by Robin Fischer's avatar Robin Fischer

Use a file

parent 55f6a525
......@@ -9,10 +9,12 @@
GIT_STRATEGY: none
before_script:
# Modify a file and count up how often we have waked. Then only wake when file is zero and set to sleep when file is 1
- if [ -z ${GITLAB_RUNNER_WAKE_LOCK_COUNT} ]; then export GITLAB_RUNNER_WAKE_LOCK_COUNT=0; fi
- GITLAB_RUNNER_WAKE_LOCK_PATH=~/GITLAB_RUNNER_WAKE_LOCK
- if [ ! -f ${GITLAB_RUNNER_WAKE_LOCK_PATH} ]; then GITLAB_RUNNER_WAKE_LOCK_COUNT=0; else GITLAB_RUNNER_WAKE_LOCK_COUNT=$(cat ${GITLAB_RUNNER_WAKE_LOCK_PATH}); fi
- echo "Current Caffeinate Count ${GITLAB_RUNNER_WAKE_LOCK_COUNT} loading increasing by one"
- if [ ${GITLAB_RUNNER_WAKE_LOCK_COUNT} == 0 ]; then echo "Loading";launchctl load ~/Library/LaunchAgents/local.caffeinate.plist; fi
- GITLAB_RUNNER_WAKE_LOCK_COUNT=$((GITLAB_RUNNER_WAKE_LOCK_COUNT+1))
- echo ${GITLAB_RUNNER_WAKE_LOCK_COUNT} > ${GITLAB_RUNNER_WAKE_LOCK_PATH}
#- launchctl load ~/Library/LaunchAgents/local.caffeinate.plist
#- rm -rf gitlab-ci
#- BASE_URL=`echo $CI_REPOSITORY_URL | sed "s;\/*$CI_PROJECT_PATH.*;;"`
......@@ -28,7 +30,10 @@
variables:
GIT_STRATEGY: none
before_script:
- GITLAB_RUNNER_WAKE_LOCK_PATH=~/GITLAB_RUNNER_WAKE_LOCK
- if [ ! -f ${GITLAB_RUNNER_WAKE_LOCK_PATH} ]; then GITLAB_RUNNER_WAKE_LOCK_COUNT=0; else GITLAB_RUNNER_WAKE_LOCK_COUNT=$(cat ${GITLAB_RUNNER_WAKE_LOCK_PATH}); fi
- echo "Current Caffeinate Count ${GITLAB_RUNNER_WAKE_LOCK_COUNT}. Reducing by one"
- GITLAB_RUNNER_WAKE_LOCK_COUNT=$((GITLAB_RUNNER_WAKE_LOCK_COUNT-1))
- if [ ${GITLAB_RUNNER_WAKE_LOCK_COUNT} == 0 ]; then echo "Unloading";launchctl unload ~/Library/LaunchAgents/local.caffeinate.plist; fi
- echo ${GITLAB_RUNNER_WAKE_LOCK_COUNT} > ${GITLAB_RUNNER_WAKE_LOCK_PATH}
when: always
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