Skip to content

Commit eb88be7

Browse files
committed
Run meta job from git triggers
1 parent 090889a commit eb88be7

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

Jenkinsfile.meta

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ properties([
33
disableResume(),
44
durabilityHint('PERFORMANCE_OPTIMIZED'),
55
pipelineTriggers([
6-
cron('@hourly'),
6+
githubPush(),
7+
cron('@daily'), // check periodically, just in case
78
]),
89
])
910

1011
node {
1112
stage('Checkout') {
12-
checkout(scmGit(
13+
checkout(poll: false, scm: scmGit(
1314
userRemoteConfigs: [[
1415
url: '[email protected]:docker-library/meta.git',
1516
credentialsId: 'docker-library-bot',
@@ -31,6 +32,30 @@ node {
3132
[$class: 'RelativeTargetDirectory', relativeTargetDir: 'meta'],
3233
],
3334
))
35+
checkout(poll: true, scm: scmGit(
36+
userRemoteConfigs: [[
37+
url: 'https://github.com/docker-library/official-images.git',
38+
name: 'origin',
39+
]],
40+
branches: [[name: '*/master']],
41+
extensions: [
42+
cleanBeforeCheckout(),
43+
cleanAfterCheckout(),
44+
[$class: 'RelativeTargetDirectory', relativeTargetDir: 'meta/.doi'],
45+
],
46+
))
47+
checkout(poll: true, scm: scmGit(
48+
userRemoteConfigs: [[
49+
url: 'https://github.com/docker-library/meta-scripts.git',
50+
name: 'origin',
51+
]],
52+
branches: [[name: '*/main']],
53+
extensions: [
54+
cleanBeforeCheckout(),
55+
cleanAfterCheckout(),
56+
[$class: 'RelativeTargetDirectory', relativeTargetDir: 'meta/.scripts'],
57+
],
58+
))
3459
sh '''
3560
git -C meta config user.name 'Docker Library Bot'
3661
git -C meta config user.email '[email protected]'
@@ -40,14 +65,6 @@ node {
4065
env.BASHBREW_LIBRARY = workspace + '/meta/.doi/library'
4166

4267
dir('meta') {
43-
// we *should* update .scripts (since that's where Jenkinsfile.* comes from, so it doesn't really make sense to update our Jenkinsfile and not have it use updated scripts), but it probably should update explicitly to the commit that the Jenkinsfile itself is coming from, if that's possible? ("latest" is probably fine)
44-
stage('Update DOI') {
45-
sh '''
46-
git submodule update --remote --merge .doi
47-
git submodule update --remote --merge .scripts
48-
'''
49-
}
50-
5168
withCredentials([
5269
// thanks to rate limits, we either have to "docker login" or look things up via our proxy
5370
string(credentialsId: 'dockerhub-public-proxy', variable: 'DOCKERHUB_PUBLIC_PROXY'),

0 commit comments

Comments
 (0)