-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3d4819
commit 5538d0a
Showing
23 changed files
with
1,127 additions
and
29 deletions.
There are no files selected for viewing
127 changes: 127 additions & 0 deletions
127
.jenkins/docker/contrib/jenkins/configuration/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<hudson> | ||
<disabledAdministrativeMonitors> | ||
<string>GitHubHookRegisterProblemMonitor</string> | ||
<string>jenkins.security.QueueItemAuthenticatorMonitor</string> | ||
</disabledAdministrativeMonitors> | ||
<version>2.176.1</version> | ||
<installStateName>RUNNING</installStateName> | ||
<numExecutors>0</numExecutors> | ||
<mode>EXCLUSIVE</mode> | ||
<useSecurity>true</useSecurity> | ||
<authorizationStrategy class="hudson.security.GlobalMatrixAuthorizationStrategy"> | ||
<permission>com.cloudbees.plugins.credentials.CredentialsProvider.Create:kuanfandevops-admin-edit-view</permission> | ||
<permission>com.cloudbees.plugins.credentials.CredentialsProvider.Delete:kuanfandevops-admin-edit-view</permission> | ||
<permission>com.cloudbees.plugins.credentials.CredentialsProvider.ManageDomains:kuanfandevops-admin-edit-view</permission> | ||
<permission>com.cloudbees.plugins.credentials.CredentialsProvider.Update:kuanfandevops-admin-edit-view</permission> | ||
<permission>com.cloudbees.plugins.credentials.CredentialsProvider.View:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Computer.Configure:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Computer.Connect:jenkins-slave</permission> | ||
<permission>hudson.model.Computer.Create:jenkins-slave</permission> | ||
<permission>hudson.model.Computer.Delete:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Hudson.Administer:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Hudson.Read:jenkins-slave</permission> | ||
<permission>hudson.model.Hudson.Read:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Hudson.RunScripts:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Item.Build:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Item.Cancel:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Item.Configure:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Item.Create:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Item.Delete:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Item.Discover:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Item.Read:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Item.Workspace:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Run.Delete:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.Run.Update:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.View.Configure:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.View.Create:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.model.View.Delete:kuanfandevops-admin-edit-view</permission> | ||
<permission>hudson.scm.SCM.Tag:kuanfandevops-admin-edit-view</permission> | ||
</authorizationStrategy> | ||
<securityRealm class="org.openshift.jenkins.plugins.openshiftlogin.OpenShiftOAuth2SecurityRealm" plugin="[email protected]"> | ||
<defaultedServiceAccountDirectory>/run/secrets/kubernetes.io/serviceaccount</defaultedServiceAccountDirectory> | ||
<defaultedServiceAccountName>jenkins-prod</defaultedServiceAccountName> | ||
<defaultedServerPrefix>https://openshift.default.svc</defaultedServerPrefix> | ||
<defaultedRedirectURL>https://console.pathfinder.gov.bc.ca:8443</defaultedRedirectURL> | ||
<defaultedClientId>system:serviceaccount:tbiwaq-tools:jenkins-prod</defaultedClientId> | ||
<defaultedClientSecret>eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJ0Yml3YXEtdG9vbHMiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlY3JldC5uYW1lIjoiamVua2lucy1wcm9kLXRva2VuLWhteHo5Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImplbmtpbnMtcHJvZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjEyZDJlYWNlLTJjMTItMTFlYS1hZGNkLTAwNTA1NjgzNDhjYyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDp0Yml3YXEtdG9vbHM6amVua2lucy1wcm9kIn0.PJ7GysGdZdy3uPSLUmFRLUHZHpkocbPV08aXGeeIW5zWWlbwlWMHeTyiF3Tqo4ToYMhcXmqhFukEr6NNRtgxrVUsHuOx4i7OH8UFrW1TeXYgPBBUpfwXhOoIhhTA2Jl5lbWVvsPNNoB_f-SFe3cqcNC0sIctb2EwIl6CBV8JksjfWtxSXzJGkdBYFf9mvBftCq7QlEYVoMWBJ_goOd-j3ITHyo5klVFdmLN4i7GphWPcoFMEsxxEGhbvbG3NNiwA0J_43Ueo6po7V-UH9HNTuD38coqWJbK3PXsr9IUrlncVqj3pbWi3P9Ir_CInjInALpCQPiOupBZ7w2BfgiHdAA</defaultedClientSecret> | ||
<namespace>tbiwaq-tools</namespace> | ||
<provider> | ||
<issuer>https://console.pathfinder.gov.bc.ca:8443</issuer> | ||
<authorization__endpoint>https://console.pathfinder.gov.bc.ca:8443/oauth/authorize</authorization__endpoint> | ||
<token__endpoint>https://console.pathfinder.gov.bc.ca:8443/oauth/token</token__endpoint> | ||
</provider> | ||
<filter/> | ||
</securityRealm> | ||
<disableRememberMe>true</disableRememberMe> | ||
<projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/> | ||
<workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}</workspaceDir> | ||
<buildsDir>${JENKINS_HOME}/builds/${ITEM_FULL_NAME}</buildsDir> | ||
<markupFormatter class="hudson.markup.EscapedMarkupFormatter"/> | ||
<jdks/> | ||
<viewsTabBar class="hudson.views.DefaultViewsTabBar"/> | ||
<myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/> | ||
<clouds> | ||
<org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud plugin="[email protected]"> | ||
<name>openshift</name> | ||
<defaultsProviderTemplate></defaultsProviderTemplate> | ||
<templates/> | ||
<serverUrl></serverUrl> | ||
<skipTlsVerify>false</skipTlsVerify> | ||
<addMasterProxyEnvVars>false</addMasterProxyEnvVars> | ||
<capOnlyOnAlivePods>false</capOnlyOnAlivePods> | ||
<containerCap>10</containerCap> | ||
<retentionTimeout>5</retentionTimeout> | ||
<connectTimeout>5</connectTimeout> | ||
<readTimeout>15</readTimeout> | ||
<usageRestricted>false</usageRestricted> | ||
<maxRequestsPerHost>32</maxRequestsPerHost> | ||
<waitForPodSec>600</waitForPodSec> | ||
<podRetention class="org.csanchez.jenkins.plugins.kubernetes.pod.retention.Never"/> | ||
</org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud> | ||
<org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud plugin="[email protected]"> | ||
<name>openshift</name> | ||
<defaultsProviderTemplate></defaultsProviderTemplate> | ||
<templates/> | ||
<serverUrl></serverUrl> | ||
<skipTlsVerify>false</skipTlsVerify> | ||
<addMasterProxyEnvVars>false</addMasterProxyEnvVars> | ||
<capOnlyOnAlivePods>false</capOnlyOnAlivePods> | ||
<jenkinsUrl>http://jenkins-prod.tbiwaq-tools.svc:8080</jenkinsUrl> | ||
<jenkinsTunnel>jenkins-prod.tbiwaq-tools.svc:50000</jenkinsTunnel> | ||
<containerCap>10</containerCap> | ||
<retentionTimeout>5</retentionTimeout> | ||
<connectTimeout>5</connectTimeout> | ||
<readTimeout>15</readTimeout> | ||
<usageRestricted>false</usageRestricted> | ||
<maxRequestsPerHost>32</maxRequestsPerHost> | ||
<waitForPodSec>600</waitForPodSec> | ||
<podRetention class="org.csanchez.jenkins.plugins.kubernetes.pod.retention.Never"/> | ||
</org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud> | ||
</clouds> | ||
<quietPeriod>5</quietPeriod> | ||
<scmCheckoutRetryCount>0</scmCheckoutRetryCount> | ||
<views> | ||
<hudson.model.AllView> | ||
<owner class="hudson" reference="../../.."/> | ||
<name>all</name> | ||
<filterExecutors>false</filterExecutors> | ||
<filterQueue>false</filterQueue> | ||
<properties class="hudson.model.View$PropertyList"/> | ||
</hudson.model.AllView> | ||
</views> | ||
<primaryView>all</primaryView> | ||
<slaveAgentPort>50000</slaveAgentPort> | ||
<disabledAgentProtocols> | ||
<string>JNLP-connect</string> | ||
<string>JNLP2-connect</string> | ||
<string>JNLP3-connect</string> | ||
</disabledAgentProtocols> | ||
<label></label> | ||
<crumbIssuer class="hudson.security.csrf.DefaultCrumbIssuer"> | ||
<excludeClientIPFromCrumb>true</excludeClientIPFromCrumb> | ||
</crumbIssuer> | ||
<nodeProperties/> | ||
<globalNodeProperties/> | ||
<noUsageStatistics>true</noUsageStatistics> | ||
</hudson> |
22 changes: 22 additions & 0 deletions
22
.jenkins/docker/contrib/jenkins/configuration/jobs/zeva-release-pipelines/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<com.cloudbees.hudson.plugins.folder.Folder plugin="[email protected]"> | ||
<properties/> | ||
<folderViews class="com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder"> | ||
<views> | ||
<hudson.model.AllView> | ||
<owner class="com.cloudbees.hudson.plugins.folder.Folder" reference="../../../.."/> | ||
<name>All</name> | ||
<filterExecutors>false</filterExecutors> | ||
<filterQueue>false</filterQueue> | ||
<properties class="hudson.model.View$PropertyList"/> | ||
</hudson.model.AllView> | ||
</views> | ||
<tabBar class="hudson.views.DefaultViewsTabBar"/> | ||
</folderViews> | ||
<healthMetrics> | ||
<com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric> | ||
<nonRecursive>false</nonRecursive> | ||
</com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric> | ||
</healthMetrics> | ||
<icon class="com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon"/> | ||
</com.cloudbees.hudson.plugins.folder.Folder> |
36 changes: 36 additions & 0 deletions
36
...ontrib/jenkins/configuration/jobs/zeva-release-pipelines/jobs/develop-pipeline/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<flow-definition plugin="[email protected]"> | ||
<actions/> | ||
<description></description> | ||
<keepDependencies>false</keepDependencies> | ||
<properties> | ||
<hudson.plugins.jira.JiraProjectProperty plugin="[email protected]"/> | ||
<com.sonyericsson.rebuild.RebuildSettings plugin="[email protected]"> | ||
<autoRebuild>false</autoRebuild> | ||
<rebuildDisabled>false</rebuildDisabled> | ||
</com.sonyericsson.rebuild.RebuildSettings> | ||
</properties> | ||
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="[email protected]"> | ||
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]"> | ||
<configVersion>2</configVersion> | ||
<userRemoteConfigs> | ||
<hudson.plugins.git.UserRemoteConfig> | ||
<url>https://github.com/bcgov/zeva.git</url> | ||
<credentialsId>github-account</credentialsId> | ||
</hudson.plugins.git.UserRemoteConfig> | ||
</userRemoteConfigs> | ||
<branches> | ||
<hudson.plugins.git.BranchSpec> | ||
<name>release-pipeline</name> | ||
</hudson.plugins.git.BranchSpec> | ||
</branches> | ||
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> | ||
<submoduleCfg class="list"/> | ||
<extensions/> | ||
</scm> | ||
<scriptPath>openshift/pipelines/Jenkinsfile-develop</scriptPath> | ||
<lightweight>false</lightweight> | ||
</definition> | ||
<triggers/> | ||
<disabled>false</disabled> | ||
</flow-definition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
result = 0 | ||
runParallel = true | ||
zevaRelease="release-pipeline" | ||
|
||
podTemplate(label: "develop-maven-${env.BUILD_NUMBER}", name: "develop-maven-${env.BUILD_NUMBER}", serviceAccount: 'jenkins-prod', cloud: 'openshift', | ||
containers: [ | ||
containerTemplate( | ||
name: 'jnlp', | ||
image: 'registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7:v3.9', | ||
resourceRequestCpu: '500m', | ||
resourceLimitCpu: '1000m', | ||
resourceRequestMemory: '2Gi', | ||
resourceLimitMemory: '4Gi', | ||
workingDir: '/home/jenkins', | ||
activeDeadlineSeconds: 600, | ||
slaveConnectTimeout: 600, | ||
command: '', | ||
args: '${computer.jnlpmac} ${computer.name}' | ||
|
||
) | ||
] | ||
) { | ||
|
||
node("develop-maven-${env.BUILD_NUMBER}") { | ||
//checkout code | ||
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: "${zevaRelease}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'github-account', url: 'https://github.com/bcgov/zeva.git']]] | ||
|
||
//load groovy scripts | ||
def prepareBuilds = load "openshift/pipelines/scripts/prepareBuilds.groovy" | ||
|
||
buildStages = prepareBuilds.buildStages('dev',zevaRelease) | ||
|
||
for (builds in buildStages) { | ||
if (runParallel) { | ||
parallel(builds) | ||
} else { | ||
// run serially (nb. Map is unordered! ) | ||
for (build in builds.values()) { | ||
build.call() | ||
} | ||
} | ||
} | ||
|
||
//load deployment scripts | ||
def prepareDeployments = load "openshift/pipelines/scripts/prepareDeployments.groovy" | ||
|
||
//apply deployment config | ||
prepareDeployments.frontendDeployStage("dev").call() | ||
|
||
//refresh the dev tag to deploy on dev | ||
openshift.withProject("tbiwaq-dev") { | ||
openshift.tag("tbiwaq-tools/frontend:${zevaRelease}", 'tbiwaq-dev/frontend:dev') | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
def buildStages(String envName, String zevaRelease) { | ||
def buildList = [] | ||
def buildStages = [:] | ||
buildStages.put('Build Frontend', prepareBuildFrontend(envName, zevaRelease)) | ||
buildList.add(buildStages) | ||
return buildList | ||
} | ||
|
||
def prepareBuildFrontend(String envName, String zevaRelease) { | ||
return { | ||
stage('Build-Frontend') { | ||
timeout(30) { | ||
script { | ||
openshift.withProject("tbiwaq-tools") { | ||
def frontendyaml = openshift.process(readFile(file:'openshift/templates/frontend/frontend-bc-release.yaml'), '-p', 'GIT_URL=https://github.com/bcgov/zeva.git', "GIT_REF=${zevaRelease}") | ||
openshift.apply(frontendyaml) | ||
def frontendBuildSelector = openshift.selector("bc", "frontend") | ||
frontendBuildSelector.startBuild("--wait") | ||
} | ||
} //end of script | ||
} //end of timeout | ||
} | ||
} | ||
} | ||
|
||
return this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
def frontendDeployStage (String envName) { | ||
return { | ||
stage("Apply Frontend Deployment Config on ${envName}") { | ||
timeout(30) { | ||
script { | ||
def projectName | ||
def ENV_NAME | ||
def DASH_ENV_NAME | ||
def CPU_REQUEST | ||
def CPU_LIMIT | ||
def MEMORY_REQUEST | ||
def MEMORY_LIMIT | ||
if(envName == 'dev') { | ||
projectName = 'tbiwaq-dev' | ||
ENV_NAME = 'dev' | ||
DASH_ENV_NAME = '-dev' | ||
CPU_REQUEST='100m' | ||
CPU_LIMIT='400m' | ||
MEMORY_REQUEST='128Mi' | ||
MEMORY_LIMIT='256Mi' | ||
} | ||
openshift.withProject("${projectName}") { | ||
def frontendDCYaml = openshift.process(readFile(file:'openshift/templates/frontend/frontend-dc-release.yaml'), | ||
"-p", | ||
"ENV_NAME=${ENV_NAME}", | ||
"DASH_ENV_NAME=${DASH_ENV_NAME}", | ||
"CPU_REQUEST=${CPU_REQUEST}", | ||
"CPU_LIMIT=${CPU_LIMIT}", | ||
"MEMORY_REQUEST=${MEMORY_REQUEST}", | ||
"MEMORY_LIMIT=${MEMORY_LIMIT}" | ||
) | ||
openshift.apply(frontendDCYaml) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
return this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
apiVersion: template.openshift.io/v1 | ||
kind: Template | ||
metadata: | ||
creationTimestamp: null | ||
name: backend | ||
parameters: | ||
- name: GIT_URL | ||
displayName: | ||
description: zeva repo | ||
required: true | ||
- name: GIT_REF | ||
displayName: | ||
description: zeva release name | ||
required: true | ||
objects: | ||
- apiVersion: image.openshift.io/v1 | ||
kind: ImageStream | ||
metadata: | ||
annotations: | ||
description: Keeps track of changes in the backend image | ||
creationTimestamp: null | ||
name: backend | ||
spec: | ||
lookupPolicy: | ||
local: false | ||
status: | ||
dockerImageRepository: "" | ||
- apiVersion: build.openshift.io/v1 | ||
kind: BuildConfig | ||
metadata: | ||
annotations: | ||
description: Defines how to build the application | ||
creationTimestamp: null | ||
name: backend | ||
spec: | ||
nodeSelector: null | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: backend:${GIT_REF} | ||
postCommit: {} | ||
resources: | ||
limits: | ||
cpu: 2000m | ||
memory: 2G | ||
requests: | ||
cpu: 500m | ||
memory: 200M | ||
runPolicy: SerialLatestOnly | ||
source: | ||
contextDir: backend | ||
git: | ||
ref: ${GIT_REF} | ||
uri: ${GIT_URL} | ||
type: Git | ||
strategy: | ||
sourceStrategy: | ||
env: | ||
- name: PIP_INDEX_URL | ||
from: | ||
kind: ImageStreamTag | ||
name: python:3.6 | ||
namespace: openshift | ||
type: Source | ||
triggers: | ||
- imageChange: {} | ||
type: ImageChange | ||
- type: ConfigChange | ||
status: | ||
lastVersion: 0 |
Oops, something went wrong.