Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Merge versioning into master #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@Library("plWorkflowLibs@master")_
@Library("plWorkflowLibs@versioning")_

plWorkflow { }
11 changes: 6 additions & 5 deletions docker.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.concur.*;
import org.codehaus.groovy.runtime.GStringImpl;

workflowDoc = '''
Expand Down Expand Up @@ -74,9 +75,9 @@ full_example: |
- "{{ git_commit }}"
'''

concurPipeline = new com.concur.Commands()
concurUtil = new com.concur.Util()
concurGit = new com.concur.Git()
concurPipeline = new Commands()
concurUtil = new Util()
concurVersion = new Versioning()

/*
description: Build a Docker image.
Expand Down Expand Up @@ -118,7 +119,7 @@ example: |
BuildVersion: "{{ build_version }}"
*/
public build(Map yml, Map args) {
String buildVersion = concurGit.getVersion(yml)
String buildVersion = concurVersion.getVersion(yml)

String dockerfile = args?.dockerfile ?: yml.tools?.docker?.dockerfile
String imageName = args?.imageName ?: yml.tools?.docker?.imageName ?: "${env.GIT_OWNER}/${env.GIT_REPO}"
Expand Down Expand Up @@ -192,7 +193,7 @@ example: |
- "{{ git_commit }}"
*/
public push(Map yml, Map args) {
String buildVersion = concurGit.getVersion(yml)
String buildVersion = concurVersion.getVersion(yml)
String imageName = args?.imageName ?: yml.tools?.docker?.imageName ?: "${env.GIT_OWNER}/${env.GIT_REPO}"
String imageTag = args?.imageTag ?: yml.tools?.docker?.imageTag ?: buildVersion
String dockerEndpoint = args?.uri ?: yml.tools?.docker?.uri ?: env.DOCKER_URI
Expand Down
63 changes: 54 additions & 9 deletions docs/CHANGELOG/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,26 @@
<label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>

<li class="md-nav__item">
<a href="#v051" title="v0.5.1" class="md-nav__link">
v0.5.1
</a>

<nav class="md-nav">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#changed" title="Changed" class="md-nav__link">
Changed
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#v050" title="v0.5.0" class="md-nav__link">
v0.5.0
Expand All @@ -427,7 +447,7 @@
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#changed" title="Changed" class="md-nav__link">
<a href="#changed_1" title="Changed" class="md-nav__link">
Changed
</a>

Expand All @@ -447,7 +467,7 @@
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#changed_1" title="Changed" class="md-nav__link">
<a href="#changed_2" title="Changed" class="md-nav__link">
Changed
</a>

Expand Down Expand Up @@ -481,7 +501,7 @@
</li>

<li class="md-nav__item">
<a href="#changed_2" title="Changed" class="md-nav__link">
<a href="#changed_3" title="Changed" class="md-nav__link">
Changed
</a>

Expand Down Expand Up @@ -622,6 +642,26 @@
<label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>

<li class="md-nav__item">
<a href="#v051" title="v0.5.1" class="md-nav__link">
v0.5.1
</a>

<nav class="md-nav">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#changed" title="Changed" class="md-nav__link">
Changed
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#v050" title="v0.5.0" class="md-nav__link">
v0.5.0
Expand All @@ -631,7 +671,7 @@
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#changed" title="Changed" class="md-nav__link">
<a href="#changed_1" title="Changed" class="md-nav__link">
Changed
</a>

Expand All @@ -651,7 +691,7 @@
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#changed_1" title="Changed" class="md-nav__link">
<a href="#changed_2" title="Changed" class="md-nav__link">
Changed
</a>

Expand Down Expand Up @@ -685,7 +725,7 @@
</li>

<li class="md-nav__item">
<a href="#changed_2" title="Changed" class="md-nav__link">
<a href="#changed_3" title="Changed" class="md-nav__link">
Changed
</a>

Expand Down Expand Up @@ -808,14 +848,19 @@


<h1 id="jenkins-workflows">Jenkins Workflows</h1>
<h2 id="v050">v0.5.0</h2>
<h2 id="v051">v0.5.1</h2>
<h3 id="changed">Changed</h3>
<ul>
<li>Updated workflows to use the new Versioning class from workflow libraries.</li>
</ul>
<h2 id="v050">v0.5.0</h2>
<h3 id="changed_1">Changed</h3>
<ul>
<li>Docs: Migrated to Mkdocs static generator.</li>
<li>Updated script to generate docs to be more robust.</li>
</ul>
<h2 id="v041">v0.4.1</h2>
<h3 id="changed_1">Changed</h3>
<h3 id="changed_2">Changed</h3>
<ul>
<li>docker: Stage names changed to be more simple.</li>
</ul>
Expand All @@ -829,7 +874,7 @@ <h3 id="fixes">Fixes</h3>
<li>golang.lint: --checkstyle being specified would cause failures</li>
<li>golang.lint: Was not properly get values if specified under tools.golang</li>
</ul>
<h3 id="changed_2">Changed</h3>
<h3 id="changed_3">Changed</h3>
<ul>
<li>docker.push: Logging in changed to <code>echo $password | docker login $endpoint -u $user --password-stdin</code></li>
<li>docker.*: Stage names changed to reflect the image name instead of dockerfile.</li>
Expand Down
18 changes: 14 additions & 4 deletions docs/search/search_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -747,21 +747,31 @@
},
{
"location": "/CHANGELOG/",
"text": "Jenkins Workflows\n\n\nv0.5.0\n\n\nChanged\n\n\n\n\nDocs: Migrated to Mkdocs static generator.\n\n\nUpdated script to generate docs to be more robust.\n\n\n\n\nv0.4.1\n\n\nChanged\n\n\n\n\ndocker: Stage names changed to be more simple.\n\n\n\n\nv0.4.0\n\n\nAdded\n\n\n\n\nStart of a test framework for workflows.\n\n\n\n\nFixes\n\n\n\n\ngolang.lint: --checkstyle being specified would cause failures\n\n\ngolang.lint: Was not properly get values if specified under tools.golang\n\n\n\n\nChanged\n\n\n\n\ndocker.push: Logging in changed to \necho $password | docker login $endpoint -u $user --password-stdin\n\n\ndocker.*: Stage names changed to reflect the image name instead of dockerfile.\n\n\n\n\nv0.3.0\n\n\nAdded\n\n\n\n\ngolang.lint: Lint Golang code during a pipeline execution.\n\n\ngolang.dep: Support for the official dependency manager for Golang.\n\n\n\n\nFixes\n\n\n\n\ndocker.push: Wrong credential was being pulled.\n\n\ngolang.getStageName: Test workflow failed due to type safety.\n\n\nnodejs & slack: ConcurCommands class name doesn't exist.\n\n\n\n\nv0.2.0\n\n\nAdded\n\n\n\n\nGradle workflow\n\n\nSlack workflow\n\n\nNodeJS workflow\n\n\n\n\nUpdates\n\n\n\n\ngit.commit: Checks for changes before attempting the commit, this didn't cause a failure before but is cleaner now.\n\n\nAdd more asserts to workflows.\n\n\n\n\nv0.1.1\n\n\nFixed\n\n\n\n\ngithub.createRelease: Fix issue where generated name/tag can get multiple \nv\ns for a prefix.\n\n\n\n\n0.1.0\n\n\nAdded\n\n\nPlease view the associated documentation on how to use these workflows, or visit \nGitHub pages\n generated documentation.\n\n\n\n\nAnsible\n\n\nBuild\n\n\nDocker\n\n\nEmail\n\n\nFpm\n\n\nGit\n\n\nGithub\n\n\nGolang\n\n\nPython\n\n\nRust",
"text": "Jenkins Workflows\n\n\nv0.5.1\n\n\nChanged\n\n\n\n\nUpdated workflows to use the new Versioning class from workflow libraries.\n\n\n\n\nv0.5.0\n\n\nChanged\n\n\n\n\nDocs: Migrated to Mkdocs static generator.\n\n\nUpdated script to generate docs to be more robust.\n\n\n\n\nv0.4.1\n\n\nChanged\n\n\n\n\ndocker: Stage names changed to be more simple.\n\n\n\n\nv0.4.0\n\n\nAdded\n\n\n\n\nStart of a test framework for workflows.\n\n\n\n\nFixes\n\n\n\n\ngolang.lint: --checkstyle being specified would cause failures\n\n\ngolang.lint: Was not properly get values if specified under tools.golang\n\n\n\n\nChanged\n\n\n\n\ndocker.push: Logging in changed to \necho $password | docker login $endpoint -u $user --password-stdin\n\n\ndocker.*: Stage names changed to reflect the image name instead of dockerfile.\n\n\n\n\nv0.3.0\n\n\nAdded\n\n\n\n\ngolang.lint: Lint Golang code during a pipeline execution.\n\n\ngolang.dep: Support for the official dependency manager for Golang.\n\n\n\n\nFixes\n\n\n\n\ndocker.push: Wrong credential was being pulled.\n\n\ngolang.getStageName: Test workflow failed due to type safety.\n\n\nnodejs & slack: ConcurCommands class name doesn't exist.\n\n\n\n\nv0.2.0\n\n\nAdded\n\n\n\n\nGradle workflow\n\n\nSlack workflow\n\n\nNodeJS workflow\n\n\n\n\nUpdates\n\n\n\n\ngit.commit: Checks for changes before attempting the commit, this didn't cause a failure before but is cleaner now.\n\n\nAdd more asserts to workflows.\n\n\n\n\nv0.1.1\n\n\nFixed\n\n\n\n\ngithub.createRelease: Fix issue where generated name/tag can get multiple \nv\ns for a prefix.\n\n\n\n\n0.1.0\n\n\nAdded\n\n\nPlease view the associated documentation on how to use these workflows, or visit \nGitHub pages\n generated documentation.\n\n\n\n\nAnsible\n\n\nBuild\n\n\nDocker\n\n\nEmail\n\n\nFpm\n\n\nGit\n\n\nGithub\n\n\nGolang\n\n\nPython\n\n\nRust",
"title": "Changelog"
},
{
"location": "/CHANGELOG/#jenkins-workflows",
"text": "",
"title": "Jenkins Workflows"
},
{
"location": "/CHANGELOG/#v051",
"text": "",
"title": "v0.5.1"
},
{
"location": "/CHANGELOG/#changed",
"text": "Updated workflows to use the new Versioning class from workflow libraries.",
"title": "Changed"
},
{
"location": "/CHANGELOG/#v050",
"text": "",
"title": "v0.5.0"
},
{
"location": "/CHANGELOG/#changed",
"location": "/CHANGELOG/#changed_1",
"text": "Docs: Migrated to Mkdocs static generator. Updated script to generate docs to be more robust.",
"title": "Changed"
},
Expand All @@ -771,7 +781,7 @@
"title": "v0.4.1"
},
{
"location": "/CHANGELOG/#changed_1",
"location": "/CHANGELOG/#changed_2",
"text": "docker: Stage names changed to be more simple.",
"title": "Changed"
},
Expand All @@ -791,7 +801,7 @@
"title": "Fixes"
},
{
"location": "/CHANGELOG/#changed_2",
"location": "/CHANGELOG/#changed_3",
"text": "docker.push: Logging in changed to echo $password | docker login $endpoint -u $user --password-stdin docker.*: Stage names changed to reflect the image name instead of dockerfile.",
"title": "Changed"
},
Expand Down
32 changes: 16 additions & 16 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<url>
<loc>/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

Expand All @@ -13,85 +13,85 @@

<url>
<loc>/ANSIBLE/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/BUILD/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/DOCKER/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/DOCUMENTATION/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/EMAIL/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/FPM/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/GIT/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/GITHUB/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/GOLANG/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/GRADLE/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/NODEJS/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/PYTHON/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/RUST/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

<url>
<loc>/SLACK/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

Expand All @@ -101,7 +101,7 @@

<url>
<loc>/CHANGELOG/</loc>
<lastmod>2018-03-14</lastmod>
<lastmod>2018-03-23</lastmod>
<changefreq>daily</changefreq>
</url>

Expand Down
14 changes: 7 additions & 7 deletions github.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ full_example: |
- createPullRequest:
'''

concurPipeline = new Commands()
concurGit = new Git()
concurGitHubApi = new GitHubApi()
concurUtil = new Util()
concurPipeline = new Commands()
concurGit = new Git()
concurGitHubApi = new GitHubApi()
concurUtil = new Util()
concurVersion = new Versioning()

/*
description: Create a Pull Request in GitHub.
Expand Down Expand Up @@ -196,8 +197,7 @@ example: |
* Pipeline execution
*/
public createRelease(Map yml, Map args) {
String genVersion = concurGit.getVersion(yml).split('-')[0]
genVersion = genVersion.startsWith('v') ? "$genVersion" : "v$genVersion"
String genVersion = concurVersion.getVersion(yml).split('-')[0]

Map credentials = args?.credentials ?: yml.tools?.github?.credentials
String changelogFile = args?.changelogFile ?: yml.tools?.github?.changelog?.file ?: 'CHANGELOG.md'
Expand All @@ -214,7 +214,7 @@ public createRelease(Map yml, Map args) {

if (!releaseNotes) {
Map changelogReleases = concurUtil.parseChangelog(changelogFile, versionSeperator)
def thisRelease = changelogReleases.find { it =~ /^v?${releaseName.replace('v', '')}/ }
def thisRelease = changelogReleases.find { it =~ /^${releaseName}/ }

assert thisRelease : "Workflows :: github :: createRelease :: Unable to find release $releaseName in the $changelogFile and no release notes are provided to the step."

Expand Down
6 changes: 6 additions & 0 deletions markdown/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Jenkins Workflows

## v0.5.1

### Changed

* Updated workflows to use the new Versioning class from workflow libraries.

## v0.5.0

### Changed
Expand Down