diff --git a/README.md b/README.md index 6c38549..719c2a4 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ The exit code of auto-semver determines the output. |0|Successfully ran auto-semver| |1|No merge found| |2|Not a main branch| -|3|No git flow branch name found| +|3|No version branch name found| |128|Unknown error occured| #### Flags @@ -129,10 +129,6 @@ The `semver_get_version` command returns the version number if the `semver` comm Replaces `/` with `.` in branch names. For example, `feature/test` becomes `feature.test` -### Commitless Versioning - -Because auto-semver keeps track of the version by looking at the latest git tag, instead of commiting versioned values to the repository, files can be updated upon release. - ### Jenkins Shared Library This repository is also home to a Jenkins shared library to assit in running auto-semver. diff --git a/README.rst b/README.rst deleted file mode 100644 index a717634..0000000 --- a/README.rst +++ /dev/null @@ -1,20 +0,0 @@ -Semantic Versioning -=================== - -Usage -===== - -FULL\_PATH\_TO\_LOCAL\_REPO gives container access to repo to be versioned -========================================================================== - -FULL\_PATH\_TO\_SSH\_FOLDER gives container access to ssh keys to be able to push repo -====================================================================================== - -docker build -t semver . docker run -v -FULL\_PATH\_TO\_LOCAL\_REPO:/application\_repo -v -FULL\_PATH\_TO\_SSH\_FOLDER:/root/.ssh semver - -after this finishes must go to FULL\_PATH\_TO\_LOCAL\_REPO and push yourself -============================================================================ - -git push origin develop git push origin --tags diff --git a/setup.py b/setup.py index 9c9f5cb..51be44a 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file -with open(path.join(here, 'README.rst'), encoding='utf-8') as f: +with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() def read(*parts): @@ -46,7 +46,7 @@ setup( long_description=long_description, # The project's main homepage. - url='https://git-codecommit.us-east-1.amazonaws.com/v1/repos/auto-semver', + url='https://github.com/RightBrain-Networks/auto-semver', # Author details author='RightBrain Networks', diff --git a/vars/gitPushTags.groovy b/vars/gitPushTags.groovy new file mode 100644 index 0000000..ab4c8ed --- /dev/null +++ b/vars/gitPushTags.groovy @@ -0,0 +1,18 @@ +#!/usr/bin/env groovy + +/** + * Pushes tags to a repo + * + * @param creds The Jenkins Git credentials to use. + */ + +def call(creds) { + + withCredentials([usernamePassword(credentialsId: creds, usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD')]) { + def gitOrigin = sh(script: "git remote", returnStdout: true).trim() + // Need to remove the protocol to add in user name and host + def gitHost = sh(script: "git remote get-url ${gitOrigin}", returnStdout: true).trim().replaceFirst('https://','') + // Push tags to branch + sh("git push https://${env.GIT_USERNAME}:${env.GIT_PASSWORD}@${gitHost} --tags") + } +}