You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
Bash
53 lines
1.4 KiB
Bash
#!/usr/bin/env bash
|
|
# vim:ts=4:sts=4:sw=4:et
|
|
#
|
|
# Author: Hari Sekhon
|
|
# Date: 2019-11-19 16:43:00 +0000 (Tue, 19 Nov 2019)
|
|
#
|
|
# https://github.com/harisekhon/bash-tools
|
|
#
|
|
# License: see accompanying Hari Sekhon LICENSE file
|
|
#
|
|
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
|
|
#
|
|
# https://www.linkedin.com/in/harisekhon
|
|
#
|
|
|
|
# ============================================================================ #
|
|
# G C P C l o u d S h e l l C u s t o m i z a t i o n
|
|
# ============================================================================ #
|
|
|
|
# see log at /var/log/customize_environment
|
|
|
|
# /google/devshell/customize_environment_done is touched when completed
|
|
|
|
# called as root by GCP
|
|
|
|
set -euxo pipefail
|
|
srcdir="$(dirname $0)"
|
|
|
|
bash_tools="$srcdir/github/bash-tools"
|
|
|
|
if ! [ -d "$bash_tools" ]; then
|
|
parent_dir="${bash_tools%/*}"
|
|
mkdir -pv "$parent_dir"
|
|
pushd "$parent_dir"
|
|
git clone https://github.com/harisekhon/bash-tools "$bash_tools"
|
|
popd
|
|
fi
|
|
|
|
mkdir -pv ~/.cloudshell
|
|
|
|
# suppress apt-get warnings about being ephemeral, that is what this script is for
|
|
touch ~/.cloudshell/no-apt-get-warning
|
|
|
|
pushd "$bash_tools"
|
|
|
|
git pull
|
|
|
|
# not calling gcp-shell which also links because it will link config files to /root
|
|
# instead just run 'make gcp-shell' one time to set up $USER's $HOME
|
|
make system-packages
|
|
|
|
popd
|