https://github.com/rathorsunpreet/jenkins-github-pipeline
A Jenkinsfile Pipeline in Declarative Syntax that fetches another Github Repo, waits for user input within a certain time frame and executes the tests if possible.
https://github.com/rathorsunpreet/jenkins-github-pipeline
declarative github groovy groovy-script jenkins jenkins-pipeline jenkinsfile
Last synced: 7 months ago
JSON representation
A Jenkinsfile Pipeline in Declarative Syntax that fetches another Github Repo, waits for user input within a certain time frame and executes the tests if possible.
- Host: GitHub
- URL: https://github.com/rathorsunpreet/jenkins-github-pipeline
- Owner: rathorsunpreet
- License: mit
- Created: 2024-05-31T18:28:07.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-01T02:20:46.000Z (over 1 year ago)
- Last Synced: 2025-01-18T08:15:02.051Z (9 months ago)
- Topics: declarative, github, groovy, groovy-script, jenkins, jenkins-pipeline, jenkinsfile
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Jenkins-Github-Pipeline
Jenkins-Github-Pipeline is a Jenkinsfile using Declarative Syntax. It downloads the git repository [SimpleAPITestInterface](https://github.com/rathorsunpreet/SimpleAPITestInterface) and waits for user input within a specified time frame, after which test cases are executed.
There are three outcomes that can occur, namely:
* **User input is provided**: Then test execution continues as normal.
* **User aborts the job**: Then the job is simply aborted and no execution of test cases takes place.
* **User is unable to provide input**: User Input is expected within 1 minute, if the user is unable to provide an input, then the default "all report" is used.If keyword "report" is present during input, then a special stage within the pipeline is executed which creates a zip file, named "HTML_Report.zip" at the project root.
Demo / Explanation: https://www.youtube.com/watch?v=R1NcrJdQBN8
## Requirements
* [Jenkins](https://www.jenkins.io/)
* [NodeJS Jenkins Plugin](https://plugins.jenkins.io/nodejs/)
* [Pipeline Utility Steps Plugin](https://plugins.jenkins.io/pipeline-utility-steps/)
* An account that has admin priviledges or an account that can get the script approved. ## Installation
1. Create a new Pipeline job.
2. Under Pipeline -> Definition, select "Pipeline script from SCM".
3. Under SCM -> Repositories -> Repository URL, provide the url "https://github.com/rathorsunpreet/Jenkins-Github-Pipeline".
4. Under Branches to build -> Branch Specifier, make sure it is "*/master".
5. Under Script Path, make sure it is "Jenkinsfile".
6. Click Save.### OR
1. Create a new Pipeline job.
2. Under Pipeline -> Definition, make sure it is "Pipeline Script".
3. Under the Script section, copy and paste the Jenkinsfile.
4. Uncheck "Use Groovy Sandbox".
5. Click on "Apply".
6. Click on Approve Script. 
7. Click on "Save".## Usage
Click on "Build Now".## Notes
You might need to approve the script or whitelist groovy methods if you get an error on the lines of "Scripts not permitted to use method org.jenkinsci.plugins.workflow.steps.FlowInterruptedException \"## License
[MIT](https://choosealicense.com/licenses/mit/)