Loading ci_cd/lab3.yml +11 −13 Original line number Diff line number Diff line Loading @@ -5,26 +5,24 @@ prebuild_lab_3: - echo "Changes Detected (if any):"; - git diff --name-only $CI_COMMIT_SHA~ $CI_COMMIT_SHA || echo "No changes found"; - | # Check if lab3.cpp exists if [ ! -f "lab3.cpp" ]; then echo "lab3.cpp does not exist"; # Check that only one file was checked in - FILE_COUNT=$(git diff --name-only HEAD~1 | wc -l) if [ "$FILE_COUNT" -ne 1 ]; then echo "Error: Only one file should be committed."; exit 1; fi # Check if lab0.cpp has been merged into master git fetch origin master # Fetch the latest master branch if git ls-tree -r origin/master --name-only | grep -q 'lab0.cpp'; then echo "Lab 0 complete"; else echo "Please have lab 0 merged first"; # Check if lab3.cpp exists if [ ! -f "lab3.cpp" ]; then echo "lab3.cpp does not exist"; exit 1; fi # Check if lab1.cpp has been merged into master if git ls-tree -r origin/master --name-only | grep -q 'lab1.cpp'; then echo "Lab 1 complete"; # Check if lab2.cpp has been merged into master if git ls-tree -r origin/master --name-only | grep -q 'lab2.cpp'; then echo "Lab 2 complete"; else echo "Please have lab 1 merged first"; echo "Please have lab 2 merged first"; exit 1; fi - git clone https://agile.bu.edu/gitlab/configs/ec327/lab-configs/current.git base_3 Loading Loading
ci_cd/lab3.yml +11 −13 Original line number Diff line number Diff line Loading @@ -5,26 +5,24 @@ prebuild_lab_3: - echo "Changes Detected (if any):"; - git diff --name-only $CI_COMMIT_SHA~ $CI_COMMIT_SHA || echo "No changes found"; - | # Check if lab3.cpp exists if [ ! -f "lab3.cpp" ]; then echo "lab3.cpp does not exist"; # Check that only one file was checked in - FILE_COUNT=$(git diff --name-only HEAD~1 | wc -l) if [ "$FILE_COUNT" -ne 1 ]; then echo "Error: Only one file should be committed."; exit 1; fi # Check if lab0.cpp has been merged into master git fetch origin master # Fetch the latest master branch if git ls-tree -r origin/master --name-only | grep -q 'lab0.cpp'; then echo "Lab 0 complete"; else echo "Please have lab 0 merged first"; # Check if lab3.cpp exists if [ ! -f "lab3.cpp" ]; then echo "lab3.cpp does not exist"; exit 1; fi # Check if lab1.cpp has been merged into master if git ls-tree -r origin/master --name-only | grep -q 'lab1.cpp'; then echo "Lab 1 complete"; # Check if lab2.cpp has been merged into master if git ls-tree -r origin/master --name-only | grep -q 'lab2.cpp'; then echo "Lab 2 complete"; else echo "Please have lab 1 merged first"; echo "Please have lab 2 merged first"; exit 1; fi - git clone https://agile.bu.edu/gitlab/configs/ec327/lab-configs/current.git base_3 Loading