Skip to content

Commit

Permalink
validate command now works, but leaves runner running
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlord committed Nov 16, 2023
1 parent 645b900 commit 46d0f2a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions prod-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ function assertSuccess {
fi
}

$nErrors = 0
nErrors=0
function flagErrors {
if [[ $? -ne 0 ]] ; then
echo -e "${RED}FAILED${ENDCOLOR}"
$nErrors++
((nErrors++))
fi
}

Expand Down Expand Up @@ -63,26 +63,33 @@ function validate {

echo "Checking for duplicate descriptions in scripts..."
cd scripts ; assertSuccess
.github/findDuplicateDescriptions.sh ; flagErrors
../.server/.github/findDuplicateDescriptions.sh ; flagErrors
cd ..

echo "Validating script metadata against schema..."
docker run --rm --name biab-yaml-validator -v $(pwd)/scripts:"/scripts" \
-v $(pwd)/../.server/.github/:"/.github" \
-v $(pwd)/.server/.github/:"/.github" \
navikt/yaml-validator:v4 \
".github/scriptValidationSchema.yml" "scripts/" "no" ".yml"
flagErrors

echo "Checking for duplicate descriptions in pipelines..."
cd pipelines ; assertSuccess
.github/findDuplicateIds.sh ; flagErrors
../.server/.github/findDuplicateIds.sh ; flagErrors
cd ..

echo "Validating pipeline structure"
./prod-server.sh run script-server \
# TODO The run command on script-server starts the runners because of depends-on relationship.
# We want to know if the server is up in order to keep or bring them down afterwards.
#docker ps | grep runner-
#shouldStop=$? -eq 0
#echo "should stop=$shouldStop"

command run script-server \
java -cp biab-script-server.jar org.geobon.pipeline.Validator
flagErrors

# Final assesment
if [[ $nErrors -eq 0 ]] ; then
echo -e "${GREEN}Validation complete.${ENDCOLOR}"
else
Expand Down

0 comments on commit 46d0f2a

Please sign in to comment.