forked from javahometech/my-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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...' | ||
} | ||
} | ||
} | ||
} | ||
} |