Skip to content
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
24 changes: 24 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## What


## Why


## How


## Testing


## Screenshots


## Checklist
- [ ] Branch name
- [ ] Target branch
- [ ] Commit messages
- [ ] Squash commits
- [ ] MR name
- [ ] MR Description
- [ ] Tests
- [ ] Browser support verified
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
dist/
loader/
www/
*.log
.DS_Store
/.idea/
Empty file added .npmrc
Empty file.
35 changes: 35 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pipeline {
agent {
label 'aws-small'
}

tools {
nodejs 'nodejs-22'
}

stages {
stage('Install Dependencies') {
steps {
sh 'npm ci'
}
}

stage('Build') {
steps {
sh 'npm run build'
}
}
}

post {
always {
cleanWs()
}
success {
echo 'Build completed successfully!'
}
failure {
echo 'Build failed!'
}
}
}
123 changes: 123 additions & 0 deletions JenkinsfileRelease
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
@Library('ontotext-platform@v0.1.51') _

def performCleanup = {
sh "git restore .npmrc"
}

pipeline {
agent {
label 'aws-small'
}

tools {
nodejs 'nodejs-22'
}

parameters {
gitParameter name: 'GIT_BRANCH',
description: 'The Git branch to build',
branchFilter: 'origin/(.*)',
defaultValue: 'main',
selectedValue: 'DEFAULT',
type: 'PT_BRANCH',
listSize: '0',
quickFilterEnabled: true

string name: 'RELEASE_VERSION',
description: 'Version to release',
defaultValue: ''

booleanParam(
name: 'NOTIFY_SLACK',
defaultValue: true,
description: 'Send Slack notification after successful build'
)

string(
name: 'SLACK_CHANNEL',
defaultValue: '#frontend-notifications',
description: 'Slack channel for notification (only used if checkbox above is selected)'
)
}

options {
disableConcurrentBuilds()
timeout(time: 15, unit: 'MINUTES')
timestamps()
}

stages {
stage ('Prepare & Publish') {
steps {
script {
git_cmd.checkout(branch: params.GIT_BRANCH)
npm.prepareRelease(version: params.RELEASE_VERSION, scripts: ['build'])

withKsm(application: [
[
credentialsId: 'ksm-jenkins',
secrets: [
[destination: 'env', envVar: 'NPM_TOKEN', filePath: '', notation: 'keeper://FcbEgbi287PN2yx_3uCz4Q/field/note'],
]
]
]) {
sh "echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc"
sh "npm whoami || echo 'whoami failed'"
sh "npm publish"
}
}
}
}
}

post {
success {
script {
performCleanup()

// Commit and tag the release
sh "git commit -a -m 'Release ${params.RELEASE_VERSION}'"
sh "git tag -a v${params.RELEASE_VERSION} -m 'Release v${params.RELEASE_VERSION}'"

withKsm(application: [
[
credentialsId: 'ksm-jenkins',
secrets: [
[destination: 'env', envVar: 'GIT_USER', filePath: '', notation: 'keeper://8hm1g9HCfBPgoWAmpiHn6w/field/login'],
[destination: 'env', envVar: 'GIT_TOKEN', filePath: '', notation: 'keeper://8hm1g9HCfBPgoWAmpiHn6w/field/password']
]
]
]) {
sh 'mkdir -p ~/.ssh'
sh 'ssh-keyscan github.com >> ~/.ssh/known_hosts'

sh 'git config --global user.name "$GIT_USER"'
sh 'git config --global user.email "$GIT_USER@users.noreply.github.com"'

sh 'git remote set-url origin git@github.com:Ontotext-AD/graphwise-reactodia.git'
sh "git push --set-upstream origin ${params.GIT_BRANCH}"
sh 'git push --tags'
}

// Optional Slack notification if enabled and channel is provided
if (params.NOTIFY_SLACK && params.SLACK_CHANNEL?.trim()) {
try {
slack.notifyResult(channel: params.SLACK_CHANNEL, color:'good', message:"Released graphwise-reactodia v${params.RELEASE_VERSION}")
} catch (e) {
echo "Slack notification failed: ${e.getMessage()}"
}
}
}
}

failure {
wrap([$class: 'BuildUser']) {
sendMail(env.BUILD_USER_EMAIL)
}

script {
performCleanup()
}
}
}
}
Loading