1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- @Library('jenkins-library@master') _
- def Label = "promo-build-${UUID.randomUUID().toString()}"
- pipeline {
- options {
- buildDiscarder logRotator(numToKeepStr: '10')
- disableConcurrentBuilds()
- }
- agent {
- kubernetes {
- label Label
- yaml libraryResource('promoPodDefinition.yaml')
- }
- }
- environment {
- CLOUD='cloud-it-k8s'
- DOCKER_IMAGE='iru/promo'
- CHART_PATH='helm/info'
- NAMESPACE='info'
- HELM_GIT_URL='ssh://git@git.sdsys.ru:8022/iru/k8s.git'
- APP_GIT_URL='ssh://gitolite@git.alfatell.ru:2223/web-registration-cloud.git'
- JENKINS_MAIL='jenkins.dev@sdsys.ru'
- DOCKER_REGISTRY='jcr.infoclinica.ru'
- CHART_NAME=''
- APP_DIR=''
- HELM_DIR=''
- TAG=''
- }
- parameters {
- string(
- name: "branch",
- defaultValue: "release",
- description: "Which branch to use"
- )
- string(
- name: "mailto",
- defaultValue: "admin@sdsys.ru",
- description: "Email which has to be notified."
- )
- }
- stages
- stage("Prepare to build") {
- steps
- script
- echo
- gitOps.clone(APP_GIT_URL)
- APP_DIR
- echo
- gitOps.checkout(APP_DIR, branch)
- echo
- dir(APP_DIR)
- sh
- }
- }
- }
- }
- stage("Build APP") {
- steps
- script
- echo
- dir("${APP_DIR}/customer-api") {
- buildOps.maven()
- }
- echo
- dir("${APP_DIR}/promo") {
- buildOps.gradle()
- }
- }
- }
- }
- stage("Build Image") {
- steps
- script
- sh
- sh
- REGISTRY
- COMMIT
- TAG
- echo
- echo
- echo
- k8sBuildImage.kaniko(REGISTRY, TAG)
- }
- }
- }
- }
- }
|