HomeGuidesAPI ReferenceGraphQL
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Update your app version

OCP App Types

Optimizely runs four types of apps on OCP, all defined by the naming convention and the use of tags.

  • Released Apps - Apps released to production are available in the OCP App Directory.
  • Private Apps - Apps that have been released to production, but their availability in the OCP App Directory is limited to one or more accounts.
  • Beta Apps - Apps that have NOT been released to production but can be shared via private URLs for testing.
  • Dev Apps - Apps that have NOT been released to production. These apps cannot be shared and are limited to running in the developer's given account.

We are working with a Dev app for our "getting started" purposes. Below is a brief introduction to the app naming convention and its use on the OCP platform.

Version control conventions

We follow the Semantic Versioning (semver) specification of version management for apps built on the OCP platform.

Versioning standards

All of our apps follow the semver.org standards, given a version number MAJOR.MINOR.PATCH, we increment:

  1. The MAJOR version when you make an incompatible API change
  2. The MINOR version, when you add functionality in a backward-compatible manner, and
  3. PATCH version when you make backward-compatible bug fixes.

We also support two types of pre-release tags, -beta and -dev. Any app with a pre-release tag is not globally visible inside the app directory and is intended to serve as a work in progress.

Your Pre-Release App

Recall the versioning of the app you have built is in the following format:\<app_name>@\<app_version>.

If you have been following along, recall for the example app we have built, the app's name and version is [email protected].

๐Ÿ“˜

Note:

MAJOR.MINOR.PATCH-dev.VERSION

  • \-dev identifies your build as pre-release
  • .VERSION is the pre-release incrementer

The Role of Pre-Release Versioning

The role of pre-release versioning is to allow you to work on a single train of code, a consistently named MAJOR.MINOR.PATCH version of code, where you increment the pre-release tag as necessary until you are ready for your production release.

For example, imagine your next OCP app release will be 2.1.9. During your development work, you end up with four pre-release versions before you are ready for the final release. Your versioning would look like this:

  • 2.1.9-dev.1 - This is your first pre-release version
  • 2.1.9_dev.2 - This is your second pre-release version
  • 2.1.9_dev.3 - This is your third pre-release version
  • 2.1.9_dev.4 - This is your fourth pre-release version
  • 2.1.9 - This is your release version

The pre-release tag and versioning allowed you to modify your release without incrementing the MAJOR, MINOR or PATCH numbers. Your release ID remains consistent while you work on your code, only incrementing the pre-release tag as you work.

This is what we are going to do with your new app. We will modify the pre-release tag you started with from .1 to .2 while maintaining the MAJOR, MINOR and PATCH version numbers.

The role of the -dev pre-release tag in OCP

Developers can only publish -dev pre-release tags. The -dev tag allows you to work in a sandbox environment without formal code review and without the ability to impact other apps, users, and accounts. The apps you build like this are hidden from the App Directory, so there is privacy, and other users are prevented from seeing or using your apps.

Updating Your App Version

  1. Update the app.yml file for your app on your local machine. Increment the pre-release version to .2 and save your changes. In our example, that looks like this:

  1. Switch your terminal into the directory where your target code is located. In our example, it's C:\Source Code\my-marketing-app:
PS C:\Source Code\my-marketing-app>
  1. From the working directory, execute the following command: `opti app upload'. This will upload the latest version of your app. Your result should look like this:

  1. Use opti directory publish <app_name>@<app_version>to publish your updated app. In our case the command is opti directory publish [email protected]:

  1. Use opti directory install <app_name>@<app_version> to install your app to the App Directory. In our case, the command is opti directory install [email protected]:

At this time, your updated, pre-release version of your app is now published ONLY to your private version of the App Directory.

๐Ÿ“˜

Note

Notice how the pre-release tag has been incremented to dev.2.


Did this page help you?