subman-nextjs/Jenkinsfile

43 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2024-10-01 09:04:52 +00:00
pipeline {
agent any
environment{
2024-10-01 10:16:58 +00:00
JWT_SECRET=credentials('JWT_SECRET')
2024-10-01 09:04:52 +00:00
DATABASE_URL=credentials('DATABASE_URL')
}
stages{
stage('build'){
steps{
2024-10-04 13:11:59 +00:00
sh 'echo "JWT_SECRET=${JWT_SECRET}" | cat >> .env'
sh 'echo "DATABASE_URL=${DATABASE_URL}" | cat >> .env'
2024-10-01 09:04:52 +00:00
sh 'npm install'
sh 'npm run build'
}
}
2024-10-04 19:36:58 +00:00
stage('test'){
steps{
sh 'npx playwright install'
2024-10-04 19:36:58 +00:00
sh 'npx playwright test'
2024-10-04 19:37:33 +00:00
sh 'rm -r pack'
2024-10-04 19:36:58 +00:00
}
}
2024-10-01 09:04:52 +00:00
stage('deploy'){
steps{
sshPublisher(publishers: [sshPublisherDesc(configName: 'Demos', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'ssh-uploads/subman/upgrade.sh', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'ssh-uploads/subman/', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'subman.tar.gz')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
2024-10-01 09:04:52 +00:00
}
}
}
2024-10-03 15:59:21 +00:00
post {
// Clean after build
always {
cleanWs(cleanWhenNotBuilt: true,
2024-10-04 20:23:02 +00:00
cleanWhenFailure: false,
2024-10-03 15:59:21 +00:00
deleteDirs: true,
disableDeferredWipeout: true,
2024-10-03 16:22:14 +00:00
// notFailBuild: true,
cleanWhenSuccess:false,
2024-10-03 16:13:48 +00:00
patterns: [[pattern: '**/*', type: 'INCLUDE'],
2024-10-03 15:59:21 +00:00
[pattern: '.propsfile', type: 'EXCLUDE']])
}
}
2024-10-01 09:04:52 +00:00
}