Jenkinsfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. pipeline {
  2. agent { label 'packer-qemu' }
  3. stages {
  4. stage('Build') {
  5. steps {
  6. echo 'Building..'
  7. sh './bin/build'
  8. }
  9. }
  10. stage('Save Artifacts') {
  11. steps {
  12. archiveArtifacts(artifacts: 'dist/**/*.gz')
  13. }
  14. }
  15. stage('Deploy Artifacts') {
  16. when { branch 'master' }
  17. steps {
  18. // work around s3Upload globbing limitations
  19. sh 'mkdir dist/public && find dist/ -name "*.gz" -type f -exec mv {} dist/public/ \\;'
  20. withAWS(credentials: 'iam-jenkins', region: 'us-east-1') {
  21. s3Upload(
  22. bucket: 'static.stj.io',
  23. file: 'dist/public',
  24. path: 'qemu/images/linode/',
  25. acl: 'PublicRead'
  26. )
  27. cfInvalidate(
  28. distribution: 'EQ1W6Z5HB1F3F',
  29. paths: ['/qemu/images/linode/*']
  30. )
  31. }
  32. }
  33. }
  34. }
  35. post {
  36. always {
  37. cleanWs()
  38. }
  39. }
  40. }