Follow these steps to create a VSTS build for your eShopOnContainers app (android).
Note: This document assumes basic knowledge about creating builds and configuring external VSTS connections
Despite the "Get Sources" task there are five tasks more in the build:
Let's discuss each of them.
Add a "NuGet restore" task and enter the following configuration:
eShopOnContainers-Android.sln
in "Path to solution, packages.config, or project.json". This sln is created ex professo for the build and contains only the Xamarin Android project plus the Xamarin Forms one.Add a "Xamarin Android" task with following configuration:
**/*Droid*.csproj
in "Project"$(build.binariesdirectory)/$(BuildConfiguration)
in "Output Directory"$(BuildConfiguration)
in "Configuration"** Note** This require you have a valid keystore. Refer to this Xamarin article for instructions on how create one, using Visual Studio and Xamarin. Or if you prefer, you can read how use the Android SDK tools to create a keystore.
This build assumes the keystore is stored somewhere in internet. Beware on where you store your keystores! Keem them safe and privately. Always consider other possible alternatives on where store the keycert:
Add a task "Download file" (Note: this task is installed through a VSTS extension) with following configuration:
$(keystore.url)$(keystore.name)
in "File URL"$(Build.SourcesDirectory)
in "Destination Folder"Fill the "Credentials" section accordly.
Note: You can, of course, use any other way to download the file (like a Powershell task).
Add a "Android Signing" task with following configuation:
$(build.binariesdirectory)/$(BuildConfiguration)/*.apk
in "APK Files"$(Build.SourcesDirectory)\$(keystore.name)
in "Keystore file". This location has to be where the keystore is. If you downloaded it using a previous task (as our example), use the same value. If keystore is physically in the VSTS agent you can use the filepath.$(keystore.pwd)
in "Keystore Password"$(keystore.alias)
in "Keystore Alias"$(key.pwd)
in "Key password".-verbose
in "Jarsigner Arguments"Add a "Publish Build Artifacts" task, with following configuration:
$(build.binariesdirectory)/$(BuildConfiguration)
in "Path to publish"drop
in "Artifact Name"Server
in "Artifact Type"You need to setup the following variables:
keystore.pwd
-> Password of the keystorekeystore.alias
-> Alias of the keystorekeystore.url
-> Full URL of the keystorekey.pwd
-> Password of the key