Merge pull request #33 from RightBrain-Networks/feature/finalChanges
Update ReadMe.md; Add gitPushTags.groovy; Update setup.py;
This commit is contained in:
commit
1e264b5443
1
MANIFEST.in
Normal file
1
MANIFEST.in
Normal file
@ -0,0 +1 @@
|
||||
global-include README.md
|
@ -49,7 +49,7 @@ tag_name = v{new_version}
|
||||
message = Bump version: {current_version} -> {new_version}
|
||||
```
|
||||
|
||||
The `current_version` exists to tell bumpversion what the current version is. To have auto-semver manage this value, set it to `0.0.0` This must match what is in the VERSION file (example shown below). The `commit` and `tag` options determine whether to create a new Git commit and a new Git tag, respectively. The `tag_name` represents what the name of the Git tag will be, and by default is set to `{new_version}`, which will be substitued with the new version during runtime. This can be changed as desired - for example, `v{new_version}` could resolve to `v1.15.5`. The `message` option is what the message used if there is a git commit.
|
||||
The `current_version` exists to tell bumpversion what the current version is. To have auto-semver manage this value, set it to `0.0.0`. The `commit` and `tag` options determine whether to create a new Git commit and a new Git tag, respectively. The `tag_name` represents what the name of the Git tag will be, and by default is set to `{new_version}`, which will be substitued with the new version during runtime. This can be changed as desired - for example, `v{new_version}` could resolve to `v1.15.5`. The `message` option is what the message used if there is a git commit.
|
||||
|
||||
### File updates
|
||||
|
||||
@ -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.
|
||||
|
20
README.rst
20
README.rst
@ -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
|
4
setup.py
4
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',
|
||||
|
18
vars/gitPushTags.groovy
Normal file
18
vars/gitPushTags.groovy
Normal file
@ -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")
|
||||
}
|
||||
}
|
@ -38,7 +38,7 @@ def call(dockerImage = "rightbrainnetworks/auto-semver:latest") {
|
||||
env.SEMVER_NEW_VERSION = sh(script: "grep -Po '${regex}' .bumpversion.cfg", returnStdout: true).trim()
|
||||
env.SEMVER_RESOLVED_VERSION = getVersion('-d')
|
||||
|
||||
env.VERSION = getVersion('-d')
|
||||
env.VERSION = env.SEMVER_RESOLVED_VERSION
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user