Sign inSign up

hunxoft/hubspot-bitbucket-pipe

By hunxoft

•Updated 7 months ago

Bitbucket pipe for HubSpot project deployments. This is NOT an official pipe maintained by HubSpot.

Image
Integration & delivery
0

1.2K

hunxoft/hubspot-bitbucket-pipe repository overview

⁠Bitbucket Pipelines Pipe: HubSpot Pipe

Automatic deployment for HubSpot projects.

Note: This is not an official pipe maintained by HubSpot. However, we aim to keep it up to date with new features from the official HubSpot GitHub Action⁠.

⁠YAML Definition

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

script:
  - pipe: docker://hunxoft/hubspot-bitbucket-pipe:latest
    variables:
      COMMAND: "upload" # upload|deploy|validate
      PROJECT_DIR: "./" # directory containing hsproject.json
      HUBSPOT_ACCOUNT_ID: "<string>"
      HUBSPOT_PERSONAL_ACCESS_KEY: "<string>"
      # CLI_VERSION: "8.0.0" # Optional
      # DEBUG: "false" # Optional
      # PROFILE: "<string>" # Optional

⁠Variables

VariableUsage
COMMANDWhich action to run: upload, deploy, validate. Default: upload.
PROJECT_DIRPath to a single HubSpot project directory (must contain hsproject.json). Default: ./. Ignored when PROJECT_DIRS is set. The existance of the PROJECT_DIRS will overwrite this.
PROJECT_DIRSComma-separated list of HubSpot project directories to process. Each must contain an hsproject.json.
HUBSPOT_ACCOUNT_ID (*)HubSpot account ID (portal ID).
HUBSPOT_PERSONAL_ACCESS_KEY (*)HubSpot personal access key. Use a secured repository variable.
CLI_VERSIONHubSpot CLI version to install. Default: 8.0.0.
DEBUGEnables verbose logs and passes --debug to hs. Default: false.
FORCE_CREATEFor COMMAND=upload, passes --force-create. Default: true.
MESSAGEFor COMMAND=upload, sets the build message. Default: Uploaded via Bitbucket Pipe (<sha>).
BUILD_IDFor COMMAND=deploy, deploy a specific build ID (mutually exclusive with DEPLOY_LATEST_BUILD).
DEPLOY_LATEST_BUILDFor COMMAND=deploy, deploy the most recent build. Default: false.
DRY_RUNIf true, prints what would run and exits success (useful for testing). Default: false.
PROFILEThe HubSpot CLI profile to use. Ex. "dev" or "prod". Optional.

(*) = required variable.

⁠Prerequisites

  • A HubSpot project (Developer Projects) with an hsproject.json in PROJECT_DIR.
  • Bitbucket repository variables set for:
    • HUBSPOT_ACCOUNT_ID
    • HUBSPOT_PERSONAL_ACCESS_KEY

⁠Shared Variables

This pipe writes the following variables to the BITBUCKET_PIPE_SHARED_STORAGE for use in subsequent pipes:

VariableDescription
build_idThe ID of the build created during upload.
deploy_idThe ID of the deployment created during upload or deploy.

⁠Examples

⁠Upload example
script:
  - pipe: docker://hunxoft/hubspot-bitbucket-pipe:latest
    variables:
      COMMAND: "upload"
      PROJECT_DIR: "./"
      HUBSPOT_ACCOUNT_ID: $HUBSPOT_ACCOUNT_ID
      HUBSPOT_PERSONAL_ACCESS_KEY: $HUBSPOT_PERSONAL_ACCESS_KEY
⁠Deploy latest build example
script:
  - pipe: docker://hunxoft/hubspot-bitbucket-pipe:latest
    variables:
      COMMAND: "deploy"
      PROJECT_DIR: "./"
      HUBSPOT_ACCOUNT_ID: $HUBSPOT_ACCOUNT_ID
      HUBSPOT_PERSONAL_ACCESS_KEY: $HUBSPOT_PERSONAL_ACCESS_KEY
      DEPLOY_LATEST_BUILD: "true"
⁠Multi-project upload example
script:
  - pipe: docker://hunxoft/hubspot-bitbucket-pipe:latest
    variables:
      COMMAND: "upload"
      PROJECT_DIRS: "project1,project2"
      HUBSPOT_ACCOUNT_ID: $HUBSPOT_ACCOUNT_ID
      HUBSPOT_PERSONAL_ACCESS_KEY: $HUBSPOT_PERSONAL_ACCESS_KEY

⁠Support

If you’d like help with this pipe, or you have an issue or feature request, let us know. The pipe is maintained by HunXoft.

If you’re reporting an issue, please include:

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

⁠Git repo

https://bitbucket.org/hunxoft/hubspot-bitbucket-pipe/⁠

⁠License

Copyright (c) 2019 Atlassian and others. Apache 2.0 licensed, see LICENSE⁠ file.

Tag summary

Content type

Image

Digest

sha256:ef56b1f7e…

Size

295.4 MB

Last updated

7 months ago

docker pull hunxoft/hubspot-bitbucket-pipe