This guide assumes you have deployed an application to the
zone as detailed in getting started.
To get to production with an application with custom Java code, see getting to production with Java.
While applications in the
dev zone are deployed manually by a developer,
prod zones should happen automatically on source changes.
This is done by creating a build job in a continuous build tool that
builds the application and submits it to Vespa Cloud for production roll-out.
To make this safe, the application needs tests that validate it. These tests are executed automatically on each deployment. See automated deployments for more details.
sample application, used in getting started, already contains some sample tests.
Now it is time to review the HTTP testing reference,
and update the tests in
src/test/application to match your
With the Vespa CLI,
it is easy deploy your application to
dev, and run tests against that deployment:
$ vespa deploy --wait 600
$ vespa test src/test/application/tests/system-test
The Vespa CLI can be used to initialize your application for deployment to production:
$ vespa prod init
To do it by hand, create a deployment.xml
<deployment version="1.0"> <prod> <region active="true">aws-us-east-1c</region> </prod> </deployment>
Now you are ready to build and submit the application revision—with the Vespa CLI, run:
$ vespa prod submit
This packages the application and its tests as separate zip archives, and uploads them to Vespa Cloud.
With good tests, it is always safe to submit a new revision of your application. You should now configure a continuous build job in your preferred build service to run this command whenever a change to the application source is made.
To build and submit without the Vespa CLI, create the zip archives, and upload through the console:
$ (cd src/main/application && zip -r ../../../application.zip .)
$ (cd src/test/application && zip -r ../../../application-test.zip .)
The Vespa Cloud application is now running in a production zone. Congratulations! After this you can further enhance the production application:
To create more tests to protect your production deployments, see developing tests.