11 KiB
Build Guide Xubuntu
Background
This guide is designed to set up and install all the components required for a development environment on Xubuntu.
Prerequisites
Xubuntu operating system
Xubuntu is an elegant and easy-to-use Unix-like operating system. Xubuntu comes with Xfce, which is a stable, light and configurable desktop environment.
Download Yakkety Yak the 16.10 xubuntu-16.04-desktop-amd64.iso
Access to the team foundation server for the AODB Mobile project which contains the git repository and project documentation.
Transport AODB Mobile Team Foundation Server
Access to the AODB Mobile project Thycotic Secret Server which contains all account information, usernames and passwords.
Transport AODB Mobile Thycotic Secret Server
Contents
Install and configure the following components:
- Update and Upgrade
- Sophos
- Java SDK
- Android command line SDK Tools
- Development Tools
- Node Version Manager
- Node
- Node Packages
- Sinopia
- PM2 Process Management
- WebStorm
- Visual Studio Code
- Chromium
- Brackets
Update and Upgrade
Resynchronize the package index files and Upgrade the Debian Linux system including security update.
Update and Upgrade with the following command in the terminal prompt:
$ sudo apt-get update
$ sudo apt-get upgrade
Reboot with the following command in the terminal prompt:
$ sudo reboot -n
Sophos
Sophos Endpoint doesn’t rely on signatures to catch malware, which means it catches zero-day threats without adversely affecting the performance of your device. So you get protection before those exploits even arrive.
Raise Assist with CT for adding Sophos Endpoint
Java SDK
The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime
Use Webup8 Oracle Java8 Installer with the following commands in the terminal prompt:
$ sudo add-apt-repository ppa:webupd8team/java -y
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
Set Java environment variables with the following command in the terminal prompt:
$ sudo apt-get install oracle-java8-set-default
Check the Java version with the following command in the terminal prompt:
$ java -version
Set environment variables with the following command in the terminal prompt:
$ sudo nano /etc/environment
Add the following to the environment file
JAVA_HOME="/usr/lib/vm/java-8-oracle"
Refresh environment file with the following command in the terminal prompt:
$ source /etc/environment
Set environment variables in .bashrc with the following command in the terminal prompt:
$ sudo nano ~/.bashrc
Add the following to the .bashrc file:
export JAVA_HOME="/usr/lib/vm/java-8-oracle"
Refresh the bash profile with the following commands in the terminal prompt:
$ source ~/.bashrc
Android command line SDK Tools
SDK Tools is a downloadable component for the Android SDK. It includes the complete set of development and debugging tools for the Android SDK.
Download the Mac SDK Tools
android-sdk_r24.4.1-linux.tgz
Unzip Android command line SDK Tools with the following commands in the terminal prompt:
$ mkdir ~/Apps
$ cd ~/Downloads/
$ tar android-sdk*.zip
$ mv android-sdk-linux/ ~/Apps/android-sdk-linux
Add the following to the .bashrc file:
export ANDROID_HOME="$HOME/Apps/android-sdk-linux"
export PATH=$PATH:$ANDROID_HOME/platform-tools/:$ANDROID_HOME/tools/
Refresh your bash profile with the following commands in the terminal prompt:
$ source ~/.bashrc
Run the SDK Manager with the following commands in the terminal prompt:
$ sh ~/.android-sdk-linux/tools/android
Select the following below:
Under Tools
- Android SDK Platform-tools (Rev 25)
- Android SDK Build-tools (Rev 25)
Under Android 7.11 (API 25)
- SDK Platform (API 25)
- Google APIs Intel x86 Atom_64 System Image(API 25, Rev 2)
Click Install Packages
Development Tools
Build-essential is a package which contains references to numerous packages needed for building software in general
Git is a version control system that is used for software development and other version control tasks.
htop is an interactive system-monitor process-viewer. It is designed as an alternative to the Unix program top.
Linux Screen allows you to: Use multiple shell windows from a single SSH session.
curl is a command line tool for getting or sending files using URL syntax.
Install the following packages
- build-essential
- git
- htop
- screen
- curl
Run the following command in the terminal prompt:
$ sudo apt-get install build-essential git htop screen curl
Node Version Manager
Node Version Manager is bash script to manage multiple active node.js versions
Install NVM with the following command in the terminal prompt:
$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
Refresh your bash profile with the following commands in the terminal prompt:
$ source ~/.bashrc
Verify installation with the following command in the terminal prompt:
$ nvm --version
Node Version Manager Documentation
Node
Node.js is an open-source, cross-platform JavaScript runtime environment.
Install Node and NPM with the following command in the terminal prompt:
$ nvm install 6.9.0
$ npm i -g npm@3.10.7
$ nvm use 6.9.0
$ nvm alias default 6.9.0
Verify Node version 6.9.0 and npm version 3.10.7 with the following command in the terminal prompt:
$ node -v && npm -v
Node Packages
Install the following node packages with specified versions
- gulp
- cordova
- ionic
- jspmw
- bower
- npm-check
- npm-install-missing
- phantomjs-prebuilt
- sinopia
- pm2
Install Node Packages with the following command in the terminal prompt:
$ npm i -g gulp cordova ionic jspm bower npm-check npm-install-missing phantomjs-prebuilt sinopia pm2
List installed Node Packages with the following command in the terminal prompt:
$ npm ls -g --depth=0
Sinopia
Sinopia is a private / caching npm repository server
Install Sinopia with the following command in the terminal prompt:
$ npm i sinopia -g
Run Sinopia with the following command in the terminal prompt:
$ sinopia
Set npm registry to Sinopia with the following command in the terminal prompt:
$ npm set registry http://localhost:4873/
Set add user to Sinopia with the following command in the terminal prompt:
$ npm adduser --registry http://localhost:4873/
Username: mobileappsteam
Password: Transport AODB Mobile Thycotic Secret Server
Email: MobileAppsTeam@leidos.com
Clone local-Chromaux git repository with the following commands in the terminal prompt:
$ cd $HOME/dev
$ git clone http://i-t-v-tf01:8080/tfs/Transport/Chroma%20Refresh/_git/UX
Run the gulp command to export Chroma.UX with the following commands in the terminal prompt:
$ cd $HOME/dev/UX/Chroma.UX/
$ npm install
$ gulp newexport
Check the npm config file has the value registry=http://localhost:4873/ with the following command in the terminal prompt:
$cat ~/.npmrc
Publish the Chroma.UX package to Sinopia with the following commands in the terminal prompt:
$ cd $HOME/dev/UX/local-chromaux/
$ npm publish .
PM2 Process Management
PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.
Install PM2 with the following command in the terminal prompt:
$ npm i pm2@latest -g
Setup Auto-Completion with the following command in the terminal prompt:
$ pm2 completion >> ~/.bashrc
Create a process configuration JSON file as ~/process.json
{
"apps" : [
{
"name" : "Sinopia",
"script" : "/home/mobileappsteam/.nvm/versions/node/v4.4.7/bin/sinopia",
"cwd" : "/home/mobileappsteam",
"watch" : false,
"instances" : 1,
"combine_logs" : true,
"max_memory_restart" : "300M",
"restart_delay" : 5000
}
]
}
Generate startup scripts with the following command in the terminal prompt:
$ pm2 startup ubuntu
Following with be generated
PM2] You have to run this command as root. Execute the following command:
sudo su -c "env PATH=$PATH:/home/mobileappsteam/.nvm/versions/node/v6.9.0/bin pm2 startup ubuntu -u mobileappsteam --hp /home/mobileappsteam"
Run the generated command in the terminal prompt:
$ sudo su -c "env PATH=$PATH:/home/mobiledev/.nvm/versions/node/v6.9.0/bin pm2 startup ubuntu -u mobiledev --hp /home/mobiledev"
Save PM2 changes with the following command in the terminal prompt:
$ pm2 save
Start with the following command in the terminal prompt:
$ pm2 start ~/profile.json
Additional Commands
$ pm2 kill
$ pm2 monit
$ pm2 list
$ pm2 log 0
WebStorm
WebStorm is a JavaScript IDE for client-side development and server-side development with Node.js.
Visual Studio Code
Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring.
Chromium
Chromium is the open-source web browser project from which Google Chrome draws its source code.[5] The browsers share the majority of code and features, though there are some minor differences in features and they have different licensing.
Install Chromium with the following command in the terminal prompt:
$ sudo apt-get install chromium-browser
Brackets
Brackets is an open source code editor for web designers and front-end developers.
Install Brackets with the following commands in the terminal prompt:
$ sudo add-apt-repository ppa:webupd8team/brackets
$ sudo apt-get update
$ sudo apt-get install brackets