Skip to content
Snippets Groups Projects
Commit 4e93aaa0 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Allow automatic update of build scripts if necessary

parent 97d9fbb5
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
# Wed 21 Sep 2016 13:08:05 CEST
# Refreshes build scripts if necessary
$(dirname ${0})/install.sh $(dirname ${0})
source $(dirname ${0})/functions.sh
run_cmd $(dirname ${0})/before_test.sh
#!/usr/bin/env bash
# Wed 21 Sep 2016 13:08:05 CEST
# Refreshes build scripts if necessary
$(dirname ${0})/install.sh $(dirname ${0})
source $(dirname ${0})/functions.sh
run_cmd $(dirname ${0})/before_build.sh
......
......@@ -55,8 +55,6 @@ run_cmd() {
if [ ${status} != 0 ]; then
log_error "Command Failed \"${@}\""
exit ${status}
else
log_info "Finished comand \"${@}\""
fi
}
......@@ -97,7 +95,7 @@ doc_upload() {
check_pass DOCUSER
check_pass DOCPASS
log_info "${1} -> ${DOCSERVER}/${2}, via curl..."
curl --silent --user "${DOCUSER}:${DOCPASS}" --upload-file ${1} ${DOCSERVER}/${2}
curl --location --silent --user "${DOCUSER}:${DOCPASS}" --upload-file ${1} ${DOCSERVER}/${2}
local status=$?
if [ ${status} != 0 ]; then
log_error "Curl command finished with an error condition (status=${status})"
......
......@@ -29,14 +29,26 @@ run_cmd() {
if [ ${status} != 0 ]; then
log_error "Command Failed \"${@}\""
exit ${status}
else
log_info "Finished comand \"${@}\""
fi
}
get_script() {
run_cmd curl --silent --output ${1}/${2} "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/${2}"
local curlopt="--location --output ${1}/${2}"
if [ -e ${1}/${2} ]; then #check for updates
local checkopt="${curlopt} --time-cond ${1}/${2} --silent"
checkopt="${checkopt} --write-out %{http_code}"
if [ "$(curl ${checkopt})" == "200" ]; then
log_info "CI script ${1}/${2} needs updating..."
rm -f ${1}/${2}
else
log_info "CI script ${1}/${2} is up-to-date"
return 0
fi
fi
# check file needs updating
local url="https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/${2}"
run_cmd curl ${curlopt} ${url}
}
......@@ -48,6 +60,7 @@ get_exec() {
run_cmd mkdir -pv ${1}
get_script ${1} functions.sh
get_script ${1} install.sh
for stage in "build" "test" "wheels" "deploy"; do
get_exec ${1} before_${stage}.sh
get_exec ${1} ${stage}.sh
......
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