ReachableCEO-Profile-FullTi.../local/build/build-resume.sh

66 lines
2.3 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
2025-01-01 15:52:15 +00:00
# Exit on error
set -e
2025-01-01 15:52:15 +00:00
# A client script to setup variables for and execute the markdown resume pipeline
# Executes: ../../vendor/git.knownelement.com/reachableceo/MarkdownResume-Pipeline/build/build-pipeline-server-markdown.sh
2025-01-01 15:52:15 +00:00
# Check if CandidateVariables.env exists
if [ ! -f "./CandidateVariables.env" ]; then
echo "Error: CandidateVariables.env not found"
exit 1
fi
# Source the environment file with error handling
if ! source ./CandidateVariables.env; then
echo "Error: Failed to source CandidateVariables.env. Please check the file for syntax errors."
exit 1
fi
# Verify required environment variables
required_vars=("PipelineClientWorkingDir" "BUILD_OUTPUT_DIR")
for var in "${required_vars[@]}"; do
if [ -z "${!var}" ]; then
echo "Error: Required environment variable $var is not set"
exit 1
fi
done
####################################################
#DO NOT CHANGE ANYTHING BELOW THIS LINE
####################################################
##################################################################
# Setup globals for use by the build-pipeline-server.sh script
##################################################################
export MO_PATH="bash ../../vendor/git.knownelement.com/ExternalVendorCode/mo/mo"
2024-12-13 19:08:55 +00:00
export BUILD_TEMP_DIR="$PipelineClientWorkingDir/build-temp/MarkdownResume"
export BUILDYAML_JOBBOARD="$BUILD_TEMP_DIR/JobBoard.yml"
export BUILDYAML_CLIENTSUBMISSION="$BUILD_TEMP_DIR/ClientSubmission.yml"
export BUILDYAML_CANDIDATEINFOSHEET="$BUILD_TEMP_DIR/CandidateInfoSheet.yml"
2025-01-01 15:52:15 +00:00
# Create necessary directories if they don't exist
mkdir -p "$BUILD_TEMP_DIR"
mkdir -p "$BUILD_OUTPUT_DIR/client-submit"
mkdir -p "$BUILD_OUTPUT_DIR/job-board"
mkdir -p "$BUILD_OUTPUT_DIR/recruiter"
2025-01-01 15:52:15 +00:00
# Cleanup previous intermediate and final output artifacts
rm -vf "$BUILD_TEMP_DIR"/*.yml
rm -vf "$BUILD_TEMP_DIR"/*.md
2025-01-01 15:52:15 +00:00
rm -vf "$BUILD_OUTPUT_DIR"/client-submit/*
rm -vf "$BUILD_OUTPUT_DIR"/job-board/*
rm -vf "$BUILD_OUTPUT_DIR"/recruiter/*
2025-01-01 15:52:15 +00:00
# Verify pipeline server script exists
PIPELINE_SERVER="../../vendor/git.knownelement.com/reachableceo/MarkdownResume-Pipeline/build/build-pipeline-server-markdown.sh"
if [ ! -f "$PIPELINE_SERVER" ]; then
echo "Error: Pipeline server script not found at: $PIPELINE_SERVER"
exit 1
fi
2025-01-01 15:52:15 +00:00
# Call the build-pipeline-server in the vendored repository to produce updated output artifacts
bash "$PIPELINE_SERVER"