File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,5 +28,5 @@ unclassified:
2828security :
2929 scriptApproval :
3030 approvedScriptHashes :
31- - " SHA512:4221429e203439d7010910774f0ef107c56e054eb7001881a02852d108c03fb8d8470c15e2a6d27141b604075db9c09223a7e5c083478dcef770f84b733ceb2a "
31+ - " SHA512:eb6ddc115541e8f2c7d8459abbfc8dc262d6d6b711371a2764e05ce9492ca18c50002afe65635480dbc0509c0d8acaf8ba73d42450fe518816d3b45fd79d9088 "
3232 forceSandbox : false
Original file line number Diff line number Diff line change 11def String projectName = binding. variables[' PROJECT_NAME' ]
22def String gitUrl = binding. variables[' GIT_URL' ]
33def String gitBranch = binding. variables[' GIT_BRANCH' ]
4+ def String root_folder = binding. variables[' ROOT_FOLDER' ]
45def String credentialsId = binding. variables[' GIT_CREDENTIALS_ID' ]
56def File languageFile = new File (" ${ WORKSPACE} /repo/detected_language.txt" )
67def String language = languageFile. text. trim(). toLowerCase()
@@ -33,16 +34,14 @@ freeStyleJob("Projects/${projectName}") {
3334
3435 steps {
3536 shell(" echo Building ${ projectName} using ${ baseImage} " )
36- shell(" docker build -t ${ projectName} :${ language} --build-arg BASE_IMAGE=${ baseImage} ." )
3737 shell("""
38- #!/bin/bash
39- set -e
40- // if [ -f whanos.yml ]; then
41- // echo "Deploying ${ projectName} to Kubernetes..."
42- // kubectl apply -f whanos.yml
43- // else
44- // echo "No whanos.yml found, skipping deployment."
45- // fi
38+ cd /var/jenkins_home/workspace/Projects/${ projectName} /${ root_folder}
39+ if [ -f Dockerfile ]; then
40+ echo "Dockerfile found, building image..."
41+ docker build -t ${ projectName} --build-arg BASE_IMAGE=${ baseImage} .
42+ else
43+ docker build -t ${ projectName} -f /images/${ language} /Dockerfile.standalone .
44+ fi
4645 """ )
4746 }
4847}
You can’t perform that action at this time.
0 commit comments