]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dashboard-pull-requests: only install google chrome on amd64
authorKefu Chai <kchai@redhat.com>
Sat, 1 Jun 2019 14:22:06 +0000 (22:22 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 3 Jun 2019 09:04:22 +0000 (17:04 +0800)
and remove the repo settings after done with installation

Signed-off-by: Kefu Chai <kchai@redhat.com>
ceph-dashboard-pull-requests/setup/setup

index b278a40c1982d32b80e9565b12a4b5a23e53f885..c1635cae4d9b6d47deb7c16be3a44086684343df 100644 (file)
@@ -1,23 +1,28 @@
 #!/bin/bash
 set -ex
 
+if [[ ! $(arch) =~ (i386|x86_64|amd64) ]]; then
+    # google chrome is only available on amd64
+    exit
+fi
+
 if grep -q  debian /etc/*-release; then
     sudo bash -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
-    wget https://dl.google.com/linux/linux_signing_key.pub
-    sudo apt-key add linux_signing_key.pub
+    curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
     sudo apt-get update
     sudo apt-get install -y google-chrome-stable
     sudo apt-get install -y python-requests python-openssl python-jinja2 python-jwt
-
+    sudo rm /etc/apt/sources.list.d/google-chrome.list
 elif grep -q rhel /etc/*-release; then
     sudo dd of=/etc/yum.repos.d/google-chrome.repo status=none <<EOF
 [google-chrome]
 name=google-chrome
-baseurl=https://dl.google.com/linux/chrome/rpm/stable/x86_64
+baseurl=https://dl.google.com/linux/chrome/rpm/stable/\$basearch
 enabled=1
 gpgcheck=1
-gpgkey=https://dl.google.com/linux/linux_signing_key.pub
+gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
 EOF
     sudo yum install -y google-chrome-stable
+    sudo rm /etc/apt/sources.list.d/google-chrome.list
     sudo yum install -y python-requests pyOpenSSL python-jinja2 python-jwt
 fi