Bugfix intenum
Fix creds attempt documented workaround Set system prop Use privileged container to work around Jenkins bug Remove property set
This commit is contained in:
parent
11a4ff35fc
commit
f3bc97206a
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@ -1,4 +1,4 @@
|
|||||||
library('pipeline-library')
|
library('pipeline-library@bugfix/durable-task-workaround')
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
options { timestamps() }
|
options { timestamps() }
|
||||||
@ -18,7 +18,7 @@ pipeline {
|
|||||||
stage('Self Version') {
|
stage('Self Version') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(credentialsId: env.DOCKER_CREDENTIALS, usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
|
withCredentials([usernamePassword(credentialsId: env.DOCKER_CREDENTIALS, usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
|
||||||
sh("docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}")
|
sh("docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD")
|
||||||
}
|
}
|
||||||
runAutoSemver("rightbrainnetworks/auto-semver:${SELF_SEMVER_TAG}")
|
runAutoSemver("rightbrainnetworks/auto-semver:${SELF_SEMVER_TAG}")
|
||||||
}
|
}
|
||||||
@ -59,6 +59,7 @@ pipeline {
|
|||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image "rightbrainnetworks/auto-semver:${env.VERSION}"
|
image "rightbrainnetworks/auto-semver:${env.VERSION}"
|
||||||
|
args "--privileged"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps
|
steps
|
||||||
@ -85,7 +86,7 @@ pipeline {
|
|||||||
// Authenticate & push to DockerHub
|
// Authenticate & push to DockerHub
|
||||||
withCredentials([usernamePassword(credentialsId: env.DOCKER_CREDENTIALS, usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
|
withCredentials([usernamePassword(credentialsId: env.DOCKER_CREDENTIALS, usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
|
||||||
sh("""
|
sh("""
|
||||||
docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
|
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
||||||
docker push rightbrainnetworks/auto-semver:${env.VERSION}
|
docker push rightbrainnetworks/auto-semver:${env.VERSION}
|
||||||
""")
|
""")
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import traceback
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from semver.utils import get_tag_version
|
from semver.utils import get_tag_version
|
||||||
from semver.logger import logging, logger, console_logger
|
from semver.logger import logging, logger, console_logger
|
||||||
@ -111,7 +113,7 @@ class SemVer(object):
|
|||||||
config_file = file.read()
|
config_file = file.read()
|
||||||
|
|
||||||
# version repo
|
# version repo
|
||||||
logger.debug("Running bumpversion of type: " + self.version_type)
|
logger.debug("Running bumpversion of type: " + str(self.version_type.name))
|
||||||
bump_version(get_tag_version(), self.version_type)
|
bump_version(get_tag_version(), self.version_type)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@ -146,20 +148,22 @@ class SemVer(object):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Bump Semantic Version.')
|
||||||
|
parser.add_argument('-n','--no-push', help='Do not try to push', action='store_false', dest='push')
|
||||||
|
parser.add_argument('-g','--global-user', help='Set git user at a global level, helps in jenkins', action='store_true', dest='global_user')
|
||||||
|
parser.add_argument('-D', '--debug', help='Sets logging level to DEBUG', action='store_true', dest='debug', default=False)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
if args.debug:
|
||||||
|
console_logger.setLevel(logging.DEBUG)
|
||||||
try:
|
try:
|
||||||
parser = argparse.ArgumentParser(description='Bump Semantic Version.')
|
|
||||||
parser.add_argument('-n','--no-push', help='Do not try to push', action='store_false', dest='push')
|
|
||||||
parser.add_argument('-g','--global-user', help='Set git user at a global level, helps in jenkins', action='store_true', dest='global_user')
|
|
||||||
parser.add_argument('-D', '--debug', help='Sets logging level to DEBUG', action='store_true', dest='debug', default=False)
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
|
|
||||||
if args.debug:
|
|
||||||
console_logger.setLevel(logging.DEBUG)
|
|
||||||
|
|
||||||
SemVer(global_user=args.global_user).run(push=args.push)
|
SemVer(global_user=args.global_user).run(push=args.push)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
|
if args.debug:
|
||||||
|
tb = sys.exc_info()[2]
|
||||||
|
traceback.print_tb(tb)
|
||||||
if e == NO_MERGE_FOUND:
|
if e == NO_MERGE_FOUND:
|
||||||
exit(1)
|
exit(1)
|
||||||
elif e == NOT_MAIN_BRANCH:
|
elif e == NOT_MAIN_BRANCH:
|
||||||
|
@ -40,6 +40,7 @@ def call(dockerImage = "rightbrainnetworks/auto-semver:latest", debug = false) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
env.SEMVER_NEW_VERSION = sh(script: "grep -Po '${regex}' .bumpversion.cfg", returnStdout: true).trim()
|
||||||
env.SEMVER_RESOLVED_VERSION = getVersion("-d ${args}")
|
env.SEMVER_RESOLVED_VERSION = getVersion("-d ${args}")
|
||||||
|
|
||||||
env.VERSION = env.SEMVER_RESOLVED_VERSION
|
env.VERSION = env.SEMVER_RESOLVED_VERSION
|
||||||
|
Loading…
Reference in New Issue
Block a user