Skip to content

Jenkins homework: declarative pipeline building a static html website with NPM

License

Notifications You must be signed in to change notification settings

ichijoint/jenkins-homework

Repository files navigation

jenkins-homework

Jenkins homework

Tasks

  • connect static slave node (TO DO)
  • create declarative job (done)
  • add parameter environment (done)
  • trigger on push and pr (done with webhook)
  • skip build if commit message is "SKIP_CI" (done)
  • create zip file with suffix $BRANCH_NAME (done)
  • and store it like artifact and build_number (done)
  • create shared library to send slack notification with build status (done)
  • in parallel ping 3 different servers and if ping failed - stop the job (done)
  • move all logic to shared library (almost)
  • ADDITIONAL: after building app, Jenkins should tag the current commit with build number (done)

my actions

  1. Create VMs with Jenkins in GCP
  2. Installed necessary plugins, plus GCE plugin
  3. Created a multibranch pipeline, added SCM with Jenkinsfile img1
  4. Configured GCE plugin to create worker instances based on an image with java installed (otherwise Jenkins didn't want to connect with the nodes) img2
  5. Added a when condition so "build" stage is skipped when commit message equals to "SKIP_CI" img3
  6. As a sample project to build, I used a HTML5 boilerplate, just npm project (i utilized my previous code - a project from external EPAM training course)
  7. Last stage - archiving artifacts built by npm in zip file
  8. Added github webhook
  9. Finally! jenkins builds website and adds zipped /dist/ folder to artifacts img4
  10. Moved all logic to library, only some steps left in Jenkinsfile.
  11. Added shared library to Jenkins in configuration. img5
  12. Added slack integration plugin, registered a workspace to test img6

About

Jenkins homework: declarative pipeline building a static html website with NPM

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published