Skip to content

Commit

Permalink
Create jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
VijayK540 authored Mar 22, 2022
1 parent b980c86 commit e0345cd
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions jenkins
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
pipeline {
agent none
stages {
stage('Build') {
agent any
steps {
echo 'compiling...'
}
}
stage('Test') {
agent any
steps {
echo 'testing...'
}
}
stage('Approval') {
// no agent, so executors are not used up when waiting for approvals
agent none
steps {
script {
def deploymentDelay = input id: 'Deploy', message: 'Deploy to production?', submitter: 'rkivisto,admin', parameters: [choice(choices: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'], description: 'Hours to delay deployment?', name: 'deploymentDelay')]
sleep time: deploymentDelay.toInteger(), unit: 'HOURS'
}
}
}
stage('Deploy') {
agent any
steps {
// uses https://plugins.jenkins.io/lockable-resources
lock(resource: 'deployApplication'){
echo 'Deploying...'
}
}
}
}
}

0 comments on commit e0345cd

Please sign in to comment.