UNCLASSIFIED

Skip to content
Snippets Groups Projects
Commit e52700cc authored by Ben's avatar Ben
Browse files

adding tests, removing stages

parent 256e5015
Branches
No related merge requests found
stages:
- build
- test
- push
before_script:
- docker info
build_image:
stage: build
refresh_image:
script:
- docker build -t registry.cybbh.space/courseware-as-code/courseware-builder/container .
only:
- master
test_image:
stage: test
script:
- docker run registry.cybbh.space/courseware-as-code/courseware-builder/container /opt/course_builder/tests.sh
only:
- master
push_image:
stage: push
script:
- docker login -u "${DOCKER_LOGIN_USER}" -p "${DOCKER_LOGIN_PASS}" registry.cybbh.space
- docker push registry.cybbh.space/courseware-as-code/courseware-builder/container
only:
- master
......@@ -11,11 +11,15 @@ declare -a test_commands=("/opt/appbin/hugo version"
function run_test () {
cmd="$1"
echo [-] Running command: $cmd
$cmd && echo [+] Succesfully running previous command || echo [!] Error running the previous command!
$cmd && echo [+] Succesfully running previous command || errors="$errors\n Error running the command: $cmd"
echo ""
}
errors=""
for entry in "${test_commands[@]}"
do
run_test "$entry"
done
if [ ! -z "$errors" ]; then
printf "[!] There were errors: $errors\n"
exit 1
fi
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