summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2012-08-07 16:07:53 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-08 02:59:31 +0200
commitdc8d64b9405dfc7fbe2d4b4831947a3d92349ec5 (patch)
tree5563df965407b53412065534c68b602e16a0b6b9
parent4dc5cc28d5371fe9b384ded805574485071740cd (diff)
qt-jenkins-ci: fixed update of latest, latest-success links
We were running ln with the `-f' parameter with the intent of overwriting existing links. However, if the link target was a directory, ln would dereference the link and create a link inside the directory. Therefore, for a new project, we'd create the first link: latest -> build_00001 ... as expected, but subsequent links would be created _inside_ of the 'latest' (actually build_00001) directory: build_00001/build_00002 -> build_00002 build_00001/build_00003 -> build_00003 ... This is fixed by passing the -n / --no-dereference option to the ln commands. Change-Id: I1f188567d2580451236d5b90f86a737143860bb7 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
-rwxr-xr-xscripts/jenkins/qt-jenkins-ci.pl4
-rw-r--r--scripts/jenkins/t/05-qt-jenkins-ci.t4
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/jenkins/qt-jenkins-ci.pl b/scripts/jenkins/qt-jenkins-ci.pl
index 5a1a007e..48d07394 100755
--- a/scripts/jenkins/qt-jenkins-ci.pl
+++ b/scripts/jenkins/qt-jenkins-ci.pl
@@ -1273,9 +1273,9 @@ sub upload_logs
map { $_->join() } @coro;
# Create the 'latest' and possibly 'latest-success' links
- my $cmd = qq{cd "$dest_project_path" && ln -sf "$dest_build_number" latest};
+ my $cmd = qq{cd "$dest_project_path" && ln -snf "$dest_build_number" latest};
if ($result eq 'SUCCESS') {
- $cmd .= qq{ && ln -sf "$dest_build_number" latest-success};
+ $cmd .= qq{ && ln -snf "$dest_build_number" latest-success};
}
do_robust_cmd(
diff --git a/scripts/jenkins/t/05-qt-jenkins-ci.t b/scripts/jenkins/t/05-qt-jenkins-ci.t
index c65144e3..59761d8a 100644
--- a/scripts/jenkins/t/05-qt-jenkins-ci.t
+++ b/scripts/jenkins/t/05-qt-jenkins-ci.t
@@ -364,12 +364,12 @@ END_JSON
# command to setup 'latest', 'latest-success' links (successful build only)
my $ln_latest_and_latest_success_cmd =
'[ssh] [-oBatchMode=yes] [-p] [555] [logs.example.com] '
- .'[cd "/var/www/ci/Some_Job" && ln -sf "build_00005" latest && ln -sf "build_00005" latest-success]';
+ .'[cd "/var/www/ci/Some_Job" && ln -snf "build_00005" latest && ln -snf "build_00005" latest-success]';
# command to setup 'latest' link (unsuccessful build only - no 'latest-success')
my $ln_latest_cmd =
'[ssh] [-oBatchMode=yes] [-p] [555] [logs.example.com] '
- .'[cd "/var/www/ci/Some_Job" && ln -sf "build_00005" latest]';
+ .'[cd "/var/www/ci/Some_Job" && ln -snf "build_00005" latest]';
my $mock = do_mocks(
url_to_content => {