bacillus/example_workdir/artifact.sh
Russ Magee cb5e2cd6ff Added -v option (version+gitCommit)
Removed double-quotes around parameterized job arguments

Signed-off-by: Russ Magee <rmagee@gmail.com>
2019-11-11 17:14:50 -08:00

84 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
#
# Parameterized build syntax
# --
# types: s - string, freeform
# c - choice (one-of), string
# b - boolean (true/false)
#
#-?s?DELAY?5?(in seconds)
#-?c?SUITE?small|big|huge?heap size
#-?b?DEBUG?1?Keep debug symbols
#-?b?Detonator?disabled
# --
#
# all params are strings, so REST calls can encode as POST params
# eg., ".../some_job/?DELAY=5&SUITE=big&DEBUG=true
# (these would override defaults first parsed from this file above, or set below)
#
# Defaults
# --
DELAY=${DELAY:-"5"}
SUITE=${SUITE:-"small"}
DEBUG=${DEBUG:-"false"}
##
function stage {
local _stage="${BACILLUS_WORKDIR}"/_stage
echo -e "\n--STAGE: ${1}--\n"
if [ ! -f ${_stage} ]; then
echo -n "$1" >"${BACILLUS_WORKDIR}"/_stage
else
echo -n ":$1" >>"${BACILLUS_WORKDIR}"/_stage
fi
}
stage "Setup"
echo "workdir: ${PWD}"
env
stage "Busywork"
for i in $(seq 1 4); do
echo "Doing some work (sleeping ${DELAY}). $i ..."
sleep ${DELAY}
done
stage "S1"
for i in $(seq 1 4); do
echo "Doing some work (sleeping ${DELAY}). $i ..."
sleep ${DELAY}
done
stage "S2"
for i in $(seq 1 4); do
echo "Doing some work (sleeping ${DELAY}). $i ..."
sleep ${DELAY}
done
stage "S3"
for i in $(seq 1 4); do
echo "Doing some work (sleeping ${DELAY}). $i ..."
sleep ${DELAY}
done
stage "S4"
for i in $(seq 1 4); do
echo "Doing some work (sleeping ${DELAY}). $i ..."
sleep ${DELAY}
done
stage "Artifacts"
ADIR="${BACILLUS_ARTFDIR}"
mkdir -p "${ADIR}"
echo "blah" >"${ADIR}/artifact.txt"
stage "Post Processing"
for i in $(seq 1 4); do
echo "Doing some work (sleeping ${DELAY}). $i ..."
sleep ${DELAY}
done
echo "--DONE--"