JAVA-31609 move jenkins, mesos modules to ops repo
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
## Relevant Articles
|
||||
- [Trigger Another Job from a Jenkins Pipeline](https://www.baeldung.com/ops/jenkins-pipeline-trigger-new-job)
|
||||
- [Fixing the “No Such DSL method” Error in Jenkins Pipeline](https://www.baeldung.com/ops/jenkins-pipeline-no-such-dsl-method-error)
|
||||
- [Jenkins Pipeline – Change to Another Folder](https://www.baeldung.com/ops/jenkins-pipeline-change-to-another-folder)
|
||||
- [How to Stop a Zombie Job on Jenkins Without Restarting the Server?](https://www.baeldung.com/ops/stop-zombie-job-on-jenkins-without-restarting-the-server)
|
||||
- [Running Stages in Parallel With Jenkins Workflow / Pipeline](https://www.baeldung.com/ops/running-stages-in-parallel-jenkins-workflow-pipeline)
|
||||
- [Skip a Stage in a Jenkins Pipeline](https://www.baeldung.com/ops/jenkins-pipeline-skip-stage)
|
||||
- [Prevent Jenkins Build From Failing When Execute Shell Step Fails](https://www.baeldung.com/linux/jenkins-build-execute-shell-step-fails)
|
||||
@@ -1,11 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
dir('/var/jenkins_home/workspace/SamplePipeline/scripts') {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
dir('scripts') {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'cd scripts'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
mvn 'clean install'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Example') {
|
||||
steps {
|
||||
script {
|
||||
def output = sh(script: "echo \$(ls)", returnStdout: true)
|
||||
echo "Output: ${output}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Example') {
|
||||
steps {
|
||||
script {
|
||||
def status = sh(returnStatus: true, script: 'ls /test')
|
||||
if (status != 0) {
|
||||
echo "Error: Command exited with status ${status}"
|
||||
} else {
|
||||
echo "Command executed successfully"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Example') {
|
||||
steps {
|
||||
script {
|
||||
def output = sh(returnStdout: true, script: 'pwd')
|
||||
echo "Output: ${output}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Example') {
|
||||
steps {
|
||||
script {
|
||||
def output = sh(returnStdout: true, returnStdoutTrim: true, script: 'echo " hello "')
|
||||
echo "Output: '${output}'"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'echo "Building the application"'
|
||||
// Add commands to build application
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
parallel {
|
||||
stage('Unit Tests') {
|
||||
steps {
|
||||
sh 'sleep 5s'
|
||||
sh 'echo "Running unit tests"'
|
||||
// Add commands to run unit tests
|
||||
}
|
||||
}
|
||||
stage('Integration Tests') {
|
||||
steps {
|
||||
sh 'echo "Running integration tests"'
|
||||
// Add commands to run integration tests
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sh 'echo "Deploying the application"'
|
||||
// Add commands to deploy application
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('tryCatch') {
|
||||
steps {
|
||||
script {
|
||||
try {
|
||||
sh 'test_script.sh'
|
||||
} catch (e) {
|
||||
echo "An error occurred: ${e}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
parameters {
|
||||
booleanParam(name: 'skip_test', defaultValue: false, description: 'Set to true to skip the test stage')
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'echo "Building the application"'
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
execute_stage('Test', params.skip_test)
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sh 'echo "Deploying the application"'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def execute_stage(stage_name, skip) {
|
||||
stage(stage_name) {
|
||||
if(skip) {
|
||||
echo "Skipping ${stage_name} stage"
|
||||
return
|
||||
}
|
||||
// Add steps to test the application
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'echo "Building the application"'
|
||||
// Add steps to build the application
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
input message: 'Do you want to skip the test stage?', ok: 'Yes', parameters: [booleanParam(name: 'skip_test', defaultValue: false)], timeout: time(minutes: 5))
|
||||
script {
|
||||
if(params.skip_test) {
|
||||
sh 'echo "Testing the application"'
|
||||
return
|
||||
}
|
||||
}
|
||||
// Add steps to test the application
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sh 'echo "Deploying the application"'
|
||||
// Add steps to deploy the application
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
parameters {
|
||||
booleanParam(name: 'skip_test', defaultValue: false, description: 'Set to true to skip the test stage')
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'echo "Building application"'
|
||||
// Add build steps here
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
when { expression { params.skip_test != true } }
|
||||
steps {
|
||||
sh 'echo "Testing application"'
|
||||
// Add test steps here
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sh 'echo "Deploying application"'
|
||||
// Add deployment steps here
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('build') {
|
||||
steps {
|
||||
echo "parentJob"
|
||||
}
|
||||
}
|
||||
stage('triggerChildJob') {
|
||||
steps {
|
||||
build job: "childJob", wait: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Infinite Loop') {
|
||||
steps {
|
||||
script {
|
||||
while (true) {
|
||||
println 'This is an infinite loop!'
|
||||
Thread.sleep(10000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
Jenkins.instance.getItemByFullName("sampleZombieJob")
|
||||
.getBuildByNumber(17)
|
||||
.finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));
|
||||
@@ -1,6 +0,0 @@
|
||||
Thread.getAllStackTraces().keySet().each() {
|
||||
if (it.name.contains('sampleZombieJob')) {
|
||||
println "Stopping $it.name"
|
||||
it.interrupt()
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
Thread.getAllStackTraces().keySet().each() {
|
||||
if (it.name.contains('sampleZombieJob')) {
|
||||
println "Stopping $it.name"
|
||||
it.stop()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user