Skip to content

Commit fceb68f

Browse files
authored
Merge pull request #116 from infosiftr/faster-reconcile
Run meta job from git triggers
2 parents 253316d + eb88be7 commit fceb68f

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',
@@ -32,6 +33,30 @@ node {
3233
[$class: 'RelativeTargetDirectory', relativeTargetDir: 'meta'],
3334
],
3435
))
36+
checkout(poll: true, scm: scmGit(
37+
userRemoteConfigs: [[
38+
url: 'https://github.com/docker-library/official-images.git',
39+
name: 'origin',
40+
]],
41+
branches: [[name: '*/master']],
42+
extensions: [
43+
cleanBeforeCheckout(),
44+
cleanAfterCheckout(),
45+
[$class: 'RelativeTargetDirectory', relativeTargetDir: 'meta/.doi'],
46+
],
47+
))
48+
checkout(poll: true, scm: scmGit(
49+
userRemoteConfigs: [[
50+
url: 'https://github.com/docker-library/meta-scripts.git',
51+
name: 'origin',
52+
]],
53+
branches: [[name: '*/main']],
54+
extensions: [
55+
cleanBeforeCheckout(),
56+
cleanAfterCheckout(),
57+
[$class: 'RelativeTargetDirectory', relativeTargetDir: 'meta/.scripts'],
58+
],
59+
))
3560
sh '''
3661
git -C meta config user.name 'Docker Library Bot'
3762
git -C meta config user.email '[email protected]'
@@ -41,14 +66,6 @@ node {
4166
env.BASHBREW_LIBRARY = workspace + '/meta/.doi/library'
4267

4368
dir('meta') {
44-
// 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)
45-
stage('Update DOI') {
46-
sh '''
47-
git submodule update --remote --merge .doi
48-
git submodule update --remote --merge .scripts
49-
'''
50-
}
51-
5269
withCredentials([
5370
// thanks to rate limits, we either have to "docker login" or look things up via our proxy
5471
string(credentialsId: 'dockerhub-public-proxy', variable: 'DOCKERHUB_PUBLIC_PROXY'),

0 commit comments

Comments
 (0)