-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add documents and examples in the snippet (#134)
* feat: Add documents and examples in the snippet * Add document to fields
- Loading branch information
1 parent
f62a6c8
commit 728bd41
Showing
9 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
.../resources/io/jenkins/plugins/conventionalcommits/NextVersionStep/help-buildMetadata.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<p> | ||
An optional parameter can be added as follows: | ||
<code> | ||
<pre> | ||
pipeline { | ||
agent any | ||
environment { | ||
NEXT_VERSION = nextVersion(buildMetadata: "$env.BUILD_NUMBER") | ||
} | ||
stages { | ||
stage('Hello') { | ||
steps { | ||
echo "next version = ${NEXT_VERSION}" | ||
} | ||
} | ||
} | ||
} | ||
</pre> | ||
</code> | ||
Assuming next version is 1.1.0. The pipeline will output: next version = 1.1.0+001 | ||
</p> |
9 changes: 9 additions & 0 deletions
9
...rces/io/jenkins/plugins/conventionalcommits/NextVersionStep/help-incrementPreRelease.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<p> | ||
There are three options to manipulate the prerelease option: | ||
<ul> | ||
<li>the name of the prerelease ➡️ <code>preRelease</code></li> | ||
<li>keep the existing prerelease (default false) ➡️ <code>preservePrelease</code></li> | ||
<li>increment the existing prerelease (default false) ➡️ <code>incrementPreRelease</code></li> | ||
</ul> | ||
The table described in <a href="https://github.com/jenkinsci/conventional-commits-plugin#prerelease-possible-combinations">here</a> are the combined use of these options and the result. | ||
</p> |
3 changes: 3 additions & 0 deletions
3
...esources/io/jenkins/plugins/conventionalcommits/NextVersionStep/help-nonAnnotatedTag.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
If false use only annotated tags, if true use all tags to determine next version | ||
</p> |
3 changes: 3 additions & 0 deletions
3
...n/resources/io/jenkins/plugins/conventionalcommits/NextVersionStep/help-outputFormat.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
|
||
</p> |
23 changes: 23 additions & 0 deletions
23
...ain/resources/io/jenkins/plugins/conventionalcommits/NextVersionStep/help-preRelease.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<p> | ||
For a <code>1.0.0</code> existing version the following code: | ||
<code> | ||
<pre> | ||
pipeline { | ||
agent any | ||
|
||
environment { | ||
NEXT_VERSION = nextVersion(preRelease: 'alpha') | ||
} | ||
|
||
stages { | ||
stage('Hello') { | ||
steps { | ||
echo "next version = ${NEXT_VERSION}" | ||
} | ||
} | ||
} | ||
} | ||
</pre> | ||
</code> | ||
Will display: next version = 1.1.0-alpha | ||
</p> |
9 changes: 9 additions & 0 deletions
9
...urces/io/jenkins/plugins/conventionalcommits/NextVersionStep/help-preservePreRelease.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<p> | ||
There are three options to manipulate the prerelease option: | ||
<ul> | ||
<li>the name of the prerelease ➡️ <code>preRelease</code></li> | ||
<li>keep the existing prerelease (default false) ➡️ <code>preservePrelease</code></li> | ||
<li>increment the existing prerelease (default false) ➡️ <code>incrementPreRelease</code></li> | ||
</ul> | ||
The table described in <a href="https://github.com/jenkinsci/conventional-commits-plugin#prerelease-possible-combinations">here</a> are the combined use of these options and the result. | ||
</p> |
3 changes: 3 additions & 0 deletions
3
src/main/resources/io/jenkins/plugins/conventionalcommits/NextVersionStep/help-startTag.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
|
||
</p> |
3 changes: 3 additions & 0 deletions
3
...n/resources/io/jenkins/plugins/conventionalcommits/NextVersionStep/help-writeVersion.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
Allow writing back to the file the next calculated version. | ||
</p> |
44 changes: 44 additions & 0 deletions
44
src/main/resources/io/jenkins/plugins/conventionalcommits/NextVersionStep/help.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<p> | ||
Determine the next release version based on previous tags and the commit messages used. | ||
It calculates the version number based on the format of the commit message. | ||
The commit message format used is <a href="https://www.conventionalcommits.org/en/v1.0.0/" target="_blank">conventional commits.</a> | ||
</p> | ||
<p> | ||
This plugin can be used in a pipeline in a stage or the environment block. Some examples of this in use are:<br/> | ||
<strong>In the environment block:</strong><br/> | ||
<code> | ||
<pre> | ||
pipeline { | ||
agent any | ||
|
||
environment { | ||
NEXT_VERSION = nextVersion() | ||
} | ||
|
||
stages { | ||
stage('Hello') { | ||
steps { | ||
echo "next version = ${NEXT_VERSION}" | ||
} | ||
} | ||
} | ||
} | ||
</pre> | ||
</code> | ||
<strong>In a scripted Pipeline:</strong><br/> | ||
<code> | ||
<pre> | ||
def NEXT_VERSION | ||
node { | ||
stage('Get next version ...') { | ||
NEXT_VERSION=nextVersion() | ||
echo "Next version : $NEXT_VERSION" | ||
} | ||
stage ('Release') { | ||
sh "mvn release:prepare -DreleaseVersion=$NEXT_VERSION" | ||
sh 'mvn release:perform' | ||
} | ||
} | ||
</pre> | ||
</code> | ||
</p> |