Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 2.03 KB

README.md

File metadata and controls

46 lines (33 loc) · 2.03 KB

Segment_Functions

Destination Function Template

Base template to deploy your next destination function with

  1. Click Use This Template above (If Segment PS, add to Segment Services Engineering Organization

Setup Steps

  1. nvm use (to get the right version of NodeJS)
  2. npm install (to install npm dependencies)

To Test

npm run test

  • GitHub Actions workflow also runs tests before deploying
  • Tests are created in src/index.test.js

To Deploy via GitHub Actions

  1. Create GitHub Environments here (DEV, QA, PROD, etc)
    • DEV is enabled by default in the deployDestinationFunction.yml file (note: this links to the environments in the Template Repo)
    • Navigate to settings -> environments in your Function Repo
  2. Create Function in Segment Workspace
  3. Create Public API Token to allow for deploying
  4. Add the following Environment Secrets
    • FUNCTION_ID
      • Be sure to include dfn_
    • PUBLIC_API_TOKEN

Deploying to multiple environments

  1. Once changes look good in the DEV environment, uncomment the QA section from the deployDestinationFunction.yml file.
  2. Push changes to your branch
  3. Add the label !!_RELEASE_TO_QA to the PR to deploy it to QA

Tooling Included

  1. Jest for code testing
  2. Prettier for code formatting
  3. ESLint for code linting
  4. GitHub Actions script for function deploy
  5. Husky for commit validation