-
Notifications
You must be signed in to change notification settings - Fork 12
/
compute.sh
executable file
·36 lines (32 loc) · 1.2 KB
/
compute.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2018
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
set -o nounset
set -o pipefail
set -o errexit
if [[ ${OS_DEBUG:-false} == "true" ]]; then
export PKG_DEBUG=true
set -o xtrace
fi
_start=$(date +%s)
trap 'printf "Compute installation process: %s secs\n" "$(($(date +%s)-_start))"' EXIT
# Install dependencies
if ! command -v curl; then
# shellcheck disable=SC1091
source /etc/os-release || source /usr/lib/os-release
case ${ID,,} in
ubuntu | debian)
sudo apt-get update
sudo apt-get install -y -qq -o=Dpkg::Use-Pty=0 --no-install-recommends curl
;;
esac
fi
# NOTE: Shorten link -> https://github.com/electrocucaracha/pkg-mgr_scripts
curl -fsSL http://bit.ly/install_bin | PKG_BINDEP_PROFILE=compute bash
sudo -E "$(command -v pip)" install docker