Skip to content

Commit

Permalink
ci: add CI/CD pipelines for GitHub and Jenkins
Browse files Browse the repository at this point in the history
- Includes `Jenkinsfile` pipeline for semantic release (`.releaserc`)
- GitHub actions workflow to validate the Helm Chart
  • Loading branch information
sydrawat01 committed Nov 2, 2023
1 parent 4a345fe commit 3d8fd16
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/helm-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Helm Chart Validation

on:
workflow_dispatch:
pull_request:
branches: [master]

jobs:
lint:
name: Helm Chart Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Linting the Helm Chart
run: |
pwd
helm lint .
shell: bash

- name: Generate a template
run: |
pwd
cd ../
helm template webapp-helm-chart
shell: bash
51 changes: 51 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"branches": ["master"],
"repositoryUrl": "https://github.com/csye7125-fall2023-group05/infra-helm-chart.git",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"semantic-release-helm",
{
"chartPath": "./",
"onlyUpdateVersion": true
}
],
[
"@semantic-release/git", {
"assets": [
{"path": "./Chart.yaml"},
{"path": "./CHANGELOG.md"}
]
}],
"@semantic-release/github"
],
"release": {
"verifyConditions": {
"path": ["@semantic-release/changelog", "@semantic-release/github", "@semantic-release/git"]
},
"analyzeCommits": [
"@semantic-release/commit-analyzer"
],
"generateNotes": [
"@semantic-release/release-notes-generator", {
"preset": "angular",
"writerOpts": {
"commitsSort": ["header"]
}
}
],
"prepare": [
"semantic-release-helm",
"@semantic-release/git",
{
"path": "@semantic-release/changelog",
"changelogFile": "CHANGELOG.md"
}
],
"publish": "@semantic-release/github",
"success": "@semantic-release/github",
"fail": "@semantic-release/github"
}
}
36 changes: 36 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
pipeline {
agent any
tools { nodejs "node" }
environment {
GH_TOKEN = credentials('jenkins-pat')
}
stages {
stage ('Checkout Code') {
steps {
cleanWs()
checkout scm
}
}
stage ('Release with SemVer') {
when {
branch 'master'
}
steps {
sh '''
npm install @semantic-release/commit-analyzer
npm install @semantic-release/release-notes-generator
npm install @semantic-release/changelog
npm install semantic-release-helm
npm install @semantic-release/git
npm install @semantic-release/github
npx semantic-release
'''
}
}
}
post {
always {
echo 'Pipeline complete'
}
}
}

0 comments on commit 3d8fd16

Please sign in to comment.