diff --git a/.travis.yml b/.travis.yml index 2e3e2290..fa8220f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,8 @@ jobs: script: bash scripts/deb-install.sh - stage: rpm install test script: bash scripts/rpm-install.sh + - stage: rpm upgrade test + script: bash scripts/rpm-upgrade.sh after_success: - mkdir $HOME/.gnupg - openssl aes-256-cbc -K $encrypted_168997f84686_key -iv $encrypted_168997f84686_iv diff --git a/dockers/install/upgrade-rpm/Dockerfile b/dockers/install/upgrade-rpm/Dockerfile new file mode 100644 index 00000000..aa9606fa --- /dev/null +++ b/dockers/install/upgrade-rpm/Dockerfile @@ -0,0 +1,15 @@ +FROM centos:6 +#ARG OLDVER +RUN yum -y update +RUN yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel +RUN curl -sS -f -L -o /etc/yum.repos.d/bintray.repo https://bintray.com/rundeck/rundeck-rpm/rpm + +RUN yum -y install rundeck-cli + +RUN rd pond + +COPY rundeck-cli-noarch.rpm /root/rundeck-cli-noarch.rpm + +RUN rpm -U /root/rundeck-cli-noarch.rpm + +CMD rd pond diff --git a/rd-cli-tool/build.gradle b/rd-cli-tool/build.gradle index 02d8010f..28a54a08 100644 --- a/rd-cli-tool/build.gradle +++ b/rd-cli-tool/build.gradle @@ -168,7 +168,12 @@ ospackage { //symlink /usr/bin/rd to the rd script postInstall( """ -/bin/ln -s \${RPM_INSTALL_PREFIX:-${distInstallPath}}/${archivedir}/bin/${applicationName} /usr/bin/${applicationName} +/bin/ln -sf \${RPM_INSTALL_PREFIX:-${distInstallPath}}/${archivedir}/bin/${applicationName} /usr/bin/${applicationName} +""" + ) + postUninstall( + """ +rm /usr/bin/${applicationName} """ ) } diff --git a/scripts/rpm-upgrade.sh b/scripts/rpm-upgrade.sh new file mode 100644 index 00000000..723f9cf6 --- /dev/null +++ b/scripts/rpm-upgrade.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euo pipefail + +rpmfile=$(ls rd-cli-tool/build/distributions/rundeck-cli-*.noarch.rpm) + +cp $rpmfile dockers/install/upgrade-rpm/rundeck-cli-noarch.rpm +docker build dockers/install/upgrade-rpm -t rdcli-rpm-upgrade +docker run -it rdcli-rpm-upgrade rd