2019-11-25 13:11:18 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-03-26 17:50:12 +01:00
|
|
|
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
source $current_dir/base.sh # Get variables from base.
|
2019-11-25 13:11:18 +01:00
|
|
|
|
|
|
|
case ${2} in
|
|
|
|
prepare_script)
|
|
|
|
;;
|
|
|
|
get_sources)
|
|
|
|
;;
|
|
|
|
restore_cache)
|
|
|
|
;;
|
|
|
|
download_artifacts)
|
|
|
|
;;
|
|
|
|
build_script)
|
|
|
|
case $PROJECT_NAME in
|
|
|
|
yunohost)
|
2020-05-18 16:52:26 +02:00
|
|
|
echo "Running migrations yunohost"
|
2020-04-09 18:49:56 +02:00
|
|
|
|
|
|
|
# Run migrations
|
|
|
|
lxc exec "$CONTAINER_ID" -- sh -c "yunohost tools migrations migrate"
|
2019-11-25 13:11:18 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
after_script)
|
|
|
|
;;
|
|
|
|
archive_cache)
|
|
|
|
;;
|
|
|
|
upload_artifact_on_success)
|
|
|
|
;;
|
|
|
|
upload_artifact_on_failure)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
lxc exec "$CONTAINER_ID" /bin/bash < "${1}"
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
# Exit using the variable, to make the build as failure in GitLab
|
|
|
|
# CI.
|
|
|
|
exit $BUILD_FAILURE_EXIT_CODE
|
|
|
|
fi
|