6.8 KiB
Development Environment Setup
The following instructions contain the required steps to install the necessary utilities and setup your development environment in order to run the sample application which is detailed in the parent README file.
The steps to setup your development environment are broken into two sections:
-
STEP 1 - Install the required developer utilities for your operating system
-
STEP 2 - Clone the sample application and customize it for your environment
STEP 1 - Install the required developer utilities for your operating system by following the instructions in below sections:
If you are using a MacOS system
-
Install the Azure CLI by using the instructions at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli.
-
Install kubectl by running below command:
sudo az acs kubernetes install-cli
-
Install Homebrew from https://brew.sh/.
-
Install jq using Homebrew:
brew install jq
-
Install gettext using Homebrew:
brew install gettext brew link --force gettext
-
Install maven using Homebrew:
brew install maven
If you are using a Linux system
-
Install the Azure CLI by using the instructions at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli.
-
Install the Kubernetes CLI (kubectl) by using the instructions at https://kubernetes.io/docs/getting-started-guides/ubuntu/:
az acs kubernetes install-cli --install-location . sudo mv kubectl /usr/local/bin/kubectl
-
Install jq by using the instructions at https://stedolan.github.io/jq/download/:
sudo apt-get install jq
-
Install Maven:
sudo apt-get install maven
If you are using a Windows system
-
Install python (preferably 3.6). In the python setup wizard, check
pip
during theOptional Features
step. -
Install Azure CLI by running below command:
pip install azure-cli
NOTES:
- We run Azure resource provisioning script in Git Bash. To smoothly run Azure CLI commands in Git Bash, Azure CLI has to be installed via pip.
- The Azure CLI installed via MSI insatller doesn't work well in Git Bash.
-
Install kubectl by running below Azure CLI command with administrator privilege:
az acs kubernetes install-cli
-
Install Chocolatey.
-
Install Maven using Chocolatey:
choco install Maven
-
Install jq using Chocolatey:
choco install jq
STEP 2 - Clone the sample application and customize it for your environment
-
Open https://github.com/Microsoft/movie-app-java-on-azure in a web browser and create a private fork of the sample application.
-
Open a console window and clone your forked repo on your local system:
git clone https://github.com/<your-github-id>/movie-app-java-on-azure
-
Open the
~/deployment/config.json
in a text editor:a. Locate the following configuration settings, and modify the
value
of the GITHUB_REPO_OWNER key/value pair with your GitHub account name:"repo": [ { "comment": "GitHub account name.", "key": "GITHUB_REPO_OWNER", "value": "<your-github-id>" }, { "comment": "GitHub repository name.", "key": "GITHUB_REPO_NAME", "value": "movie-app-java-on-azure" } ],
b. Locate the following configuration settings, and modify the
value
of the GROUP_SUFFIX key/value pair with a unique ID; for example "123456":"optional": [ { "comment": "Optional resource group suffix to avoid naming conflict.", "key": "GROUP_SUFFIX", "value": "<some-random-suffix>" } ]
c. Save and close the
~/deployment/config.json
file. Suggest to commit these changes to GitHub so that it won't be lost. -
Login to your Azure account and specify which subscription to use:
az login az account set --subscription "<your-azure-subscription>"
NOTES:
- You can use either a subscription name or id when specifying which subscription to use.
- To obtain a list of your subscriptions, type
az account list
.
-
Setup environment variables for passwords.
export MYSQL_PASSWORD=<your-mysql-admin-password> export JENKINS_PASSWORD=<your-jenkins-password>
NOTES:
MYSQL_PASSWORD
will be used to create a MySQL database in Azure, which must meet password complexity requirements; for example, you should use a mixture of uppercase letters, lowercase letters, numbers, and punctuation.- The default MySQL admin username is
AzureUser
; you can change it in~/deployment/config.json
. JENKINS_PASSWORD
will be used to deploy a Jenkins cluster in ACS; the Jenkins admin username isjenkins
.