diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-08-07 16:07:53 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-08 02:59:31 +0200 |
commit | dc8d64b9405dfc7fbe2d4b4831947a3d92349ec5 (patch) | |
tree | 5563df965407b53412065534c68b602e16a0b6b9 | |
parent | 4dc5cc28d5371fe9b384ded805574485071740cd (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-x | scripts/jenkins/qt-jenkins-ci.pl | 4 | ||||
-rw-r--r-- | scripts/jenkins/t/05-qt-jenkins-ci.t | 4 |
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 => { |