Skip to main content
Updating the configuration of your app using aptible config:set then deploying your app via Git or via Docker image will deploy your app twice: This process may be inconvenient when you need to update your configuration and ship new code that depends on the updated configuration simultaneously. To solve this problem, the Aptible CLI lets you deploy and update your app configuration as one atomic operation.

For deploying via Git

To synchronize a Configuration change and code release when deploying via Git: Step 1: Push your code to a new deploy branch on Aptible. Any name will do, as long as it’s not master, but we recommend giving it a random-ish name like in the example below. Pushing to a branch other than master will not trigger a deploy on Aptible. However, the new code will be available for future deploys.
BRANCH="deploy-$(date "+%s")"
git push aptible "master:$BRANCH"
Step 2: Deploy this branch along with the new Configuration variables using the aptible deploy command:
aptible deploy \
  --app "$APP_HANDLE" \
  --git-commitish "$BRANCH" \
  FOO=BAR QUX=
Please note that you can provide some common configuration variables as arguments to CLI commands instead of updating the app configuration. For example, if you need to include Private Registry Authentication credentials to let Aptible pull a source Docker image, you can use this command:
aptible deploy \
  --app "$APP_HANDLE" \
  --git-commitish "$BRANCH" \
  --private-registry-username "$USERNAME" \
  --private-registry-password "$PASSWORD"

For deploying via Docker image

Please use the aptible deploy CLI command to deploy your app if you are deploying via Docker image. If you are not using aptible deploy, please review the deploying via Docker image instructions. When using aptible deploy with deploying via Docker image, you may append environment variables to the aptible deploy command:
aptible deploy \
  --app "$APP_HANDLE" \
  --docker-image "$DOCKER_IMAGE" \
  FOO=BAR QUX=