Sign inSign up

switchsystems/serverless-deploy

By switchsystems

•Updated over 5 years ago

Fork of atlassian bitbucket serverless-deploy pipe to add git support

Image
0

236

switchsystems/serverless-deploy repository overview

⁠Bitbucket Pipelines Pipe: Serverless deploy

Deploy a Serverless application to AWS and Google Cloud. The pipe should also work with Azure, however support is currently limited and not guaranteed.

⁠YAML Definition

Add the following snippet to the script section of your bitbucket-pipelines.yml file:

script:
  - pipe: atlassian/serverless-deploy:1.0.0
    variables:
      # CONFIG: "<string>" # Optional
      # EXTRA_ARGS: "<string>" # Optional
      # DEBUG: "<boolean>" # Optional

⁠Variables

⁠Base variables
VariableUsage
CONFIGPath to the Serverless framework configuration file. Default: serverless.yml.
EXTRA_ARGSExtra options to pass to the serverless deploy command as a string. These options depend on the deployment provider. Default: ''
DEBUGTurn on extra debug information. Default: false.

Deployment credentials are cloud provider specific.

VariableUsage
AWS_ACCESS_KEY_IDAWS key id. Default: None.
AWS_SECRET_ACCESS_KEYAWS secret key. Default: None.
GCP_KEY_FILEbase64 encoded contents of the GCP key file. Default: None.
AZURE_SUB_IDAzure subscription ID. Default: None.
SERVERLESS_ACCESS_KEYServerless access key for optional integration with the Serverless dashboard. Default: None
AZURE_SERVICE_PRINCIPAL_TENANT_IDAzure service principal tenant ID. Default: None.
AZURE_SERVICE_PRINCIPAL_CLIENT_IDAzure service principal client ID. Default: None.
AZURE_SERVICE_PRINCIPAL_PASSWORDAzure service principal password. Default: None.

(*) = required variable.

⁠Prerequisites

  • In order to use this pipe you need to create a Serverless application first.
  • You will also need credentials for the cloud provider you will be deploying to.
  • Check out the documentation for the cloud provider you are interested in the official serverless documentation⁠.

Google Cloud Platform:

  • Create a GCP project.
  • Create an IAM member with at least a minimum set of roles: Cloud Functions Developer, Deployment Manager Editor, Storage Object Admin, and other needed for your resources.
  • Create service account for your project.
  • Create, download and save private_key.json. You will use it as your credentials in the serverless.yml.
  • Enable the Cloud Functions API⁠.
  • Enable the Cloud Deployment Manager V2 API⁠.

For base64 encoded contents required by GCP_KEY_FILE variable use command:

Linux

$ base64 -w 0 < GCP_key

MAC OS X

$ base64 < GCP_key

⁠Examples

Basic example deploying to AWS:

script:
  - pipe: atlassian/serverless-deploy:1.0.0
    variables:
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

Exmaple deploying to Google Cloud:

script:
  - pipe: atlassian/serverless-deploy:1.0.0
    variables:
      GCP_KEY_FILE: $GCP_KEY_FILE

Example passing extra args:

script:
  - pipe: atlassian/serverless-deploy:1.0.0
    variables:
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
      EXTRA_ARGS: '--verbose'

⁠Support

If you’d like help with this pipe, or you have an issue or feature request, let us know on Community⁠.

If you’re reporting an issue, please include:

  • the version of the pipe
  • relevant logs and error messages
  • steps to reproduce

Tag summary

Content type

Image

Digest

Size

175.7 MB

Last updated

over 5 years ago

docker pull switchsystems/serverless-deploy