forked from HariSekhon/DevOps-Bash-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.customize_environment
executable file
·51 lines (38 loc) · 1.4 KB
/
.customize_environment
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/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/DevOps-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
bash_tools="$HOME/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/DevOps-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