-
-
Save DeSater/7a64c8a08d28b3fa798b0cbce7cc46c1 to your computer and use it in GitHub Desktop.
Revisions
-
DeSater revised this gist
Jun 1, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -86,6 +86,7 @@ mkdir -p /usr/jetbrains wget http://download-cf.jetbrains.com/upsource/upsource-3.0.4346.zip -O /usr/jetbrains/us_arch.zip cd /usr/jetbrains unzip us_arch.zip mv upsource-* upsource -
DeSater revised this gist
Jun 1, 2016 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -43,9 +43,6 @@ if [ "$type" == "n" ]; then exit 0 fi code=`lsb_release -a | grep Codename | sed 's/[[:space:]]//g' | cut -f2 -d:` echo -
DeSater revised this gist
Jun 1, 2016 . No changes.There are no files selected for viewing
-
DeSater revised this gist
Jun 1, 2016 . 1 changed file with 1 addition and 55 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,25 +7,16 @@ echo "=====================================================" echo " WELCOME" echo "=====================================================" echo echo "Upsource" echo "download https://www.jetbrains.com/upsource/download/" echo "read the first https://www.jetbrains.com/upsource/help/2.0/prerequisites.html" echo "install into /usr/jetbrains/upsource/" echo "=====================================" echo echo "===================================" echo "In order to continue installing need set a few properties for nginx:" base_domain=127.0.0.1 us_domain=127.0.0.1 us_port=8090 @@ -36,8 +27,6 @@ print_params() { echo "=================" echo echo "Base domain url: $base_domain" echo "Upsource domain url: $us_domain" echo "Upsource port: $us_port" echo "Cron email: $cron_email" @@ -98,18 +87,12 @@ echo mkdir -p /usr/jetbrains wget http://download-cf.jetbrains.com/upsource/upsource-3.0.4346.zip -O /usr/jetbrains/us_arch.zip unzip us_arch.zip mv upsource-* upsource chmod +x -R upsource/ cd ~ @@ -118,9 +101,6 @@ make_initd() { echo "making init.d for $1" rq="hub " cat >/etc/init.d/$1 <<EOF #! /bin/sh @@ -161,14 +141,9 @@ EOF chmod +x /etc/init.d/$1 update-rc.d $1 defaults update-rc.d $1 disable } echo make_initd upsource @@ -199,23 +174,6 @@ server { } } server { listen 80 default_server; listen [::]:80 default_server; @@ -243,14 +201,6 @@ mkdir -p /root/crons cat >/root/crons/jetbrains<<EOF #!/bin/bash service upsource start exit 0 @@ -264,14 +214,10 @@ echo "@reboot /root/crons/jetbrains" > /tmp/cron_ crontab /tmp/cron_ service upsource stop /usr/jetbrains/upsource/bin/upsource.sh configure --listen-port $us_port --base-url http://$us_domain service upsource start echo "goto setup" echo $us_domain -
DeSater revised this gist
Jun 1, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -98,8 +98,8 @@ echo mkdir -p /usr/jetbrains wget http://download-cf.jetbrains.com/hub/2.0/hub-ring-bundle-2.0.182.zip -O /usr/jetbrains/hub_arch.zip wget http://download-cf.jetbrains.com/upsource/upsource-3.0.4346.zip -O /usr/jetbrains/us_arch.zip cd /usr/jetbrains unzip hub_arch.zip -
DeSater revised this gist
Jun 1, 2016 . 1 changed file with 11 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -96,19 +96,20 @@ javac -version update-alternatives --display javac echo mkdir -p /usr/jetbrains wget http://download-cf.jetbrains.com/hub/2.0/hub-ring-bundle-2.0.182.zip -O /usr/jetbrains/hub/hub_arch.zip wget http://download-cf.jetbrains.com/upsource/upsource-3.0.4346.zip -O /usr/jetbrains/upsource/us_arch.zip cd /usr/jetbrains unzip hub_arch.zip mv hub-ring-bundle-* hub unzip us_arch.zip mv upsource-* upsource chmod +x -R upsource/ chmod +x -R hub/ cd ~ -
DeSater revised this gist
Jun 1, 2016 . 1 changed file with 1 addition and 32 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,29 +20,13 @@ echo "install into /usr/jetbrains/upsource/" echo "=====================================" echo echo "===================================" echo "In order to continue installing need set a few properties for nginx:" base_domain=127.0.0.1 hub_domain=127.0.0.1 hub_port=8091 us_domain=127.0.0.1 us_port=8090 echo -n "Cron email: " @@ -61,20 +45,7 @@ print_params() { echo "=================" } print_params echo -n "Do you want to continue? [Y|n]" read type @@ -83,9 +54,7 @@ if [ "$type" == "n" ]; then exit 0 fi us_domain=127.0.0.1 us_port=8090 code=`lsb_release -a | grep Codename | sed 's/[[:space:]]//g' | cut -f2 -d:` -
DeSater revised this gist
Jun 1, 2016 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -96,7 +96,7 @@ echo "$code" echo mkdir -p /var/tmp cd /var/tmp echo echo "Installing Java JDK 1.8" @@ -133,16 +133,15 @@ mkdir -p /usr/jetbrains/upsource wget http://download-cf.jetbrains.com/hub/2.0/hub-ring-bundle-2.0.182.zip -O /usr/jetbrains/hub/arch.zip wget http://download-cf.jetbrains.com/upsource/upsource-3.0.4346.zip -O /usr/jetbrains/upsource/arch.zip cd /usr/jetbrains/hub unzip arch.zip cd /usr/jetbrains/upsource unzip arch.zip mv upsource/* ../upsource/ chmod +x -R ../upsource/ cd ~ make_initd() { -
DeSater revised this gist
Jun 1, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -206,6 +206,7 @@ make_initd upsource echo echo "configure nginx" apt-get update apt-get install -t $code-backports nginx -y cat >./default<<EOF -
DeSater revised this gist
May 31, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -127,7 +127,8 @@ javac -version update-alternatives --display javac echo mkdir -p /usr/jetbrains/hub mkdir -p /usr/jetbrains/upsource wget http://download-cf.jetbrains.com/hub/2.0/hub-ring-bundle-2.0.182.zip -O /usr/jetbrains/hub/arch.zip wget http://download-cf.jetbrains.com/upsource/upsource-3.0.4346.zip -O /usr/jetbrains/upsource/arch.zip -
DeSater revised this gist
May 31, 2016 . 1 changed file with 8 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -32,18 +32,18 @@ fi echo "===================================" echo "In order to continue installing need set a few properties for nginx:" echo -n "Base domain url: 127.0.0.1" base_domain=127.0.0.1 echo -n "Hub domain url: " hub_domain=127.0.0.1 echo -n "hub port: " hub_port=8091 echo -n "Upsource domain url: " us_domain=127.0.0.1 echo -n "Upsource port: " us_port=8090 echo -n "Cron email: " read cron_email @@ -84,10 +84,9 @@ if [ "$type" == "n" ]; then fi echo -n "Upsource domain url: " us_domain=127.0.0.1 echo -n "Upsource port: " us_port=8090 code=`lsb_release -a | grep Codename | sed 's/[[:space:]]//g' | cut -f2 -d:` -
DeSater revised this gist
May 31, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,7 @@ echo -n "Upsource port: " read us_port echo -n "Cron email: " read cron_email print_params() { echo "=================" -
DeSater revised this gist
May 31, 2016 . 1 changed file with 9 additions and 56 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/bash apt-get install mc htop git subversion unzip wget curl -y echo echo "=====================================================" @@ -10,13 +10,7 @@ echo echo "Hub" echo "download https://www.jetbrains.com/hub/download/" echo "read instraction https://www.jetbrains.com/hub/help/1.0/Installing-Hub-with-Zip-Distribution.html" echo "install into /usr/jetbrains/hub/" echo "=====================================" echo echo "Upsource" @@ -46,11 +40,6 @@ read hub_domain echo -n "hub port: " read hub_port echo -n "Upsource domain url: " read us_domain echo -n "Upsource port: " @@ -65,17 +54,15 @@ print_params() { echo "Base domain url: $base_domain" echo "Hub domain url: $hub_domain" echo "hub port: $hub_port" echo "Upsource domain url: $us_domain" echo "Upsource port: $us_port" echo "Cron email: $cron_email" echo echo "=================" } if [ "$base_domain" == "" ] || [ "$hub_domain" == "" ] || [ "$hub_port" == "" ] || [ "$us_domain" == "" ] || [ "$us_port" == "" ]; then echo "You have made mistakes with parameters!" exit 1 fi @@ -85,13 +72,11 @@ echo echo "Base domain url: $base_domain" echo "Hub domain url: $hub_domain" echo "hub port: $hub_port" echo "Cron email: $cron_email" echo echo "=================" echo -n "Do you want to continue? [Y|n]" read type if [ "$type" == "n" ]; then @@ -143,25 +128,18 @@ javac -version update-alternatives --display javac echo mkdir -p /usr/jetbrains/{hub,upsource} wget http://download-cf.jetbrains.com/hub/2.0/hub-ring-bundle-2.0.182.zip -O /usr/jetbrains/hub/arch.zip wget http://download-cf.jetbrains.com/upsource/upsource-3.0.4346.zip -O /usr/jetbrains/upsource/arch.zip pushd /usr/jetbrains/hub unzip arch.zip popd pushd /usr/jetbrains/upsource unzip arch.zip mv upsource/* ../upsource/ chmod +x -R ../upsource/ popd popd @@ -219,9 +197,6 @@ EOF fi } echo make_initd hub @@ -234,23 +209,6 @@ echo "configure nginx" apt-get install -t $code-backports nginx -y cat >./default<<EOF server { listen 80; listen [::]:80; @@ -323,7 +281,6 @@ while [ \$status -eq 404 ]; do echo "hub status \$status" done service upsource start exit 0 @@ -337,18 +294,14 @@ echo "@reboot /root/crons/jetbrains" > /tmp/cron_ crontab /tmp/cron_ service upsource stop service hub stop /usr/jetbrains/hub/bin/hub.sh configure --listen-port $hub_port --base-url http://$hub_domain /usr/jetbrains/upsource/bin/upsource.sh configure --listen-port $us_port --base-url http://$us_domain service hub start service upsource start echo "goto setup" echo $hub_domain echo $us_domain -
artzub revised this gist
Dec 24, 2015 . 1 changed file with 4 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -143,18 +143,13 @@ javac -version update-alternatives --display javac echo mkdir -p /usr/jetbrains/{youtrack,hub,upsource} wget http://download.jetbrains.com/hub/1.0/hub-ring-bundle-1.0.749.zip -O /usr/jetbrains/hub/arch.zip wget http://download.jetbrains.com/charisma/youtrack-6.5.16981.zip -O /usr/jetbrains/youtrack/arch.zip wget http://download.jetbrains.com/upsource/upsource-2.5.4995.zip -O /usr/jetbrains/upsource/arch.zip pushd /usr/jetbrains/hub unzip arch.zip -
artzub revised this gist
Dec 24, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -144,11 +144,11 @@ update-alternatives --display javac echo wget http://download.jetbrains.com/hub/1.0/hub-ring-bundle-1.0.749.zip wget http://download.jetbrains.com/charisma/youtrack-6.5.16981.zip wget http://download.jetbrains.com/upsource/upsource-2.5.4995.zip mkdir -p /usr/jetbrains/{youtrack,hub,upsource} -
artzub revised this gist
Sep 14, 2015 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -218,8 +218,9 @@ EOF chmod +x /etc/init.d/$1 update-rc.d $1 defaults if [ "$1" != "hub" ]; then update-rc.d $1 disable fi } -
artzub revised this gist
Sep 14, 2015 . 1 changed file with 15 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -59,6 +59,21 @@ read us_port echo -n "Cron email: " read $cron_email print_params() { echo "=================" echo echo "Base domain url: $base_domain" echo "Hub domain url: $hub_domain" echo "hub port: $hub_port" echo "Youtrack domain url: $yt_domain" echo "Youtrack port: $yt_port" echo "Upsource domain url: $us_domain" echo "Upsource port: $us_port" echo "Cron email: $cron_email" echo echo "=================" } if [ "$base_domain" == "" ] || [ "$hub_domain" == "" ] || [ "$hub_port" == "" ] || [ "$yt_domain" == "" ] || [ "$yt_port" == "" ] || [ "$us_domain" == "" ] || [ "$us_port" == "" ]; then echo "You have mistake into parameters!" exit 1 -
artzub revised this gist
Sep 14, 2015 . 1 changed file with 11 additions and 16 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/bash apt-get install mc htop git unzip wget curl -y echo echo "=====================================================" @@ -59,27 +59,22 @@ read us_port echo -n "Cron email: " read $cron_email if [ "$base_domain" == "" ] || [ "$hub_domain" == "" ] || [ "$hub_port" == "" ] || [ "$yt_domain" == "" ] || [ "$yt_port" == "" ] || [ "$us_domain" == "" ] || [ "$us_port" == "" ]; then echo "You have mistake into parameters!" exit 1 fi echo "Please check data" echo "=================" echo echo "Base domain url: $base_domain" echo "Hub domain url: $hub_domain" echo "hub port: $hub_port" echo "Youtrack domain url: $yt_domain" echo "Youtrack port: $yt_port" echo "Cron email: $cron_email" echo echo "=================" echo -n "Do you continue? [Y|n]" read type -
artzub revised this gist
Sep 14, 2015 . 1 changed file with 15 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -59,22 +59,27 @@ read us_port echo -n "Cron email: " read $cron_email print_params() { echo "=================" echo echo "Base domain url: $base_domain" echo "Hub domain url: $hub_domain" echo "hub port: $hub_port" echo "Youtrack domain url: $yt_domain" echo "Youtrack port: $yt_port" echo "Cron email: $cron_email" echo echo "=================" } if [ "$base_domain" == "" ] || [ "$hub_domain" == "" ] || [ "$hub_port" == "" ] || [ "$yt_domain" == "" ] || [ "$yt_port" == "" ] || [ "$us_domain" == "" ] || [ "$us_port" == "" ]; then echo "You have mistake into parameters!" print_params exit 1 fi echo "Please check data" print_params echo -n "Do you continue? [Y|n]" read type -
artzub revised this gist
Sep 14, 2015 . 1 changed file with 9 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -56,6 +56,9 @@ read us_domain echo -n "Upsource port: " read us_port echo -n "Cron email: " read $cron_email if [ "$base_domain" == "" ] || [ "$hub_domain" == "" ] || [ "$hub_port" == "" ] || [ "$yt_domain" == "" ] || [ "$yt_port" == "" ] || [ "$us_domain" == "" ] || [ "$us_port" == "" ]; then echo "You have mistake into parameters!" exit 1 @@ -69,6 +72,7 @@ echo "Hub domain url: $hub_domain" echo "hub port: $hub_port" echo "Youtrack domain url: $yt_domain" echo "Youtrack port: $yt_port" echo "Cron email: $cron_email" echo echo "=================" @@ -304,7 +308,7 @@ status=404 while [ \$status -eq 404 ]; do echo "wait hub..." sleep 60 status=\`curl -s -o /dev/null -w "%{http_code}" http://$hub_domain/hub\` echo "hub status \$status" done @@ -316,7 +320,7 @@ EOF chmod +x /root/crons/jetbrains echo "MAILTO=$cron_email" > /tmp/cron_ echo "" >> /tmp/cron_ echo "@reboot /root/crons/jetbrains" > /tmp/cron_ crontab /tmp/cron_ @@ -325,9 +329,9 @@ service upsource stop service youtrack stop service hub stop /usr/jetbrains/hub/bin/hub.sh configure --listen-port $hub_port --base-url http://$hub_domain /usr/jetbrains/youtrack/bin/youtrack.sh configure --listen-port $yt_port --base-url http://$yt_domain /usr/jetbrains/upsource/bin/upsource.sh configure --listen-port $us_port --base-url http://$us_domain service hub start service youtrack start -
artzub created this gist
Sep 14, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,339 @@ #!/bin/bash apt-get install mc htop git unzip wget -y echo echo "=====================================================" echo " WELCOME" echo "=====================================================" echo echo "Hub" echo "download https://www.jetbrains.com/hub/download/" echo "read instraction https://www.jetbrains.com/hub/help/1.0/Installing-Hub-with-Zip-Distribution.html" echo "install into /usr/jetbrains/youtrack/" echo "=====================================" echo echo "YouTrack" echo "download https://www.jetbrains.com/youtrack/download/get_youtrack.html" echo "read instraction https://confluence.jetbrains.com/display/YTD65/Installing+YouTrack+with+ZIP+Distribution#InstallingYouTrackwithZIPDistribution-InstallingNewYouTrackServer" echo "install into /usr/jetbrains/youtrack/" echo "=====================================" echo echo "Upsource" echo "download https://www.jetbrains.com/upsource/download/" echo "read the first https://www.jetbrains.com/upsource/help/2.0/prerequisites.html" echo "install into /usr/jetbrains/upsource/" echo "=====================================" echo type="y" echo "Y - will be installing in the auto mode: download all needs, config nginx and others" echo -n "Do you want to continue? [Y|n]: " read type if [ "$type" == "n" ]; then exit 0 fi echo "===================================" echo "In order to continue installing need set a few properties for nginx:" echo -n "Base domain url: " read base_domain echo -n "Hub domain url: " read hub_domain echo -n "hub port: " read hub_port echo -n "Youtrack domain url: " read yt_domain echo -n "Youtrack port: " read yt_port echo -n "Upsource domain url: " read us_domain echo -n "Upsource port: " read us_port if [ "$base_domain" == "" ] || [ "$hub_domain" == "" ] || [ "$hub_port" == "" ] || [ "$yt_domain" == "" ] || [ "$yt_port" == "" ] || [ "$us_domain" == "" ] || [ "$us_port" == "" ]; then echo "You have mistake into parameters!" exit 1 fi echo "Please check data" echo "=================" echo echo "Base domain url: $base_domain" echo "Hub domain url: $hub_domain" echo "hub port: $hub_port" echo "Youtrack domain url: $yt_domain" echo "Youtrack port: $yt_port" echo echo "=================" echo -n "Do you continue? [Y|n]" read type if [ "$type" == "n" ]; then exit 0 fi echo -n "Upsource domain url: " read us_domain echo -n "Upsource port: " read us_port code=`lsb_release -a | grep Codename | sed 's/[[:space:]]//g' | cut -f2 -d:` echo echo "debian codename:" echo "$code" echo mkdir -p /var/tmp pushd /var/tmp echo echo "Installing Java JDK 1.8" echo if [ "$code" != "jessie" ]; then echo "from oracle site" echo url=http://download.oracle.com/otn-pub/java/jdk/8u60-b27/ java_version=jdk-8u60-linux-x64.tar.gz wget -c -O "$java_version" --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" "$url$java_version" mkdir -p /opt/jdk tar -zxf $java_version -C /opt/jdk update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_60/bin/java 100 update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_60/bin/javac 100 else apt-get install java8-jdk -y fi; echo java -version update-alternatives --display java javac -version update-alternatives --display javac echo wget http://download.jetbrains.com/hub/1.0/hub-ring-bundle-1.0.529.zip wget https://download.jetbrains.com/charisma/youtrack-6.5.16713.zip wget http://download.jetbrains.com/upsource/upsource-2.0.3682.zip mkdir -p /usr/jetbrains/{youtrack,hub,upsource} mv ./hub-ring-bundle-1.0.529.zip /usr/jetbrains/hub/arch.zip mv ./youtrack-6.5.16655.zip /usr/jetbrains/youtrack/arch.zip mv ./upsource-2.0.3682.zip /usr/jetbrains/upsource/arch.zip pushd /usr/jetbrains/hub unzip arch.zip popd pushd /usr/jetbrains/youtrack unzip arch.zip popd pushd /usr/jetbrains/upsource unzip arch.zip mv Upsource/* ../upsource/ chmod +x -R ../upsource/ popd popd make_initd() { echo "making init.d for $1" rq="hub " if [ "$1" == "hub" ]; then rq="" fi cat >/etc/init.d/$1 <<EOF #! /bin/sh ### BEGIN INIT INFO # Provides: $1 # Required-Start: $rq\$local_fs \$remote_fs \$network \$syslog \$named # Required-Stop: $rq\$local_fs \$remote_fs \$network \$syslog \$named # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: initscript for $1 # Description: initscript for $1 ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=$1 SCRIPT=/usr/jetbrains/\$NAME/bin/\$NAME.sh do_start() { \$SCRIPT start soft } case "\$1" in start) do_start ;; stop|restart|status|run|rerun|help) \$SCRIPT \$1 \$2 ;; *) echo "Usage: sudo /etc/init.d/$1 {start|stop|restart|status|run|rerun}" >&2 exit 1 ;; esac exit 0 EOF chmod +x /etc/init.d/$1 if [ "$1" == "hub" ]; then update-rc.d $1 defaults fi } echo make_initd youtrack echo make_initd hub echo make_initd upsource echo echo "configure nginx" apt-get install -t $code-backports nginx -y cat >./default<<EOF server { listen 80; listen [::]:80; server_name $yt_domain; server_tokens off; location / { proxy_set_header X-Forwarded-Host \$http_host; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto \$scheme; proxy_http_version 1.1; proxy_pass http://localhost:$yt_port/; } } server { listen 80; listen [::]:80; server_name $us_domain; server_tokens off; location / { proxy_set_header X-Forwarded-Host \$http_host; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto \$scheme; proxy_http_version 1.1; proxy_set_header Upgrade \$http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://localhost:$us_port/; } } server { listen 80; listen [::]:80; server_name $hub_domain; server_tokens off; location / { proxy_set_header X-Forwarded-Host \$http_host; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto \$scheme; proxy_http_version 1.1; proxy_pass http://localhost:$hub_port/; } } server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.html index.htm index.nginx-debian.html; server_name $base_domain; server_tokens off; location / { try_files \$uri \$uri/ =404; } } EOF mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.old cp -f default /etc/nginx/sites-available/default service nginx restart mkdir -p /root/crons cat >/root/crons/jetbrains<<EOF #!/bin/bash status=404 while [ \$status -eq 404 ]; do echo "wait hub..." sleep 60 status=\`curl -s -o /dev/null -w "%{http_code}" http://hub.extrogramming.com/hub\` echo "hub status \$status" done service youtrack start service upsource start exit 0 EOF chmod +x /root/crons/jetbrains echo "[email protected]" > /tmp/cron_ echo "" >> /tmp/cron_ echo "@reboot /root/crons/jetbrains" > /tmp/cron_ crontab /tmp/cron_ service upsource stop service youtrack stop service hub stop /usr/jetbrains/hub/bin/hub.sh configure --listen-port $hub_port --base-url http://hub.extrogramming.com /usr/jetbrains/youtrack/bin/youtrack.sh configure --listen-port $yt_port --base-url http://yt.extrogramming.com /usr/jetbrains/upsource/bin/upsource.sh configure --listen-port $us_port --base-url http://us.extrogramming.com service hub start service youtrack start service upsource start echo "goto setup" echo $hub_domain echo $yt_domain echo $us_domain