cluster-deployment/new-job

18 lines
425 B
Bash
Executable file

#!/usr/bin/env bash
# Make sure the current directory is the location of this script to simplify matters
cd "$(dirname "$(readlink -f "$0")")";
job_name="$1";
if [[ -z "${job_name}" ]]; then
echo "Usage:";
echo " ./new-job {job_name}";
exit;
fi
job_filename="./jobs/${job_name}/${job_name}.job";
mkdir -p "$(dirname "${job_filename}")";
echo -e "#!/usr/bin/env bash\n" >"${job_filename}";
chmod +x "${job_filename}";