Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add continuous delivery action template #48

Merged
merged 3 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions workflow-templates/cd.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Publish a Jenkins plugin with Maven",
"description": "Continuous delivery for Jenkins plugins and components. For additional setup see jenkinsci/incremental-tools",
timja marked this conversation as resolved.
Show resolved Hide resolved
"iconName": "jenkins",
"categories": [
"Deployment",
"Maven"
],
"filePatterns": [
"pom.xml$"
timja marked this conversation as resolved.
Show resolved Hide resolved
]
}
58 changes: 58 additions & 0 deletions workflow-templates/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Note: additional setup is required, see https://github.com/jenkinsci/incrementals-tools#automatic-deployment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the part I have reservations about: using the template might mislead you into thinking you do not need to do anything else, when you need to

  • patch RPU
  • edit your pom.xml and maven.config
  • understand what you are getting into

I wonder if we can add some lightweight action that does a sanity check on config? If your secret is not configured, or if the repo metadata files (perhaps as retrieved by gh REST to avoid a slower full clone) do not meet the requirements, fail quickly with a helpful message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably could be added later, the point of the comment was to point people towards the extra setup.

I would expect this to be added to the archetypes at some point and maybe to @halkeye 's plugins self service app for a one click enable:

https://plugins-self-service-3ir4b.ondigitalocean.app/


name: cd
on:
workflow_dispatch:
check_run:
types:
- completed

jobs:
validate:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of nonsense is why we created Pipeline. 😁

steps:
- name: Verify CI status
uses: jenkins-infra/[email protected]
id: verify-ci-status
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
output_result: true

- name: Release Drafter
uses: release-drafter/release-drafter@v5
if: steps.verify-ci-status.outputs.result == 'success'
with:
name: next
tag: next
version: next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check interesting categories
uses: jenkins-infra/[email protected]
id: interesting-categories
if: steps.verify-ci-status.outputs.result == 'success'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
runs-on: ubuntu-latest
needs: [validate]
if: needs.validate.outputs.should_release == 'true'
steps:
- name: Check out
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Release
uses: jenkins-infra/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need trailing newline

Loading