Commit 13cc6eea authored by RamaRao's avatar RamaRao

second commit

parent 821eab95
import javaposse.jobdsl.dsl.jobs.MultiJob
multiJob('PEM-Pricegroup-Ui-GitHub-Pull-Request-Builder') {
concurrentBuild()
environmentVariables {
env('APP_GIT_URL', 'https://github.gapinc.com/plan/pem-price-groups-ui')
}
properties {
githubProjectUrl('https://github.gapinc.com/plan/pem-price-groups-ui')
rebuild {
autoRebuild(false)
rebuildDisabled(false)
}
}
logRotator {
numToKeep(7)
}
authorization {
permission('hudson.model.Item.Build', 'PEM-FEDCI-PIPELINE-DEVTEAM')
permission('hudson.model.Item.Cancel', 'PEM-FEDCI-PIPELINE-DEVTEAM')
}
scm {
git {
remote {
url('https://github.gapinc.com/plan/pem-price-groups-ui')
credentials('github_credential')
name('origin')
refspec('+refs/pull/*:refs/remotes/origin/pr/* +refs/heads/master:refs/remotes/origin/master')
}
branch('${sha1}')
}
}
steps{
phase('Pull_Request') {
phaseJob('pem-pricegroup-ui-pr-build'){
parameters {
predefinedProp('REVISION', '$ghprbActualCommit')
}
killPhaseCondition('UNSTABLE')
abortAllJobs()
currentJobParameters()
}
}
}
triggers {
githubPullRequest {
permitAll(true)
cron('* * * * *')
}
}
//This configure block is used to set the gitHubAuthId field which is not made available through the basic DSL
configure {
project ->
(project / triggers / 'org.jenkinsci.plugins.ghprb.GhprbTrigger' / gitHubAuthId).value = 'pr_auth_id'
}
}
job('pem-pricegroup-ui-build') {
wrappers {
credentialsBinding {
usernamePassword('GITHUB_USER', 'GITHUB_TOKEN', 'pem-github-token')
usernamePassword('ARTIFACTORY_USER', 'ARTIFACTORY_KEY', 'github_credential')
}
}
authorization {
permission('hudson.model.Item.Build', 'PEM-FEDCI-PIPELINE-DEVTEAM')
permission('hudson.model.Item.Configure', 'PEM-FEDCI-PIPELINE-DEVTEAM')
}
logRotator {
numToKeep(7)
}
label('pipes-docker-agent')
environmentVariables {
env('APP_GIT_URL', 'https://github.gapinc.com/plan/pem-price-groups-ui')
}
scm {
git {
remote {
url('${APP_GIT_URL}.git')
credentials('github_credential')
}
branch("master")
}
}
steps {
gradle {
useWrapper(true)
makeExecutable(true)
tasks('clean yarn_install build test artifactoryPublish -Dspring.profiles.active=prod')
switches('-g . --no-daemon')
fromRootBuildScriptDir(true)
}
}
triggers {
scm('* * * * *') {
ignorePostCommitHooks()
}
}
publishers {
wrappers {
colorizeOutput()
}
}
}
listView('pem-pricegroup-ui') {
columns {
status()
weather()
name()
lastSuccess()
lastFailure()
lastDuration()
buildButton()
}
jobs {
name('pem-pricegroup-ui-build')
name('pem-pricegroup-ui-pr-build')
name('PEM-Pricegroup-Ui-GitHub-Pull-Request-Builder')
name('pem-vmware-pricegroup-ui-deploy-to-environment')
name('pem-pricegroup-ui-prod-migrate-artifact')
name('pem-vmware-pricegroup-ui-deploy-to-production')
name('pem-pricegroup-ui-deploy-to-azure-environment')
}
}
\ No newline at end of file
job('pem-pricegroup-ui-pr-build') {
concurrentBuild()
//customWorkspace('$JOB_NAME/$BUILD_NUMBER/workspace')
environmentVariables {
env('APP_GIT_URL', 'https://github.gapinc.com/plan/pem-price-groups-ui')
}
wrappers {
credentialsBinding {
usernamePassword('GITHUB_USER', 'GITHUB_TOKEN', 'pem-github-token')
usernamePassword('ARTIFACTORY_USER', 'ARTIFACTORY_KEY', 'github_credential')
}
}
logRotator {
numToKeep(7)
}
label('pipes-docker-agent')
environmentVariables {
env('APP_GIT_URL', 'https://github.gapinc.com/plan/pem-price-groups-ui')
}
scm {
git {
remote {
url('https://github.gapinc.com/plan/pem-price-groups-ui')
credentials('github_credential')
name('origin')
refspec('+refs/pull/*:refs/remotes/origin/pr/*')
}
branch('${REVISION}')
}
}
steps {
gradle {
useWrapper(true)
makeExecutable(true)
tasks('clean yarn_install build test')
switches('-g . --no-daemon')
fromRootBuildScriptDir(true)
}
}
publishers {
wrappers {
colorizeOutput()
}
}
}
job ('pem-vmware-pricegroup-ui-deploy-to-environment') {
wrappers {
credentialsBinding {
usernamePassword('GITHUB_USER', 'GITHUB_TOKEN', 'pem-github-token')
usernamePassword('CLOUD_FOUNDRY_USERNAME', 'CLOUD_FOUNDRY_PASSWORD', 'cloudfoundry_credential_pemtransformer')
}
}
logRotator {
numToKeep(7)
}
authorization {
permission('hudson.model.Item.Build', 'PEM-FEDCI-PIPELINE-DEVTEAM')
}
parameters {
stringParam('ARTIFACT_VERSION', '40', 'Artifact version number to deploy')
choiceParam('TARGET_ENVIRONMENT', ['qa', 'showcase', 'training', 'e2e', 'pilot', 'performance'], 'Deploy to TDEV PCF Space')
choiceParam('APP_MEMORY', ['1024' ,'2048'], 'Select the Amount of Memory Needed for your Application')
choiceParam('INSTANCE_COUNT', ['1' ,'2'], 'Select the Number of Instances Needed for your Application')
}
environmentVariables {
env('PCF_DEPLOY_GRADLE_URL', 'https://github.gapinc.com/plan/pem-gradle-allprojects-pcf-deploy')
env('ARTIFACTORY_URL', 'http://artifactory.gapinc.dev/artifactory/local-non-prod')
env('jarNameSwitch', '-Pjar_file=pem-pricegroup-ui-\${ARTIFACT_VERSION}.jar' )
env('org_name', 'PT-PriceServices')
env('pcf_api', 'https://api.sys.cfplatform.dev.phx.gaptech.com')
env('preprodConfigUri', 'https://pem-vmware-spring-cloud-config-server.apps.cfplatform.dev.phx.gaptech.com/')
}
scm {
git {
remote {
url('${PCF_DEPLOY_GRADLE_URL}.git')
credentials('github_credential')
}
branch("master")
}
}
properties {
}
steps {
shell('wget -q \${ARTIFACTORY_URL}/com/gap/pem/pem-pricegroup-ui/${ARTIFACT_VERSION}/pem-pricegroup-ui-\${ARTIFACT_VERSION}.jar')
gradle {
useWrapper(true)
makeExecutable(true)
tasks('cfRename')
switches('-g . -Papp_name=pem-pricegroup-ui -Papp_memory=${APP_MEMORY} -Ptarget_env=${TARGET_ENVIRONMENT} -Ppcf_api=${pcf_api} -Porg_name=${org_name}')
}
gradle {
useWrapper(true)
makeExecutable(true)
tasks('cfDeploy')
fromRootBuildScriptDir(true)
switches('-g . -Papp_name=pem-pricegroup-ui -Papp_memory=${APP_MEMORY} -Ptarget_env=${TARGET_ENVIRONMENT} -Pjar_file=pem-pricegroup-ui-\${ARTIFACT_VERSION}.jar -Pcloud_config_uri=${preprodConfigUri} -Ppcf_api=${pcf_api} -Porg_name=${org_name} --info')
}
gradle {
useWrapper(true)
makeExecutable(true)
tasks('cfHealth')
fromRootBuildScriptDir(true)
switches('-g . -Papp_name=pem-pricegroup-ui -Papp_memory=${APP_MEMORY} -Ptarget_env=${TARGET_ENVIRONMENT} -Ppcf_api=${pcf_api} -Porg_name=${org_name}')
}
gradle {
useWrapper(true)
makeExecutable(true)
tasks('cfSwapDeployed')
fromRootBuildScriptDir(true)
switches('-g . -Papp_name=pem-pricegroup-ui -Papp_memory=${APP_MEMORY} -Ptarget_env=${TARGET_ENVIRONMENT} -Ppcf_api=${pcf_api} -Porg_name=${org_name}')
}
gradle {
useWrapper(true)
makeExecutable(true)
tasks('cfUndeploy')
switches('-g . -Papp_name=pem-pricegroup-ui -Papp_memory=${APP_MEMORY} -Ptarget_env=${TARGET_ENVIRONMENT} -Ppcf_api=${pcf_api} -Porg_name=${org_name}')
}
shell('rm -rf pem-pricegroup-ui-\${ARTIFACT_VERSION}.jar')
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment