/
index.html
273 lines (212 loc) · 13.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<title>Digital.ai Release and Deploy Community Plugins</title>
</head>
<body>
<header>
<div class="container">
<img src="images/logo.png" alt="XebiaLabs" class="logo">
<br />
<h1>Digital.ai Release and Deploy Community Plugins</h1>
<section id="downloads">
<a href="https://github.com/xebialabs-community" class="btn btn-github">
<span class="icon"></span>View on GitHub</a>
</section>
</div>
</header>
<div class="container">
<article class="markdown-body">
<h2>Welcome to the Digital.ai Plugin Community</h2>
<p>This page describes how you can contribute to the <a href="https://xebialabs.com/">Digital.ai Release and Deploy</a> community plugins, with supplemental information around continuous integration and versioning/release details.</p>
<p><em>To join the xebialabs-community organization, create a <a href="https://github.com/join">GitHub</a> account and request to join the organization by sending an email to <a href="mailto:rbroker@xebialabs.com">rbroker@xebialabs.com</a> and <a href="mailto:amohleji@xebialabs.com">amohleji@xebialabs.com</a>.</em></p>
<h2>Quickstart for Existing Plugins</h2>
<p>If you want to contribute to an existing repository, simply fork the repository, make your changes, and send a pull request.
If you need help with this, contact an existing plugin contributor - for example the person who last committed to that repository.</p>
<h2>Plugin Setup</h2>
<h3>License</h3>
<p>Digital.ai requires that each plugin use the <a href="https://opensource.org/licenses/MIT">MIT license</a>:</p>
<pre><code>Copyright <YEAR> <COPYRIGHT HOLDER>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</code></pre>
<p>Licensing can be easily handled using the <a href="https://github.com/hierynomus/license-gradle-plugin">Gradle license plugin</a>:</p>
<pre><code>plugins {
id "com.github.hierynomus.license" version "0.13.1"
}
...
license {
header rootProject.file('License.md')
strictCheck false
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.name = 'XEBIALABS'
}
</code></pre>
<h3>Dependencies</h3>
<p>We have a public artifact repository which Gradle or Maven can use to fetch dependencies. It is located at <a href="https://dist.xebialabs.com/public/maven2">https://dist.xebialabs.com/public/maven2</a>. A Gradle configuration which uses the repository would look like this:</p>
<pre><code>repositories {
...
maven {
url 'http://dist.xebialabs.com/public/maven2'
}
}
</code></pre>
<h3>Gradle Wrapper</h3>
<p>Using a Gradle wrapper ensures that the same Gradle version is used for all builds (including on Travis CI). An example Gradle wrapper can be found in <a href="https://github.com/xebialabs-community/xld-openshift-plugin">the xld-openshift-plugin repository</a>. You can copy the example wrapper or create one yourself using <code>gradle wrapper</code>.</p>
<p>Builds should typically be ran with <code>./gradlew build</code>.</p>
<h2>Releases and Versioning</h2>
<h3>Versioning - Manual/Basic Option</h3>
<ul>
<li>Update the <code>build.gradle</code> file to contain the new version number.</li>
<li>Update the <code>.travis.yml</code> file to contain the new version number.</li>
<li>Create a new tag, using <a href="https://semver.org">semantic versioning</a>.
<ul>
<li>For example: <code>git tag -a v4.5.2 -m 'Version 4.5.2' 373159</code> for commit 373159.</li>
</ul>
</li>
<li>Push the tag to GitHub: <code>git push --follow-tags</code>.</li>
</ul>
<h3>Versioning - Automated Option</h3>
<p>Nebula eliminates the need to set and/or change the version number in the Gradle file. The CI build will use the version number set in the commit tag. The tags in the repository must be set appropriately by the developer for a major, minor, or patch release using the Nebula conventions.</p>
<h4>Gradle Config</h4>
<ul>
<li>Add <code>id 'nebula.release' version '6.0.0'</code> to the <code>plugins</code> section of the <code>build.gradle</code> file.</li>
<li>Remove the hard-coded version assignment if present.</li>
<li>Add scope and useLastTag logic. Note, if it appears that Gradle is not processing these lines, move them higher in the build.gradle file. See the history of the build.gradle file in <a href="https://github.com/xebialabs-community/xlr-ansible-tower-plugin">https://github.com/xebialabs-community/xlr-ansible-tower-plugin</a> for an example.</li>
</ul>
<pre><code>if (!project.hasProperty('release.scope')) {
project.ext['release.scope'] = 'patch'
}
if (!project.hasProperty('release.useLastTag')) {
project.ext['release.useLastTag'] = true
}
</code></pre>
<h4>Nebula Compatibility of Existing Tags</h4>
<p>Check that existing tags meet Nebula conventions. The tag format should be vx.y.z, where x = major release number, y = minor release number, z = patch level. See the Semantic Versioning reference at <a href="https://semver.org">https://semver.org</a>.</p>
<h3>Releases</h3>
<ol>
<li>Confirm a successful build in your local directory.</li>
<li>Commit the code changes in your local directory, then push them to the GitHub repository.</li>
<li>Set the <a href="https://semver.org">appropriate tag</a>, e.g., <code>git tag -a "v1.3.0" -m "Version 1.3.0"</code> for the last commit.</li>
<li>Execute <code>git push --follow-tags</code>.</li>
<li>Each push will trigger a Travis job; the second job will add the files listed to the repository's Releases page.</li>
<li>Consider editing the release notes in GitHub to provide better insight into what's included/important for this release.</li>
</ol>
<h2>Continuous Integration</h2>
<h3>GitHub Actions</h3>
GitHub Actions is the default and recommended option for continuous integration after December 1, 2020. Minimal configuration is required to setup a GitHub Actions CI workflow. Two files should be defined at <code>$REPO/.github/workflows/build.yaml</code> and <code>$REPO/.github/workflows/release.yaml</code>. Examples for copy and paste are shown below:<br>
<br>
For <code>build.yaml:</code>
<pre><code>name: "build"
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew clean build
</code></pre>
This build ensures every commit results in a plugin which can be successfully compiled. The three automated steps in this workflow are:
<ol>
<li>Check out the repository</li>
<li>Install Java 1.8</li>
<li>Run the Gradle build</li>
</ol>
For <code>release.yaml</code>
<pre><code>name: "release"
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew clean build
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
./build/libs/xlr-jenkins-multibranch-plugin-*.jar
</code></pre>
This workflow will only run on tagged commits. It builds the plugin, then creates a new versioned release. Replace the <code>files:</code> value of <code>./build/libs/xlr-jenkins-multibranch-plugin-*.jar</code> with a value for your specific plugin. Note that the secret value in this config is automatically provided by GitHub Actions, and does not need to be manually configured. Again, setting up these two files should be all that is needed for GitHub Actions CI setup.
The four automated steps in this workflow are:
<ol>
<li>Check out the repository</li>
<li>Install Java 1.8</li>
<li>Run the Gradle build</li>
<li>Create a release based on the tag</li>
</ol>
<h3>Travis CI</h3>
<p>Some plugins use Travis CI for continuous integration. Go to <a href="https://travis-ci.org">Travis CI</a> and log in with your GitHub account. After you log in, you'll see the community plugins being built. The build configuration is provided by the <code>.travis.yml</code> file in each repository. More information is available at the <a href="http://docs.travis-ci.com/">Travis CI documentation site</a>.</p>
<p>When creating the <code>.travis.yml</code> file, please configure <a href="https://slack.com/">Slack</a> notifications as described <a href="https://docs.travis-ci.com/user/notifications/#configuring-slack-notifications">here</a> and GitHub releases as described <a href="http://docs.travis-ci.com/user/deployment/releases/">here</a>. Use the XebiaLabsCommunityCI system account for GitHub keys.</p>
<h4>Travis Config</h4>
<p>Edit the .travis.yml file:</p>
<ul>
<li>The Travis gem can be installed with <code>gem install -v 1.7.5 --no-rdoc --no-ri travis</code>.</li>
<li>If the api_key credentials are not working, generate new ones with <code>travis setup releases --force</code> and the XebiaLabsCommunityCI system account.</li>
<li>Add <code>file_glob: true</code> to allow wildcards in the <code>file:</code> argument(s).</li>
<li>Set or change <code>file</code> to <code>build/distributions/*</code> or <code>build/libs/*</code>. The argument can point to a single file (with or without wildcards) or list of files in yml notation.</li>
<li>Add <code>skip_cleanup: true</code>, so the cleanup doesn't delete the file to be uploaded.</li>
<li>Add this configuration:</li>
</ul>
<pre><code>on:
all_branches: true
tags: true
repo: repo-owner/repo-name
</code></pre>
<ul>
<li>Also, <code>before_deploy:</code> and <code>after_deploy:</code> blocks are available to run scripts before/after release is pushed.</li>
<li>Turn on the switch for the repository at https://travis-ci.org/profile/xebialabs-community.</li>
</ul>
<p>Example:</p>
<pre><code>deploy:
provider: releases
api_key:
secure: ...
file_glob: true
file: build/distributions/*
skip_cleanup: true
on:
all_branches: true
tags: true
repo: repo-owner/repo-name
</code></pre>
<h2>Definition of Done</h2>
<ol>
<li>Each repository must include the MIT license.</li>
<li>Each repository must have a description.</li>
<li>Each repository must have one or more GitHub topics defined.</li>
<li>If your repository is a plugin, the repository name should end with <code>plugin</code>.</li>
<li>If your repository is a plugin for XL Deploy, the repository name should start with <code>xld</code>.</li>
<li>If your repository is a plugin for XL Release, the repository name should start with <code>xlr</code>.</li>
<li>Each repository must have public CI enabled (GitHub Actions, TravisCI, or other) and the corresponding badge in the <code>README.md</code> file.</li>
</ol>
<h2>Extra Information</h2>
<ul>
<li><a href="https://digital.ai/">Digital.ai website</a></li>
<li><a href="https://xebialabs.com/">XebiaLabs website</a></li>
<li><a href="https://docs.xebialabs.com/">XebiaLabs documentation</a></li>
<li><a href="https://support.xebialabs.com">XebiaLabs support</a></li>
<li><a href="https://github.com/xebialabs-community">XebiaLabs community</a></li>
</ul>
</article>
</div>
</body>
</html>