blob: 6cb3aee7dab27974d58fb1d894632e0ef8979d63 [file] [log] [blame]
Mohammed Naser12207172024-02-05 18:49:35 -05001pipeline {
Mohammed Nasere7569e02024-02-20 14:33:37 -05002 agent none
Mohammed Naser12207172024-02-05 18:49:35 -05003
Mohammed Nasere7569e02024-02-20 14:33:37 -05004 options {
5 disableConcurrentBuilds(abortPrevious: true);
6 }
Mohammed Naser12207172024-02-05 18:49:35 -05007
Mohammed Nasere7569e02024-02-20 14:33:37 -05008 // TODO: periodic multi-node jobs
Mohammed Naser12207172024-02-05 18:49:35 -05009
Mohammed Nasere7569e02024-02-20 14:33:37 -050010 environment {
11 EARTHLY_CI = 'true'
12 }
Mohammed Naser12207172024-02-05 18:49:35 -050013
Mohammed Nasere7569e02024-02-20 14:33:37 -050014 stages {
15 stage('lint') {
16 parallel {
17 stage('ansible-lint') {
18 agent {
19 label 'earthly-2c-4g'
20 }
Mohammed Naser12207172024-02-05 18:49:35 -050021
Mohammed Nasere7569e02024-02-20 14:33:37 -050022 steps {
23 sh 'earthly --output +lint.ansible-lint'
24 }
Mohammed Naser12207172024-02-05 18:49:35 -050025
Mohammed Nasere7569e02024-02-20 14:33:37 -050026 post {
27 always {
28 junit testResults: 'ansible-lint.xml', allowEmptyResults: true
29 }
30 }
31 }
Mohammed Naser12207172024-02-05 18:49:35 -050032
Mohammed Nasere7569e02024-02-20 14:33:37 -050033 stage('markdownlint') {
34 agent {
35 label 'earthly-2c-4g'
36 }
Mohammed Naser12207172024-02-05 18:49:35 -050037
Mohammed Nasere7569e02024-02-20 14:33:37 -050038 steps {
39 sh 'earthly --output +lint.markdownlint'
40 }
Mohammed Naser12207172024-02-05 18:49:35 -050041
Mohammed Nasere7569e02024-02-20 14:33:37 -050042 post {
43 always {
44 junit testResults: 'junit.xml', allowEmptyResults: true
45 }
46 }
47 }
Mohammed Nasere7569e02024-02-20 14:33:37 -050048 }
49 }
Mohammed Naser12207172024-02-05 18:49:35 -050050
Mohammed Nasere7569e02024-02-20 14:33:37 -050051 stage('unit') {
Mohammed Naser4c8e0cb2024-02-21 11:51:34 -050052 agent {
53 label 'earthly-2c-4g'
54 }
Mohammed Naser12207172024-02-05 18:49:35 -050055
Mohammed Naser4c8e0cb2024-02-21 11:51:34 -050056 steps {
57 sh 'earthly --output +unit.go'
58 }
Mohammed Naser12207172024-02-05 18:49:35 -050059
Mohammed Naser4c8e0cb2024-02-21 11:51:34 -050060 post {
61 always {
62 junit 'junit-go.xml'
Mohammed Nasere7569e02024-02-20 14:33:37 -050063 }
64 }
65 }
Mohammed Naser12207172024-02-05 18:49:35 -050066
Mohammed Nasere7569e02024-02-20 14:33:37 -050067 stage('build') {
68 parallel {
69 stage('collection') {
70 agent {
71 label 'earthly-2c-4g'
72 }
Mohammed Naser12207172024-02-05 18:49:35 -050073
Mohammed Nasere7569e02024-02-20 14:33:37 -050074 steps {
75 sh 'earthly --output +build.collection'
76 }
Mohammed Naserfdd5cee2024-02-07 23:45:52 -050077
Mohammed Nasere7569e02024-02-20 14:33:37 -050078 post {
79 success {
80 archiveArtifacts artifacts: 'dist/**'
81 }
82 }
83 }
Mohammed Nasere7569e02024-02-20 14:33:37 -050084 }
85 }
Mohammed Naser12207172024-02-05 18:49:35 -050086
Mohammed Nasere7569e02024-02-20 14:33:37 -050087 // promote images
88 // release?
89 // todo: manual pin commit to main (avoiding loop)
90 }
Mohammed Naser12207172024-02-05 18:49:35 -050091}