Skip to content

Latest commit

 

History

History
33 lines (29 loc) · 1.59 KB

File metadata and controls

33 lines (29 loc) · 1.59 KB

Lesson 8: Continuous Deployments

  1. Quick navigate to the build service for your Android or iOS application using the VS Code extension.
  2. Open your master build configuration and add the following environment variables.
OWNER_NAME = "Your username or the org name you created the apps under."
APP_NAME = "App slug name in App Center."
CUSTOM_VISION_PROJECT_ID = "Grab project identifier from Custom Vision settings."
CUSTOM_VISION_SECRET = "Grab secret from Custom Vision settings."
APPCENTER_ACCESS_TOKEN = "Generate a new token from the App Center accounts page."
ASSETS_RELATIVE_PATH = "assets"
  1. Create a appcenter-post-build.sh script in the root of your project folder to trigger retraining and an automatic CodePush with the latest model on every release. appcenter-post-build.sh
#!/usr/bin/env bash

echo "APPCENTER_SOURCE_DIRECTORY = $APPCENTER_SOURCE_DIRECTORY"
echo "APPCENTER_OUTPUT_DIRECTORY = $APPCENTER_OUTPUT_DIRECTORY"
echo "APPCENTER_REACTNATIVE_PACKAGE = $APPCENTER_REACTNATIVE_PACKAGE"

python3 -m pip install azure-cognitiveservices-vision-customvision || exit 1
python3 train_and_export_model.py || exit 1

appcenter codepush release-react -a $OWNER_NAME/$APP_NAME \
-d Staging \
--token $APPCENTER_ACCESS_TOKEN \
--disable-duplicate-release-error || exit 1
  1. Copy the train_and_export_model.py file into the root of your project folder.
  2. Commit the changes to verify App Center successfully builds and pushes your latest changes.

Exit Criteria

  1. App Center app configured to automatically retrain your Custom Vision model and deliver it to clients using CodePush.