Jenkinsfile 940 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env groovy
  2. properties([
  3. buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5')),
  4. pipelineTriggers([cron('@daily')]),
  5. ])
  6. node('docker') {
  7. deleteDir()
  8. stage('Checkout') {
  9. checkout scm
  10. }
  11. if (!infra.isTrusted()) {
  12. /* Outside of the trusted.ci environment, we're building and testing
  13. * the Dockerful in this repository, but not publishing to docker hub
  14. */
  15. stage('Build') {
  16. docker.build('jenkins')
  17. }
  18. stage('Test') {
  19. sh """
  20. git submodule update --init --recursive
  21. git clone https://github.com/sstephenson/bats.git
  22. bats/bin/bats tests
  23. """
  24. }
  25. } else {
  26. /* In our trusted.ci environment we only want to be publishing our
  27. * containers from artifacts
  28. */
  29. stage('Publish') {
  30. sh './publish.sh'
  31. }
  32. }
  33. }