Last active
August 29, 2015 14:20
-
-
Save utamas/a0a00631f9bee524f91a to your computer and use it in GitHub Desktop.
Install envornment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
################################################################################ | |
# To use this script copy and paste the following line without the "#" character | |
# into a "git bash" - installed by msysgit (http://msysgit.github.io/) | |
################################################################################ | |
# curl -sLo env-setup http://epa.ms/env-setup && source env-setup | |
################################################################################ | |
host="https://git.epam.com" | |
if [ ! -z "$1" ] ; then | |
host="$1" | |
fi | |
read -p "What is your git TOKEN (copy paste from $host/profile/account)? " TOKEN | |
if [ ${#TOKEN} -ne 20 ] ; then | |
echo | |
echo "[ERROR] your private token should be 20 characters long" | |
echo "run this script again, and make sure that you use the token from:" | |
echo " $host/profile/account" | |
exit -1 | |
fi | |
( | |
work_folder='/tmp/environment-install' | |
rm -Rf $work_folder >> /tmp/environment-install.logs 2>&1 | |
mkdir -p $work_folder >> /tmp/environment-install.logs 2>&1 | |
cd $work_folder >> /tmp/environment-install.logs 2>&1 | |
curl -o archive.zip -L $host/api/v3/projects/6393/repository/archive.zip?private_token=$TOKEN >> /tmp/environment-install.logs 2>&1 | |
unzip archive.zip >> /tmp/environment-install.logs 2>&1 | |
if [[ $? -eq 0 ]]; then | |
cd ui-gen-environment.git >> /tmp/environment-setup.logs 2>&1 | |
source install | |
fi | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment