Skip to content

Commit

Permalink
Fix #242 overwrite symlink if present, and remove on uninstall, add t…
Browse files Browse the repository at this point in the history
…ests
  • Loading branch information
gschueler committed Jun 26, 2019
1 parent edf0312 commit 634ee94
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions dockers/install/upgrade-rpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion rd-cli-tool/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}
"""
)
}
Expand Down
9 changes: 9 additions & 0 deletions scripts/rpm-upgrade.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 634ee94

Please sign in to comment.