Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8977fad0 authored by Nicolás Alvarez's avatar Nicolás Alvarez

staticweb: avoid transferring unchanged files to the webserver

Since we're building websites from scratch on clean environments, even
cloning the git repository every time, every file will have a recent
modification timestamp. This means rsync will copy every file to the
webserver even if it didn't actually change. Also, clients making
conditional requests with If-Modified-Since will get the whole file
rather than 304 Not Modified.

For example, any tiny typo fix in kde.org will touch every page and image
in it, and the hackergotchi images in planet.kde.org will have their
modtime touched every hour.

This commit adds -c / --checksum to the rsync command. It makes rsync
calculate the hash of the local and remote file, and transfer it only if
it actually changed, rather than only comparing size and modtime. That way
if a file didn't change in the source git repository, or if the generation
process created an file identical to the previous version, it will not be
updated during deployment.
parent 4972fff9
......@@ -42,7 +42,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" dist/ sitedeployer@nicoda.kde.org:${deploypath}
rsync -Havc --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" dist/ sitedeployer@nicoda.kde.org:${deploypath}
"""
}
}
......
......@@ -29,7 +29,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" ./ sitedeployer@nicoda.kde.org:${deploypath}
rsync -Havc --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" ./ sitedeployer@nicoda.kde.org:${deploypath}
"""
}
}
......
......@@ -28,7 +28,7 @@ timestamps {
// Deploy the website!
stage('Publishing to CDN') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" webfont/dist/ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" webfont/dist/ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -37,7 +37,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" _site/ sitedeployer@nicoda.kde.org:${deploypath}
rsync -Havc --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" _site/ sitedeployer@nicoda.kde.org:${deploypath}
"""
}
}
......
......@@ -27,7 +27,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -27,7 +27,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -33,7 +33,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -35,7 +35,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -44,7 +44,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" site/ sitedeployer@nicoda.kde.org:${deploypath}
rsync -Havc --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" site/ sitedeployer@nicoda.kde.org:${deploypath}
"""
}
}
......
......@@ -43,7 +43,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete --filter "protect applications/" --filter "protect announcements/releases" -e "ssh -i $HOME/WebsitePublishing/website-upload.key" ./ sitedeployer@nicoda.kde.org:${deploypath}
rsync -Havc --delete --filter "protect applications/" --filter "protect announcements/releases" -e "ssh -i $HOME/WebsitePublishing/website-upload.key" ./ sitedeployer@nicoda.kde.org:${deploypath}
"""
}
}
......
......@@ -39,7 +39,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" _site/ sitedeployer@nicoda.kde.org:${deploypath}
rsync -Havc --delete -e "ssh -i $HOME/WebsitePublishing/website-upload.key" _site/ sitedeployer@nicoda.kde.org:${deploypath}
"""
}
}
......
......@@ -27,7 +27,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -31,7 +31,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" _site/ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -29,7 +29,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" ./ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" ./ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -34,7 +34,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete -e "ssh -i ${deploykey}" ./ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc --delete -e "ssh -i ${deploykey}" ./ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -29,7 +29,7 @@ timestamps {
// Deploy the website!
stage('Publishing to CDN') {
sh """
rsync -Hav -e "ssh -i ${deploykey}" build/ ${deployuser}@${deployhost}:${deploypath}
rsync -Havc -e "ssh -i ${deploykey}" build/ ${deployuser}@${deployhost}:${deploypath}
"""
}
}
......
......@@ -26,7 +26,7 @@ timestamps {
// Deploy the website!
stage('Publishing Website') {
sh """
rsync -Hav --delete --filter "protect config/localconfig.php" -e "ssh -i $HOME/WebsitePublishing/website-upload.key" src/server/ sitedeployer@nicoda.kde.org:${deploypath}
rsync -Havc --delete --filter "protect config/localconfig.php" -e "ssh -i $HOME/WebsitePublishing/website-upload.key" src/server/ sitedeployer@nicoda.kde.org:${deploypath}
"""
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment