diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-08-27 18:26:39 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-08-27 18:26:39 +0100 |
commit | 43cecacf4ff064e43da904162e06a4beeedbb472 (patch) | |
tree | f90ee1e6d921c1fde34598a58f1dea6ba4731304 /jenkinstool | |
parent | 72bac2fedc24e21d2c8bf1b5cd14598a40b5c110 (diff) | |
download | jenkinstool-43cecacf4ff064e43da904162e06a4beeedbb472.tar.gz |
Fixes for a clean Jenkins host
Diffstat (limited to 'jenkinstool')
-rwxr-xr-x | jenkinstool | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/jenkinstool b/jenkinstool index 7af0bc4..adfdbd7 100755 --- a/jenkinstool +++ b/jenkinstool @@ -73,44 +73,47 @@ commit_date() } project="%(project.name)s" -vcsworkspace="/var/lib/jenkins/workspace/${project}_localhost_vcs-update" +artifacts="%(global.artifacts)s/${project}" +project_artifacts="$artifacts/$project" +project_url="%(global.artifacts-url)s/$project" + +vcsworkspace="/var/lib/jenkins/jobs/${project}_localhost_vcs-update/workspace/" workdir="$(pwd)" if [ -e "$vcsworkspace" ] then cd "$vcsworkspace" -fi -# Split into two so that if getting the upstream version fails, the -# script fails. -version="$(upstream_version)" -version="$version.vcs$(commit_date)" + # Split into two so that if getting the upstream version fails, the + # script fails. + version="$(upstream_version)" + version="$version.vcs$(commit_date)" -artifacts="%(global.artifacts)s/${project}" -project_artifacts="$artifacts/$project" -project_url="%(global.artifacts-url)s/$project" -tarball="${project}-${version}.tar.gz" + debianversion="${version}-1" + debianurl="%(global.artifacts-url)s/debian" -debianversion="${version}-1" -debianurl="%(global.artifacts-url)s/debian" + tarball="${project}-${version}.tar.gz" -if [ -d debian ] -then - sourcepkg="$(dpkg-parsechangelog | awk '/^Source:/ { print $2 }')" - case "$sourcepkg" in - lib*) subdir=$(echo "$sourcepkg" | cut -c1-4) ;; - *) subdir=$(echo "$sourcepkg" | cut -c1) ;; - esac - poolurl="%(global.artifacts-url)s/debian/pool/main/$subdir/$sourcepkg" - - origtgz="${sourcepkg}_${version}.orig.tar.gz" - changes="${sourcepkg}_${debianversion}_source.changes" - dsc="${sourcepkg}_$debianversion.dsc" - dsc_url="$poolurl/$dsc" - archany_changes="${sourcepkg}_${version}-1_%(host.arch)s.changes" - archall_changes="${sourcepkg}_${version}-1_all.changes" -fi + if [ -d debian ] + then + sourcepkg="$(dpkg-parsechangelog | awk '/^Source:/ { print $2 }')" + case "$sourcepkg" in + lib*) subdir=$(echo "$sourcepkg" | cut -c1-4) ;; + *) subdir=$(echo "$sourcepkg" | cut -c1) ;; + esac + poolurl="%(global.artifacts-url)s/debian/pool/main/$subdir/$sourcepkg" + + origtgz="${sourcepkg}_${version}.orig.tar.gz" + changes="${sourcepkg}_${debianversion}_source.changes" + dsc="${sourcepkg}_$debianversion.dsc" + dsc_url="$poolurl/$dsc" + archany_changes="${sourcepkg}_${version}-1_%(host.arch)s.changes" + archall_changes="${sourcepkg}_${version}-1_all.changes" + fi -cd "$workdir" + cd "$workdir" +else + echo "$vcsworkspace does not exist, not setting version, etc" +fi ''' @@ -381,7 +384,7 @@ missing="$(dpkg-checkbuilddeps 2>&1 | sed 's/([^)]*)//g' | tr -s ' ' '\n')" case "$missing" in - ?*) sudo apt-get install $missing ;; + ?*) sudo apt-get install --no-remove --allow-unauthenticated -y $missing ;; esac ''') jc.add_ssh_command('\n'.join(project['build-commands'])) |