Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/org/egov/jenkins/models/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ class BuildConfig {
return context
}

String getServiceCategoryName() {
String repo = null;
switch (this.context) {
case ~/.*core-services.*/:
repo = "CORE"
break;
case ~/.*municipal-services.*/:
repo = "MUNICIPAL"
break;
case ~/.*business-services.*/:
repo = "BUSINESS"
break;
case ~/.*frontend.*/:
repo = "FRONTEND"
break;
case ~/.*utilities.*/:
repo = "UTILITIES"
break;
default:
repo = "ALL-OTHERS"
}
return repo;
}


String getImageName() {
return imageName
Expand Down
22 changes: 19 additions & 3 deletions vars/buildPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ spec:
String GCR_REPO_NAME = "asia.gcr.io/digit-egov";
def yaml = readYaml file: pipelineParams.configFile;
List<JobConfig> jobConfigs = ConfigParser.parseConfig(yaml, env);
String serviceCategory = null;
String buildNum = null;

for(int i=0; i<jobConfigs.size(); i++){
JobConfig jobConfig = jobConfigs.get(i)
Expand Down Expand Up @@ -107,6 +109,8 @@ spec:

String workDir = buildConfig.getWorkDir().replaceFirst(getCommonBasePath(buildConfig.getWorkDir(), buildConfig.getDockerFile()), "./")
String image = "${REPO_NAME}/${buildConfig.getImageName()}:${env.BUILD_NUMBER}-${scmVars.BRANCH}-${scmVars.ACTUAL_COMMIT}";
serviceCategory = buildConfig.getServiceCategoryName(); // Dashboard
buildNum = image; // Dashboard
String noPushImage = env.NO_PUSH ? env.NO_PUSH : false;
echo "ALT_REPO_PUSH ENABLED: ${ALT_REPO_PUSH}"
if(env.ALT_REPO_PUSH.equalsIgnoreCase("true")){
Expand Down Expand Up @@ -140,14 +144,26 @@ spec:
--cache-repo=egovio/cache/cache
"""
echo "${image} pushed successfully!"
}
}
}
}
}
}
stage ("Update dashboard") {
wrappers {
environmentDashboard {
environmentName(scmVars.BRANCH)
componentName(serviceCategory)
buildNumber(buildNum)
//buildJob(String buildJob)
//packageName(String packageName)
//addColumns(true)
//Date now = new Date()
//columns(String Date, now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')))
}
}
}
}


}
}

Expand Down