Jenkinsfile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. node {
  2. def app
  3. /*stage('Initialize'){
  4. def dockerHome = tool 'myDocker'
  5. env.PATH = "${dockerHome}/bin:${env.PATH}"
  6. }*/
  7. stage('Clone repository') {
  8. /* Let's make sure we have the repository cloned to our workspace */
  9. checkout scm
  10. }
  11. stage('Build image') {
  12. /* This builds the actual image; synonymous to
  13. * docker build on the command line */
  14. app = docker.build("hochzeit:latest")
  15. }
  16. stage('Test image') {
  17. /* Ideally, we would run a test framework against our image.
  18. * For this example, we're using a Volkswagen-type approach ;-) */
  19. app.inside {
  20. sh 'echo "Tests passed"'
  21. }
  22. }
  23. stage('Push image') {
  24. /* Finally, we'll push the image with two tags:
  25. * First, the incremental build number from Jenkins
  26. * Second, the 'latest' tag.
  27. * Pushing multiple tags is cheap, as all the layers are reused. */
  28. docker.withRegistry('https://container.kornblum.dev', 'container-kornblum-dev') {
  29. app.push("${env.BUILD_NUMBER}")
  30. app.push("latest")
  31. }
  32. }
  33. stage('webhook deployment portainer') {
  34. sh "curl -k https://192.168.188.23:9443/api/stacks/webhooks/8da9930d-966f-4696-8087-302e2ce139ba"
  35. }
  36. }