Nimbus

Nimbus

  • Docs
  • Getting Started
  • Help

›Deploying Resources

Documentation

  • Introduction
  • Deployment

Deploying Resources

  • File Storage Bucket
  • Document Store
  • Key-Value Store
  • Relational Database
  • Functions

    • HTTP Function
    • WebSocket Function
    • Document Store Function
    • Key-Value Store Function
    • Notification Function
    • Queue Function
    • Basic Function
    • File Storage Function
    • After Deployment Function
    • Environment Variables

Clients

  • Document Store Client
  • Key-Value Store Client
  • File Storage Client
  • WebSocket Management Client
  • Basic Serverless Function Client
  • Notification Topic Client
  • Queue Client
  • Relational Database Client
  • Environment Variable Client

Local Deployment

  • Unit Testing
  • Local Server

After Deployment Function

After deployment functions are functions that are run once after any deployment. They are useful as they allow you to put constant data into your stores, for example setting up a test user account or creating your database schema.

Basic Usage

A method is annotated with @AfterDeployment. It is then run after any file uploads after deploying the project using the nimbus-deployment plugin.

For Example:

class AfterDeploymentFunction {
    
    @AfterDeployment
    @UsesNotificationTopic(topic = "FileUpdates")
    public String addSubscription() {
        String id = notificationClient.createSubscription(Protocol.EMAIL, "admin@nimbusframework.com");
        return "Added subscription with ID: " + id;
    }
}

This is an after deployment function that adds an email to a notification topic so that when notification is sent the email address is notified.

If you are using any clients then it is required that you still use the corresponding @UsesClient annotation, as above.

Method Details

Parameters

No parameters are allowed on an @AfterDeployment method.

Return Type

The return type is serialized using the jackson library and then displayed after the function has run in the deployment script to help determine if the function ran correctly.

Annotation Specification

@AfterDeployment

Optional Parameters

  • isTest - If this is set to true will run after all non test after deployment functions. This is useful for example if your non test function is creating the schema and then the test function is populating with test data. Defaults to false.
  • stages - The stages that the function is deployed to.
← File Storage FunctionEnvironment Variables →
  • Basic Usage
  • Method Details
    • Parameters
    • Return Type
  • Annotation Specification
    • @AfterDeployment
Nimbus
Docs
Getting StartedDocumentation
More
GitHubStar
Copyright © 2019 Thomas Allerton