forked from HariSekhon/DevOps-Bash-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aws_customize_environment
executable file
·46 lines (35 loc) · 1.32 KB
/
.aws_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
#!/usr/bin/env bash
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2020-12-16 14:56:05 +0000 (Wed, 16 Dec 2020)
#
# 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
#
# ============================================================================ #
# A W S C l o u d S h e l l C u s t o m i z a t i o n
# ============================================================================ #
# This is designed after the standard GCP CloudShell behaviour which is mimicked via .bash.d/aws-cloudshell.sh
# see log at /var/log/customize_environment
# called as root using sudo by .bash.d/aws-cloudshell.sh
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
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