From 0cbba87f923ca8879d6645630b756b91929990c4 Mon Sep 17 00:00:00 2001 From: Andriy Kyrylyuk Date: Mon, 14 Oct 2024 08:49:21 -0400 Subject: [PATCH 1/2] enable Jenkins piepline --- Jenkinsfile.bak | 94 ------------------------------------------------- 1 file changed, 94 deletions(-) delete mode 100755 Jenkinsfile.bak diff --git a/Jenkinsfile.bak b/Jenkinsfile.bak deleted file mode 100755 index d93e5ea3..00000000 --- a/Jenkinsfile.bak +++ /dev/null @@ -1,94 +0,0 @@ -properties([pipelineTriggers([githubPush()])]) - -pipeline { - options { - disableConcurrentBuilds() - buildDiscarder(logRotator(numToKeepStr: '10')) - timeout(time: 30, unit: 'MINUTES') - } - - agent { - kubernetes { - label 'worker-apibuilder-generator' - inheritFrom 'kaniko-slim' - } - } - - environment { - ORG = 'flowcommerce' - } - - stages { - stage('Checkout') { - steps { - checkoutWithTags scm - - script { - VERSION = new flowSemver().calculateSemver() //requires checkout - } - } - } - - stage('Commit SemVer tag') { - when { branch 'main' } - steps { - script { - new flowSemver().commitSemver(VERSION) - } - } - } - - stage('Build and push docker image release') { - when { branch 'main' } - steps { - container('kaniko') { - script { - semver = VERSION.printable() - - sh """ - /kaniko/executor -f `pwd`/Dockerfile -c `pwd` \ - --snapshot-mode=redo --use-new-run \ - --destination ${env.ORG}/apibuilder-generator:$semver - """ - - } - } - } - } - - stage('Display Helm Diff') { - when { - allOf { - not { branch 'main' } - changeRequest() - expression { - return changesCheck.hasChangesInDir('deploy') - } - } - } - steps { - script { - container('helm') { - new helmDiff().diff('apibuilder-generator') - } - } - } - } - - stage('Deploy Helm chart') { - when { branch 'main' } - parallel { - - stage('deploy apibuilder-generator') { - steps { - script { - container('helm') { - new helmCommonDeploy().deploy('apibuilder-generator', 'apicollective', VERSION.printable(), 420) - } - } - } - } - } - } - } -} From fe7df1478fe00f564926e63ea4e94f965e72f1de Mon Sep 17 00:00:00 2001 From: Andriy Kyrylyuk Date: Mon, 14 Oct 2024 09:00:05 -0400 Subject: [PATCH 2/2] enable Jenkins piepline --- Jenkinsfile | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100755 index 00000000..d93e5ea3 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,94 @@ +properties([pipelineTriggers([githubPush()])]) + +pipeline { + options { + disableConcurrentBuilds() + buildDiscarder(logRotator(numToKeepStr: '10')) + timeout(time: 30, unit: 'MINUTES') + } + + agent { + kubernetes { + label 'worker-apibuilder-generator' + inheritFrom 'kaniko-slim' + } + } + + environment { + ORG = 'flowcommerce' + } + + stages { + stage('Checkout') { + steps { + checkoutWithTags scm + + script { + VERSION = new flowSemver().calculateSemver() //requires checkout + } + } + } + + stage('Commit SemVer tag') { + when { branch 'main' } + steps { + script { + new flowSemver().commitSemver(VERSION) + } + } + } + + stage('Build and push docker image release') { + when { branch 'main' } + steps { + container('kaniko') { + script { + semver = VERSION.printable() + + sh """ + /kaniko/executor -f `pwd`/Dockerfile -c `pwd` \ + --snapshot-mode=redo --use-new-run \ + --destination ${env.ORG}/apibuilder-generator:$semver + """ + + } + } + } + } + + stage('Display Helm Diff') { + when { + allOf { + not { branch 'main' } + changeRequest() + expression { + return changesCheck.hasChangesInDir('deploy') + } + } + } + steps { + script { + container('helm') { + new helmDiff().diff('apibuilder-generator') + } + } + } + } + + stage('Deploy Helm chart') { + when { branch 'main' } + parallel { + + stage('deploy apibuilder-generator') { + steps { + script { + container('helm') { + new helmCommonDeploy().deploy('apibuilder-generator', 'apicollective', VERSION.printable(), 420) + } + } + } + } + } + } + } +}