Skip to content

Commit 40617dc

Browse files
committed
INFRA-27679 - Avoid squash to avoid new very large commit on each new
website build the newly created very large commit created on each push might be the cause of the 404 as the CDN might have problems to handle it right away. Based on https://issues.apache.org/jira/browse/INFRA-27679?focusedCommentId=18062765&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-18062765 It means that the history will grow. So we might need to ensure that the checkout of this site is either done with a depth of 1 or if already available and just a pull is done maybe to squash one time manually from time to time. see https://issues.apache.org/jira/browse/INFRA-27679?focusedCommentId=18073130&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-18073130 Signed-off-by: Aurélien Pupier <apupier@ibm.com>
1 parent 2137dfb commit 40617dc

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

Jenkinsfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919
def NODE = 'git-websites'
20-
def STOP_SQUASH_AT = '3381ad5637eb525502df319e84b7208e8f2a977b'
20+
def VALID_ASF_YAML = '3381ad5637eb525502df319e84b7208e8f2a977b'
2121

2222
pipeline {
2323
agent {
@@ -93,16 +93,11 @@ pipeline {
9393
dir('deploy/live') {
9494
deleteDir()
9595
sh 'git clone -b asf-site https://gitbox.apache.org/repos/asf/camel-website-pub.git .'
96-
sh "git -c core.editor='sed -i 2,/\$(git log --skip=9 -1 --pretty=format:%h)/s/^pick/squash/' rebase -q --interactive $STOP_SQUASH_AT" // squash all but initial and last 9 commits
9796
sh 'git rm -q -r *'
9897
sh "cp -R $WORKSPACE/camel-website/public/. ."
9998
sh 'git add .'
100-
sh "git checkout $STOP_SQUASH_AT -- ./.asf.yaml" // force revert to commit containing the valid .asf.yml
99+
sh "git checkout $VALID_ASF_YAML -- ./.asf.yaml" // force revert to commit containing the valid .asf.yml
101100
sh 'git commit -m "Website updated to $GIT_COMMIT"'
102-
sh 'git push --force origin asf-site'
103-
sh 'echo $GIT_COMMIT > rev.txt'
104-
sh 'git add rev.txt'
105-
sh 'git commit -m "Invalidate CDN cache for $GIT_COMMIT"'
106101
sh 'git push origin asf-site'
107102
}
108103
}

0 commit comments

Comments
 (0)