| stage('Manual Tests') { | |
| def userInput = input( | |
| id: 'userInput', message: 'What env to test in?', parameters: [ | |
| [ | |
| $class: 'ChoiceParameterDefinition', | |
| description: 'This will reset the DB to match Prod', | |
| name: 'environment', | |
| choices: "qa\nstaging\nvms\nskip\n" | |
| ] | |
| ]) | |
| node { | |
| wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) { | |
| timestamps { | |
| try { | |
| switch (userInput) { | |
| default: | |
| error("Invalid environment choice"); | |
| break; | |
| case ['qa', 'staging', 'vms']: | |
| echo "Deploying into ${userInput}" | |
| break; | |
| case 'skip': | |
| echo 'Skipping manual tests' | |
| break | |
| } | |
| } catch (error) { | |
| throw error | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment