This guide assumes you have deployed an application to the
zone as detailed in getting started.
Prerequisites: git, openssl, JDK 11 or higher, mvn 3.6 or higher.
While applications in the
dev zone are deployed manually by a developer,
prod zones should happen automatically on source changes
by creating a build job in your preferred continuous build tool that
builds the application and submits it to Vespa 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.
If you don't have it, add a
pom.xml file to the application root.
This is the Maven project configuration, and is needed to build with the Vespa Cloud test framework.
See this this example.
If you haven't, update the
application properties in
to match the names of your tenant and application.
<properties> ... <tenant>MYTENANT</tenant> <application>MYAPP</tenant> </properties>
Add the tests that build the test framework.
These tests reside in the
src/test/java directory of the application.
You can copy the sample tests in
Refer to developing tests to create your own tests.
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:
Add the Vespa Cloud compile version to the application package:
$ mvn vespa:compileVersion -DapiKeyFile=$HOME/Downloads/TENANTNAME.pem
Compile the application package with test artifacts:
$ mvn package -Dvespa.compile.version="$(cat target/vespa.compile.version)"
Submit the application package to Vespa Cloud for deployment:
$ mvn vespa:submit -DapiKeyFile=$HOME/Downloads/TENANTNAME.pem
The application revision is now being tested and (if successful) deployed to the production zones prescribed in your deployment.xml.
You can track deployment progress and view logs in the console.
It is always safe to submit a new revision of your application. You should now configure a continuous build job in your preferred build tool to perform these three commands whenever a change to your application source is checked in and merged.
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.
Follow the guide at deleting an application to remove instances or applications from production.