Last active
February 27, 2021 18:44
-
-
Save fmbenhassine/045b2f43be8d422f08476aa39978af29 to your computer and use it in GitHub Desktop.
Cloud9 workspace post install script for Java development
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
| sudo apt-get autoremove | |
| sudo apt-get update | |
| echo "Checking git version" | |
| git --version | |
| echo "Installing Jekyll" | |
| gem install jekyll | |
| cd ~/ && mkdir tools && cd tools | |
| echo "Installing Java 8" | |
| wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u101-b13/jdk-8u101-linux-x64.tar.gz | |
| tar -xzf jdk-8u101-linux-x64.tar.gz | |
| export JAVA_HOME=/home/ubuntu/tools/jdk1.8.0_101 | |
| export PATH=$JAVA_HOME/bin:$PATH | |
| rm jdk-8u101-linux-x64.tar.gz | |
| java -version | |
| echo "Installing Maven 3" | |
| wget http://apache.mirror.anlx.net/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip | |
| unzip apache-maven-3.3.9-bin.zip | |
| export MVN_HOME=/home/ubuntu/tools/apache-maven-3.3.9 | |
| export PATH=$MVN_HOME/bin:$PATH | |
| rm apache-maven-3.3.9-bin.zip | |
| mvn -version | |
| echo "Installing MongoDB v3.2" | |
| # from https://docs.c9.io/docs/setup-a-database#mongodb | |
| # and https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb | |
| # see: https://community.c9.io/t/updating-mongodb/3914 and https://community.c9.io/t/setting-up-mongodb/1717 | |
| sudo apt-get remove mongodb-org mongodb-org-server | |
| sudo rm -rf /usr/bin/mongo* | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
| echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
| sudo apt-get update | |
| sudo touch /etc/init.d/mongod | |
| sudo apt-get install -y mongodb-org mongodb-org-server | |
| sudo apt-get install mongodb-org-server | |
| echo "Adding alias for mongod with correct IP and No Journal" | |
| alias mongod="mongod --bind_ip=$IP --nojournal" | |
| # start mongod : sudo service mongod start | |
| # check mongod log: tail -f /var/log/mongodb/mongod.log | |
| # stop mongod : sudo service mongod stop | |
| # restart mongod : sudo service mongod restart | |
| echo "Happy coding!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment