Deploying Code

Once you have created your app and at least one environment you are ready to deploy. Deploying code with the Begin CLI is a cinch.

Deploy

If your app only has one environment you can just execute the command:

begin deploy
Archiving and uploading project to Begin...
Project uploaded, you can now exit this process
and check its status with: begin deploy --status
b deploy
Archiving and uploading project to Begin...
Project uploaded, you can now exit this process
and check its status with: begin deploy --status

If you don’t quit the command by typing Ctrl+c you will see output similar to:

Beginning deployment of 'staging'
Packaging build for deployment
Publishing build to Begin
Build completed!
Deployed 'staging' to: https://local-fih.begin.app

However, if you do type Ctrl+c you can check the status of the deployment by running the command:

begin deploy --status
Latest build status: success
b deploy --status
Latest build status: success

Deploy to an environment

If your app has more than one environment you will need to specify which environment you want to deploy to:

begin deploy --env staging
b deploy --env staging

This will work identically to a deploy without an environment specified.

Deployment status

At any time you can run the command:

begin deploy --status
b deploy --status

to check on the status of your latest deploy. The CLI will report that your latest deployment is in one of the following states:

  • building: Your project is currently being built.
  • deploying: A deploy of your project is currently in progress.
  • failed: An error occurred while trying to deploy our project.
  • success: The deployment succeeded and your project is available at the provided url.