brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [2/3] brooklyn-library git commit: BROOKLYN-350 Improving the download of external packages
Date Wed, 28 Sep 2016 09:55:08 GMT
BROOKLYN-350 Improving the download of external packages

- pgdg package download uses commandToDownloadUrlAs() instead direct
  call to curl. commandToDownloadUrlAs() handles HTTP location
  redirects as imposed by the new upstream HTTPS based repo server
- APT public key is imported directly instead download and than import

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/3e2eeb95
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/3e2eeb95
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/3e2eeb95

Branch: refs/heads/master
Commit: 3e2eeb95e8728f0d90a9808c7625e46b18450997
Parents: c4a32eb
Author: Yavor Yanchev <yavor@yanchev.com>
Authored: Tue Sep 27 19:54:28 2016 +0300
Committer: Yavor Yanchev <yavor@yanchev.com>
Committed: Tue Sep 27 19:54:28 2016 +0300

----------------------------------------------------------------------
 .../entity/database/postgresql/PostgreSqlSshDriver.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/3e2eeb95/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
b/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
index c7c0c3f..53658d7 100644
--- a/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
+++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
@@ -19,7 +19,6 @@
 package org.apache.brooklyn.entity.database.postgresql;
 
 import static java.lang.String.format;
-import static org.apache.brooklyn.util.ssh.BashCommands.INSTALL_CURL;
 import static org.apache.brooklyn.util.ssh.BashCommands.alternativesGroup;
 import static org.apache.brooklyn.util.ssh.BashCommands.chainGroup;
 import static org.apache.brooklyn.util.ssh.BashCommands.dontRequireTtyForSudo;
@@ -31,6 +30,7 @@ import static org.apache.brooklyn.util.ssh.BashCommands.installPackage;
 import static org.apache.brooklyn.util.ssh.BashCommands.sudo;
 import static org.apache.brooklyn.util.ssh.BashCommands.sudoAsUser;
 import static org.apache.brooklyn.util.ssh.BashCommands.warn;
+import static org.apache.brooklyn.util.ssh.BashCommands.commandToDownloadUrlAs;
 
 import java.io.File;
 import java.io.IOException;
@@ -226,16 +226,16 @@ public class PostgreSqlSshDriver extends AbstractSoftwareProcessSshDriver
implem
         }
 
         return chainGroup(
-                INSTALL_CURL,
-                sudo(format("curl http://yum.postgresql.org/%s/redhat/rhel-%s-%s/pgdg-%s%s-%s.noarch.rpm
-o pgdg.rpm", majorMinorVersion, osMajorVersion, arch, osName, shortVersion, version)),
+                sudo(commandToDownloadUrlAs(
+                        format("http://yum.postgresql.org/%s/redhat/rhel-%s-%s/pgdg-%s%s-%s.noarch.rpm",
majorMinorVersion, osMajorVersion, arch, osName, shortVersion, version),
+                        "pgdg.rpm")),
                 sudo("rpm -Uvh pgdg.rpm")
             );
     }
 
     private String getAptRepository() {
         return chainGroup(
-                INSTALL_CURL,
-                "curl http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo tee -a
apt-key add",
+                sudo("apt-key adv --fetch-keys http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc"),
                 "echo \"deb http://apt.postgresql.org/pub/repos/apt/ $(sudo lsb_release --codename
--short)-pgdg main\" | sudo tee -a /etc/apt/sources.list.d/postgresql.list"
             );
     }


Mime
View raw message