forked from webysther/aws-glue-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·46 lines (40 loc) · 1.01 KB
/
start.sh
File metadata and controls
executable file
·46 lines (40 loc) · 1.01 KB
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
#!/bin/sh
set -e
# install docker
if ! [ -x "$(command -v docker)" ]; then
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker $USER
fi
GLUE_DOCKER_ALIAS=$(cat <<-END
\n# glue-docker alias
\nalias glue='docker run -v \$PWD:/app -v ~/.aws:/home/docker/.aws -u $(id -u ${USER}):$(id -g ${USER}) -it webysther/aws-glue "\$@"'
\nalias glue-spark='docker run -v \$PWD:/app -v ~/.aws:/home/docker/.aws -u $(id -u ${USER}):$(id -g ${USER}) -it webysther/aws-glue:spark "\$@"'
\n
END
)
case $SHELL in
*/zsh)
echo $GLUE_DOCKER_ALIAS >> ~/.zshrc
;;
*/bash)
echo $GLUE_DOCKER_ALIAS >> ~/.bashrc
;;
*)
echo 'Shell not detected, create this alias inside your shell:\n'
echo $GLUE_DOCKER_ALIAS
esac
cat >&2 <<-'EOF'
Use:
- glue: Glue Python Shell
- glue-spark: Glue Pyspark
EOF
case $SHELL in
*/zsh)
echo 'Execute source ~/.zshrc to register the alias'
;;
*/bash)
echo 'Execute source ~/.bashrc to register the alias'
;;
*)
echo 'Execute source ~/.*rc to register the alias'
esac