Squashed 'vendor/git.knownelement.com/reachableceo/MarkdownResume-Pipeline/' content from commit 04d78dc
git-subtree-dir: vendor/git.knownelement.com/reachableceo/MarkdownResume-Pipeline git-subtree-split: 04d78dc9babaf1d08b159fb575dee137bbc3e38d
This commit is contained in:
339
build/build-pipeline-server-json.sh
Normal file
339
build/build-pipeline-server-json.sh
Normal file
@@ -0,0 +1,339 @@
|
||||
#!/bin/bash
|
||||
|
||||
#####################################################################################################
|
||||
#JSON Resume
|
||||
#####################################################################################################
|
||||
|
||||
####################################################
|
||||
####################################################
|
||||
####################################################
|
||||
#DO NOT CHANGE ANYTHING BELOW THIS LINE
|
||||
####################################################
|
||||
####################################################
|
||||
####################################################
|
||||
|
||||
add_open_section()
|
||||
|
||||
{
|
||||
|
||||
echo "{" > $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_meta_section()
|
||||
|
||||
{
|
||||
|
||||
cat << META >> $BUILD_OUTPUT_DIR/resume.json
|
||||
"meta": {
|
||||
"theme": "$JSONRESUME_THEME"
|
||||
},
|
||||
META
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
add_basics_section()
|
||||
|
||||
{
|
||||
|
||||
cat << BASICS >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
"basics": {
|
||||
"name": "$CandidateName",
|
||||
"phone": "$CandidatePhone",
|
||||
"label": "$CandidateRole",
|
||||
"image": "$CandidateAvatar",
|
||||
"summary": "$CandidateOneLineSummary",
|
||||
"website": "$CandidateWebsite",
|
||||
"url": "https://lordajax.com",
|
||||
"email": "$CandidateEmail",
|
||||
"location": {
|
||||
"city": "$CandidateLocation",
|
||||
"countryCode": "$CandidateCountry"
|
||||
},
|
||||
},
|
||||
BASICS
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Bash Function to Append JSON
|
||||
add_profiles_section ()
|
||||
|
||||
{
|
||||
|
||||
echo '{"profiles": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r username url network; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"username": "$username",
|
||||
"url": "$url",
|
||||
"network": "$network"
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/profiles.csv
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_certificates_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"certificates": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r name date issuer url; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"name": "$name",
|
||||
"date": "$date",
|
||||
"issuer": "$issuer",
|
||||
"url": "$url"
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/certificates.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_education_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"education": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r institution url area studyType startDate endDate score courses; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"institution": "$institution",
|
||||
"url": "$url",
|
||||
"area": "$area",
|
||||
"studyType": "$studyType",
|
||||
"startDate": "$startDate",
|
||||
"endDate": "$endDate",
|
||||
"score": "$score",
|
||||
"courses": [$(echo "$courses" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')]
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/education.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_references_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"references": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r reference name; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"reference": "$reference",
|
||||
"name": "$name"
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/references.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_skills_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"skills": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r name level keywords; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"name": "$name",
|
||||
"level": "$level",
|
||||
"keywords": [$(echo "$keywords" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')]
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/skills.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_awards_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"awards": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r title awarder date summary; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"title": "$title",
|
||||
"awarder": "$awarder",
|
||||
"date": "$date",
|
||||
"summary": "$summary"
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/awards.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_publications_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"publications": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r name publisher releaseDate url summary; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"name": "$name",
|
||||
"publisher": "$publisher",
|
||||
"releaseDate": "$releaseDate",
|
||||
"url": "$url",
|
||||
"summary": "$summary"
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/publications.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_volunteer_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"volunteer": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r organization position url startDate summary highlights; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"organization": "$organization",
|
||||
"position": "$position",
|
||||
"url": "$url",
|
||||
"startDate": "$startDate",
|
||||
"summary": "$summary",
|
||||
"highlights": [$(echo "$highlights" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')]
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/volunteer.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_work_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"work": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r name position location website startDate endDate summary highlights; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"name": "$name",
|
||||
"position": "$position",
|
||||
"location": "$location",
|
||||
"website": "$website",
|
||||
"startDate": "$startDate",
|
||||
"endDate": "$endDate",
|
||||
"summary": "$summary",
|
||||
"highlights": [$(echo "$highlights" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')]
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/work.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
|
||||
add_languages_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"languages": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r language fluency; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"language": "$language",
|
||||
"fluency": "$fluency"
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/languages.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_interests_section()
|
||||
|
||||
{
|
||||
|
||||
echo '{"interests": [' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
while IFS=, read -r name keywords; do
|
||||
cat <<EOF >> $BUILD_OUTPUT_DIR/resume.json
|
||||
{
|
||||
"name": "$name",
|
||||
"keywords": [$(echo "$keywords" | sed 's/;/","/g' | sed 's/^/"/;s/$/"/')]
|
||||
},
|
||||
EOF
|
||||
done < $JSON_TEMPLATE_DIRECTORY/interests.csv
|
||||
|
||||
# Remove trailing comma and close JSON array
|
||||
sed -i '$ s/},/}/' $BUILD_OUTPUT_DIR/resume.json
|
||||
echo ']}' >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
add_close_section()
|
||||
|
||||
{
|
||||
|
||||
echo "}" >> $BUILD_OUTPUT_DIR/resume.json
|
||||
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
{
|
||||
|
||||
add_open_section
|
||||
add_meta_section
|
||||
add_basics_section
|
||||
add_profiles_section
|
||||
add_work_section
|
||||
add_volunteer_section
|
||||
add_education_section
|
||||
add_awards_section
|
||||
add_certificates_section
|
||||
add_publications_section
|
||||
add_skills_section
|
||||
add_languages_section
|
||||
add_interests_section
|
||||
add_references_section
|
||||
add_close_section
|
||||
|
||||
}
|
||||
|
||||
|
||||
main
|
164
build/build-pipeline-server-markdown.sh
Normal file
164
build/build-pipeline-server-markdown.sh
Normal file
@@ -0,0 +1,164 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
#####################################################################################################
|
||||
#Markdown to PDF/MSWord Resumek and candidate info sheet
|
||||
#####################################################################################################
|
||||
|
||||
#############################################
|
||||
# Create the candidate information PDF
|
||||
#############################################
|
||||
|
||||
# Expand variables into rendered YAML files. These will be used by pandoc to create the output artifacts
|
||||
|
||||
$MO_PATH $YamlInputTemplateFileJobBoard > $BUILDYAML_JOBBOARD
|
||||
$MO_PATH $YamlInputTemplateFileClientSubmission > $BUILDYAML_CLIENTSUBMISSION
|
||||
$MO_PATH $YamlInputTemplateFileClientSubmission > $BUILDYAML_CANDIDATEINFOSHEET
|
||||
|
||||
echo "Creating candidate info sheet..."
|
||||
|
||||
$MO_PATH $PipelineClientWorkingDir/Templates/MarkdownResume/CandidateInfoSheet/CandidateInfoSheet.md > "$CandidateInfoSheetMarkdownOutputFile"
|
||||
|
||||
pandoc \
|
||||
"$CandidateInfoSheetMarkdownOutputFile" \
|
||||
--template $PANDOC_TEMPLATE \
|
||||
--metadata-file="$BUILDYAML_CANDIDATEINFOSHEET" \
|
||||
--from markdown \
|
||||
--to=pdf \
|
||||
--output $CandidateInfoSheetPDFOutputFile
|
||||
|
||||
|
||||
|
||||
echo "Combining markdown files into single input file for pandoc..."
|
||||
|
||||
# Create contact info md file
|
||||
$MO_PATH "$PipelineClientWorkingDir/Templates/MarkdownResume/ContactInfo/ContactInfo-JobBoard.md" > "$BUILD_TEMP_DIR/ContactInfo-JobBoard.md"
|
||||
$MO_PATH "$PipelineClientWorkingDir/Templates/MarkdownResume/ContactInfo/ContactInfo-ClientSubmit.md" > "$BUILD_TEMP_DIR/ContactInfo-ClientSubmit.md"
|
||||
|
||||
#Pull in contact info
|
||||
cat "$BUILD_TEMP_DIR/ContactInfo-JobBoard.md" >> "$JobBoardMarkdownOutputFile"
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
|
||||
cat "$BUILD_TEMP_DIR/ContactInfo-ClientSubmit.md" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo " " >> "$ClientSubmissionMarkdownOutputFile"
|
||||
|
||||
echo "## Career Highlights" >> "$JobBoardMarkdownOutputFile"
|
||||
echo "## Career Highlights" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
|
||||
cat "$PipelineClientWorkingDir/Templates/MarkdownResume/SkillsAndProjects/Projects.md" >> "$JobBoardMarkdownOutputFile"
|
||||
echo "\pagebreak" >> "$JobBoardMarkdownOutputFile"
|
||||
|
||||
cat "$PipelineClientWorkingDir/Templates/MarkdownResume/SkillsAndProjects/Projects.md" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo "\pagebreak" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
echo "## Employment History" >> "$JobBoardMarkdownOutputFile"
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
|
||||
echo " " >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo "## Employment History" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo " " >> "$ClientSubmissionMarkdownOutputFile"
|
||||
|
||||
#And here we do some magic...
|
||||
#Pull in :
|
||||
|
||||
# employer
|
||||
# title
|
||||
# start/end dates of employment
|
||||
# long form position summary data from each position
|
||||
|
||||
IFS=$'\n\t'
|
||||
for position in \
|
||||
$(cat "$PipelineClientWorkingDir/Templates/MarkdownResume/WorkHistory/WorkHistory.csv"); do
|
||||
|
||||
COMPANY="$(echo $position|awk -F ',' '{print $1}')"
|
||||
TITLE="$(echo $position|awk -F ',' '{print $2}')"
|
||||
DATEOFEMPLOY="$(echo $position|awk -F ',' '{print $3}')"
|
||||
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
echo "**$COMPANY | $TITLE | $DATEOFEMPLOY**" >> "$JobBoardMarkdownOutputFile"
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
|
||||
echo "**$COMPANY | $TITLE | $DATEOFEMPLOY**" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo " " >> "$ClientSubmissionMarkdownOutputFile"
|
||||
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
cat "$PipelineClientWorkingDir/Templates/MarkdownResume/JobHistoryDetails/$COMPANY.md" >> "$JobBoardMarkdownOutputFile"
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
|
||||
cat "$PipelineClientWorkingDir/Templates/MarkdownResume/JobHistoryDetails/$COMPANY.md" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo " " >> "$ClientSubmissionMarkdownOutputFile"
|
||||
done
|
||||
|
||||
#Pull in my skills and generate a beautiful table.
|
||||
|
||||
echo "\pagebreak" >> "$JobBoardMarkdownOutputFile"
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
echo "## Skills" >> "$JobBoardMarkdownOutputFile"
|
||||
echo " " >> "$JobBoardMarkdownOutputFile"
|
||||
|
||||
echo "\pagebreak" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo " " >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo "## Skills" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo " " >> "$ClientSubmissionMarkdownOutputFile"
|
||||
|
||||
#Table heading
|
||||
echo "|Skill|Experience|Skill Details|" >> "$JobBoardMarkdownOutputFile"
|
||||
echo "|---|---|---|" >> "$JobBoardMarkdownOutputFile"
|
||||
|
||||
echo "|Skill|Experience|Skill Details|" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
echo "|---|---|---|" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
|
||||
#Table rows
|
||||
IFS=$'\n\t'
|
||||
for skill in \
|
||||
$(cat "$PipelineClientWorkingDir/Templates/MarkdownResume/SkillsAndProjects/Skills.csv"); do
|
||||
SKILL_NAME="$(echo $skill|awk -F '|' '{print $1}')"
|
||||
SKILL_YEARS="$(echo $skill|awk -F '|' '{print $2}')"
|
||||
SKILL_DETAIL="$(echo $skill|awk -F '|' '{print $3}')"
|
||||
echo "|**$SKILL_NAME**|$SKILL_YEARS|$SKILL_DETAIL|" >> "$JobBoardMarkdownOutputFile"
|
||||
echo "|**$SKILL_NAME**|$SKILL_YEARS|$SKILL_DETAIL|" >> "$ClientSubmissionMarkdownOutputFile"
|
||||
|
||||
done
|
||||
unset IFS
|
||||
|
||||
echo "Generating PDF output for job board version..."
|
||||
|
||||
pandoc \
|
||||
"$JobBoardMarkdownOutputFile" \
|
||||
--template $PANDOC_TEMPLATE \
|
||||
--metadata-file="$BUILDYAML_JOBBOARD" \
|
||||
--from markdown \
|
||||
--to=pdf \
|
||||
--output "$JobBoardPDFOutputFile"
|
||||
|
||||
echo "Generating PDF output for client submission version..."
|
||||
|
||||
pandoc \
|
||||
"$ClientSubmissionMarkdownOutputFile" \
|
||||
--template "$PANDOC_TEMPLATE" \
|
||||
--metadata-file="$BUILDYAML_CLIENTSUBMISSION" \
|
||||
--from markdown \
|
||||
--to=pdf \
|
||||
--output "$ClientSubmissionPDFOutputFile"
|
||||
|
||||
echo "Generating MSWord output for job board version..."
|
||||
|
||||
pandoc \
|
||||
"$JobBoardMarkdownOutputFile" \
|
||||
--metadata-file="$BUILDYAML_JOBBOARD" \
|
||||
--from markdown \
|
||||
--to=docx \
|
||||
--reference-doc="$WordOutputReferenceDoc" \
|
||||
--output "$JobBoardMSWordOutputFile"
|
||||
|
||||
echo "Generating MSWord output for client submission version..."
|
||||
|
||||
pandoc \
|
||||
"$ClientSubmissionMarkdownOutputFile" \
|
||||
--metadata-file="$BUILDYAML_CLIENTSUBMISSION" \
|
||||
--from markdown \
|
||||
--to=docx \
|
||||
--reference-doc="$WordOutputReferenceDoc" \
|
||||
--output "$ClientSubmissionMSWordOutputFile"
|
Reference in New Issue
Block a user