Start Building for Free
CircleCI.comBlogCommunitySupport

voiceflow/common

A shareable package of CircleCI configuration to integrate with common, written by voiceflow

Community
  1. Orbs
  2. voiceflow/common@dev:8e44f2b2a37d3e04e896e78d1c14c92543bb8c31

voiceflow/common@dev:8e44f2b2a37d3e04e896e78d1c14c92543bb8c31

Sections
Voiceflow's common CI/CD orb
Created: July 2, 2020Version Published: June 5, 2026Releases: 200
Org Usage:
< 25

Orb Quick Start Guide

Use CircleCI version 2.1 at the top of your .circleci/config.yml file.

1 version: 2.1

Add the orbs stanza below your version, invoking the orb:

1 2 orbs: common: voiceflow/common@dev:8e44f2b2a37d3e04e896e78d1c14c92543bb8c31

Use common elements in your existing workflows and jobs.

Opt-in to use of uncertified orbs on your organization’s Security settings page.

Read more in the docs here.

Jobs

build-e2e-tests

Clones the e2e tests repo and builds them

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_prefix
Cache prefix
Cache prefix
No
build-e2e-tests
type: string
string
e2e_git_ref
The git ref to checkout for the e2e tests
The git ref to checkout for the e2e tests
No
master
type: string
string
e2e_repo_name
The name of the repo to clone
The name of the repo to clone
No
creator-app
type: string
string
persist_to_workspace
Persist the e2e tests to the workspace
Persist the e2e tests to the workspace
No
true
type: boolean
boolean

build_push_image

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
build_context
Path to the context for the docker build
Path to the context for the docker build
No
.
type: string
string
dockerfile
Name of the Dockerfile to build
Name of the Dockerfile to build
No
Dockerfile
type: string
string
force_execute
force to notify, if there is a change or not.
force to notify, if there is a change or not.
No
false
type: boolean
boolean
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
inject_aws_credentials
Inject AWS credentials into the build
Inject AWS credentials into the build
No
false
type: boolean
boolean
kms_key
KMS Key to sign the containers
KMS Key to sign the containers
No
awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf
type: string
string
local_registry_container_image
container image to run verdaccio
container image to run verdaccio
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
monorepo_directory
the root directory of monorepo, uses a local registry to pre-release package versions
the root directory of monorepo, uses a local registry to pre-release package versions
No
''
type: string
string
package
The monorepo package that has been changed
The monorepo package that has been changed
No
''
type: string
string
package_folder
The monorepo package that has been changed
The monorepo package that has been changed
No
packages
type: string
string
sem_ver_override
Semantic release version of the package
Semantic release version of the package
No
''
type: string
string
use_tag_versioning
Use tag versioning to tag the image
Use tag versioning to tag the image
No
true
type: boolean
boolean

cdk-deploy

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to use
Executor to use
No
go-executor
type: executor
executor

cdk-go-deploy

Show job Source

cdk-node-deploy

Show job Source

check_env_var_exists

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
env_var
Environment variable to check
Required
Environment variable to check
Yes
-
type: env_var_name
env_var_name

check_track_exists

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
component
Component to check if the track exists
Required
Component to check if the track exists
Yes
-
type: string
string
force_execute
[DEPRECATED] no effect, kept for backward compatibility
[DEPRECATED] no effect, kept for backward compatibility
No
false
type: boolean
boolean
package
Monorepo package.
Monorepo package.
No
''
type: string
string
package_folder
Monorepo package
Monorepo package
No
packages
type: string
string

collect-e2e-logs

Prepare an existing environment for e2e tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cluster
Name of the cluster in which the environment exists
Name of the cluster in which the environment exists
No
cm4-vf-dev-eu-0-p0
type: string
string
e2e-env-name
Name of the environment to collect logs from
Required
Name of the environment to collect logs from
Yes
-
type: string
string
env-name-path
Path to the env_name file
Path to the env_name file
No
/home/circleci/voiceflow/env_name.txt
type: string
string
executor
Executor to run the command on
Executor to run the command on
No
collector-executor
type: executor
executor
smoke-test-jobs
Comma separated list of smoke test jobs
Comma separated list of smoke test jobs
No
vfcommon/run-smoke-tests
type: string
string

create_commit_status

Create GH "Commit Status"

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
check-name
Name of the job to skip
Required
Name of the job to skip
Yes
-
type: string
string
description
Text that shows in GH checks
Required
Text that shows in GH checks
Yes
-
type: string
string
status
Status of check
Required
Status of check
Yes
-
type: enum
enum

create_manifest

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
bucket
The container image repository
The container image repository
No
com.voiceflow.ci.assets
type: string
string
check_track_exists
checks if the track exists
checks if the track exists
No
true
type: boolean
boolean
component
The component type for development environment deployment
Required
The component type for development environment deployment
Yes
-
type: string
string
image_repo
repo
Required
repo
Yes
-
type: string
string
image_tag
tag
tag
No
''
type: string
string
kms_key
KMS Key to sign the containers
KMS Key to sign the containers
No
awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf
type: string
string

generate_technical_documentation

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
step_name
Name of the step
Name of the step
No
Generate technical documentation
type: string
string

helm-publish-charts

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
chart_directory
Directory containining charts
Directory containining charts
No
.
type: string
string
charts
List of charts to publish
List of charts to publish
No
''
type: string
string

helm-publish-charts-dual

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
chart_directory
Directory containing charts
Directory containing charts
No
.
type: string
string
charts
List of charts to publish
List of charts to publish
No
''
type: string
string
prepublish_steps
Steps to run on repo before publishing charts
Steps to run on repo before publishing charts
No
[]
type: steps
steps

helm-publish-charts-ecr

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
chart_directory
Directory containining charts
Directory containining charts
No
.
type: string
string
charts
List of charts to publish
List of charts to publish
No
''
type: string
string
prepublish_steps
Steps to run on repo before publishing charts
Steps to run on repo before publishing charts
No
[]
type: steps
steps

helm-publish-prerelease

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
prepublish_steps
Steps to run on repo before publishing charts
Steps to run on repo before publishing charts
No
[]
type: steps
steps
working_directory
Directory containing chart directories
Directory containing chart directories
No
./
type: string
string

helm-publish-prerelease-dual

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
prepublish_steps
Steps to run on repo before publishing charts
Steps to run on repo before publishing charts
No
[]
type: steps
steps
working_directory
Directory containing chart directories
Directory containing chart directories
No
./
type: string
string

helm-publish-prerelease-ecr

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
prepublish_steps
Steps to run on repo before publishing charts
Steps to run on repo before publishing charts
No
[]
type: steps
steps
working_directory
Directory containing chart directories
Directory containing chart directories
No
./
type: string
string

helm-repo-reindex

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
chart-repo
Name of the chart repo to reindex
Required
Name of the chart repo to reindex
Yes
-
type: enum
enum

install_and_build

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
attach_workspace
Attach workspace to the current working directory
Attach workspace to the current working directory
No
false
type: boolean
boolean
avoid_post_install_scripts
Avoid post-install scripts
Avoid post-install scripts
No
true
type: boolean
boolean
cache_branch
Branch name to use for caching
Branch name to use for caching
No
''
type: string
string
check_image
Checks if the Docker image exists
Checks if the Docker image exists
No
false
type: boolean
boolean
container_folder_to_copy
Avoid post-install scripts
Avoid post-install scripts
No
build
type: string
string
container_image_to_build
Container image to run the build
Container image to run the build
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
docker_image_repo
The Docker image of the microservice
The Docker image of the microservice
No
''
type: string
string
executor
The executor used to run this job
The executor used to run this job
No
node-large-executor
type: executor
executor
force_execute
[DEPRECATED] no effect, kept for backward compatibility
[DEPRECATED] no effect, kept for backward compatibility
No
false
type: boolean
boolean
language
language to execute
language to execute
No
node
type: string
string
monorepo_engine
Monorepo engine
Monorepo engine
No
lerna
type: string
string
package
Package name
Package name
No
''
type: string
string
package_folder
Package folder
Package folder
No
packages
type: string
string
paths_to_cache
Paths to cache
Paths to cache
No
'{build,*.tsbuildinfo}'
type: string
string
post_build_steps
Steps to be run after executing the build commands
Steps to be run after executing the build commands
No
[]
type: steps
steps
pre_build_steps
Steps to be run before executing the build commands
Steps to be run before executing the build commands
No
[]
type: steps
steps
request_remote_docker
Request remote Docker
Request remote Docker
No
true
type: boolean
boolean
run_in_container
Run build in remote Docker container
Run build in remote Docker container
No
true
type: boolean
boolean
run_install_node_modules_in_container
Run install node_modules in remote Docker container
Run install node_modules in remote Docker container
No
false
type: boolean
boolean
use_shallow_clone
Use shallow clone to checkout code
Use shallow clone to checkout code
No
true
type: boolean
boolean

monorepo_analyze_dependencies

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean

monorepo_dependency_tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean

monorepo_integration_tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
command
Command to run
Command to run
No
yarn test:integration
type: string
string
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
request_remote_docker
Add the option to request a new remote docker, set to false when you concat docker jobs
Add the option to request a new remote docker, set to false when you concat docker jobs
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean

monorepo_lint_dockerfile

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean

monorepo_lint_report

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean

monorepo_mintlify_publish

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
docs_repo
Repository containing Mintlify docs
Repository containing Mintlify docs
No
docs-v2
type: string
string
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
schema_dir
Directory to store schemas between jobs
Directory to store schemas between jobs
No
/tmp/schemas
type: string
string

monorepo_rdme_publish

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
avoid_post_install_scripts
Skip running post install scripts
Skip running post install scripts
No
true
type: boolean
boolean
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
install_args
Additional yarn install command options
Additional yarn install command options
No
''
type: string
string
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
schema_dir
Directory to store schemas between jobs
Directory to store schemas between jobs
No
/tmp/schemas
type: string
string

monorepo_release

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
avoid_post_install_scripts
Skip running post install scripts
Skip running post install scripts
No
true
type: boolean
boolean
commit_message
Release engine to use
Release engine to use
No
'chore(release): publish'
type: string
string
executor
The executor used to run this job
The executor used to run this job
No
node-executor
type: executor
executor
install_args
Additional yarn install command options
Additional yarn install command options
No
''
type: string
string
language
language to execute
language to execute
No
node
type: string
string
post_publish_steps
Steps to run after executing the publish command
Steps to run after executing the publish command
No
[]
type: steps
steps
pre_publish_steps
Steps to run before executing the publish command
Steps to run before executing the publish command
No
[]
type: steps
steps
prerelease
Creates a prerelease
Creates a prerelease
No
false
type: boolean
boolean
publish_args
Additional lerna publish command options
Additional lerna publish command options
No
''
type: string
string
release_engine
Release engine to use
Release engine to use
No
lerna
type: string
string
sentry_project
Sentry project to associate the release with
Sentry project to associate the release with
No
''
type: string
string
ssh_key
The SSH key with write permissions to the repository
Required
The SSH key with write permissions to the repository
Yes
-
type: string
string
trigger_tags_pipelines
Trigger tags after monoropo release
Trigger tags after monoropo release
No
true
type: boolean
boolean

monorepo_schema_release

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
schema_dir
Directory to store schemas between jobs
Directory to store schemas between jobs
No
/tmp/schemas
type: string
string

monorepo_schema_validate

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_prefix
Cache prefix
Cache prefix
No
monorepo-schema-validate
type: string
string
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
schema_dir
Directory to store schemas between jobs
Directory to store schemas between jobs
No
/tmp/schemas
type: string
string
skip_tests
Skip the tests but save the updated schemas
Skip the tests but save the updated schemas
No
false
type: boolean
boolean

monorepo_types_tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean

monorepo_unit_tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
collect_coverage
Collect coverage information from sonar directories
Collect coverage information from sonar directories
No
false
type: boolean
boolean
executor
Executor to run the command on
Executor to run the command on
No
node-executor
type: executor
executor
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean

post_image_push_actions

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
component
The component name that has changed
Required
The component name that has changed
Yes
-
type: string
string
force_execute
force to notify, if there is a change or not.
force to notify, if there is a change or not.
No
false
type: boolean
boolean
namespace
The namespace to look at
Required
The namespace to look at
Yes
-
type: string
string
package
The monorepo package that has been changed
The monorepo package that has been changed
No
''
type: string
string
package_folder
The monorepo package that has been changed
The monorepo package that has been changed
No
packages
type: string
string
success_slack_notify
Post to Slack on successful deployment?
Post to Slack on successful deployment?
No
true
type: boolean
boolean
tagged
if tagged
if tagged
No
false
type: boolean
boolean

prepare-env

Prepare an existing environment for e2e tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
branch
Branch to track for the specified components
Required
Branch to track for the specified components
Yes
-
type: string
string
cluster
Name of the cluster in which the environment exists
Name of the cluster in which the environment exists
No
cm4-vf-dev-eu-0-p0
type: string
string
env-name
Name of the environment to prepare
Required
Name of the environment to prepare
Yes
-
type: string
string
tracked-components
Space-separated list of components to track the specified branch
Space-separated list of components to track the specified branch
No
''
type: string
string

promote_production

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to use
Executor to use
No
build-executor
type: executor
executor
image_registry
The container image repository
Required
The container image repository
Yes
-
type: string
string
modifiedComponentNames
Space-delimited string of modified service names
Required
Space-delimited string of modified service names
Yes
-
type: string
string

provision-env

Provision an environment for e2e tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
branch
Branch to track for the specified components
Branch to track for the specified components
No
master
type: string
string
cluster
Name of the cluster to create the environment on
Name of the cluster to create the environment on
No
cm4-vf-dev-eu-0-p0
type: string
string
env-name
Name of the environment to create
Required
Name of the environment to create
Yes
-
type: string
string
force
Whether to force environment creation without checking for free environment
Whether to force environment creation without checking for free environment
No
false
type: boolean
boolean
pool-type
Pool where a free environment will be fetched
Pool where a free environment will be fetched
No
''
type: string
string
tracked-components
Space-separated list of components to track the specified branch
Space-separated list of components to track the specified branch
No
''
type: string
string

release

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
avoid_post_install_scripts
Skip running post install scripts
Skip running post install scripts
No
true
type: boolean
boolean
executor
Executor to use in this job
Executor to use in this job
No
node-executor
type: executor
executor
install_args
Additional yarn install command options
Additional yarn install command options
No
''
type: string
string
pre_release_steps
Steps to run before executing the release command
Steps to run before executing the release command
No
[]
type: steps
steps
prerelease_tag
Tag to use for prerelease (Must be used alongside prerelease_version)
Tag to use for prerelease (Must be used alongside prerelease_version)
No
''
type: string
string
prerelease_version
Version to use for prerelease (Must be used alongside prerelease_tag)
Version to use for prerelease (Must be used alongside prerelease_tag)
No
''
type: string
string
sentry_project
Sentry project to associate the release with
Sentry project to associate the release with
No
''
type: string
string
ssh_key
The SSH key with write permissions to the repository
The SSH key with write permissions to the repository
No
''
type: string
string
working_directory
Directory containing package.json
Directory containing package.json
No
~/voiceflow
type: string
string
yarn_lock_restore_cache_directory
Cache directory for yarn.lock file
Cache directory for yarn.lock file
No
./
type: string
string

release-env

Release an environment from use by the e2e tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cluster
Name of the cluster in which the environment exists
Name of the cluster in which the environment exists
No
cm4-vf-dev-eu-0-p0
type: string
string
env-name
Name of the environment to release
Required
Name of the environment to release
Yes
-
type: string
string
force
Whether to reset the database
Whether to reset the database
No
false
type: boolean
boolean
reset-db
Whether to reset the database
Whether to reset the database
No
true
type: boolean
boolean
when
When to run this command
When to run this command
No
always
type: string
string

release_golang

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
release_package
Release package
Required
Release package
Yes
-
type: string
string
ssh_fingerprint
SSH Key
Required
SSH Key
Yes
-
type: string
string

report_smoke_failures

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
branch-or-commit
the branch or commit of the automated-testing repo to reference for source code
the branch or commit of the automated-testing repo to reference for source code
No
master
type: string
string
channel
the channel where test failures reports will be posted
the channel where test failures reports will be posted
No
test_failures
type: string
string
e2e-env-name
-
-
No
''
type: string
string
env-name-path
Path to the env_name file
Path to the env_name file
No
/home/circleci/voiceflow/env_name.txt
type: string
string
mention
-
-
No
<!subteam^S07CKAVJPLG>
type: string
string

resetdb-free-env

Release an environment from use by the e2e tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cluster
Name of the cluster in which the environment exists
Name of the cluster in which the environment exists
No
cm4-vf-dev-eu-0-p0
type: string
string
env-name
Name of the environment to release
Required
Name of the environment to release
Yes
-
type: string
string

run-e2e-tests

Run e2e tests in specified environment. The environment and e2e repo must be provisioned before running this job.

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
artifacts_path
The path within the repo where the e2e test artifacts will be stored
The path within the repo where the e2e test artifacts will be stored
No
apps/creator-app/cypress
type: string
string
cluster
Name of the cluster to create the environment on
Name of the cluster to create the environment on
No
cm4-vf-dev-eu-0-p0
type: string
string
env-name
Name of the environment to create
Required
Name of the environment to create
Yes
-
type: string
string

run-integration-tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to run the command on
Executor to run the command on
No
node-executor-node-20
type: executor
executor
integration-command
-
-
No
test:integration
type: string
string

run-playwright-smoke-tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
branch-or-commit
the branch or commit of the automated-testing repo to checkout
the branch or commit of the automated-testing repo to checkout
No
master
type: string
string
e2e-env-name
-
-
No
''
type: string
string
env-name-path
Path to the env_name file
Path to the env_name file
No
/home/circleci/voiceflow/env_name.txt
type: string
string
parallelism
-
-
No
4
type: integer
integer
playwright-version
-
-
No
1.48.2
type: string
string
smoke-command
-
-
No
test:ci:pull-request
type: string
string
target-url
use this to override the e2e-env-name and set the full creator-app URL
use this to override the e2e-env-name and set the full creator-app URL
No
''
type: string
string

run-smoke-tests

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
branch-or-commit
the branch or commit of the automated-testing repo to checkout
the branch or commit of the automated-testing repo to checkout
No
master
type: string
string
e2e-env-name
-
-
No
''
type: string
string
env-name-path
Path to the env_name file
Path to the env_name file
No
/home/circleci/voiceflow/env_name.txt
type: string
string
parallelism
-
-
No
1
type: integer
integer
smoke-command
-
-
No
test:smoke:stable
type: string
string
tags
-
-
No
''
type: string
string
target-url
use this to override the e2e-env-name and set the full creator-app URL
use this to override the e2e-env-name and set the full creator-app URL
No
''
type: string
string

sonarcloud_scan

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
executor
Executor to run the command on
Executor to run the command on
No
java-executor
type: executor
executor
install_node_modules
Install dependencies before scanning
Install dependencies before scanning
No
false
type: boolean
boolean

sync_branches

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
check_commit_message
The SSH key with write permissions to the repository
The SSH key with write permissions to the repository
No
''
type: string
string
checkout
Checkout code
Checkout code
No
false
type: boolean
boolean
destination_branch_name
Name of the production branch
Name of the production branch
No
production
type: string
string
source_branch_name
Name of the source branch
Name of the source branch
No
master
type: string
string
ssh_key
The SSH key with write permissions to the repository
Required
The SSH key with write permissions to the repository
Yes
-
type: string
string

update_database_track

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
component
The component type for development environment deployment
Required
The component type for development environment deployment
Yes
-
type: string
string
executor
Executor to use
Executor to use
No
build-executor
type: executor
executor
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
node_version
Node version
Required
Node version
Yes
-
type: string
string
platform
Platform to build the image for
Platform to build the image for
No
linux/amd64
type: string
string
semantic_version
-
-
No
''
type: string
string

update_track

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
bucket
The container image repository
The container image repository
No
com.voiceflow.ci.assets
type: string
string
build_context
Path to the context for the docker build
Path to the context for the docker build
No
.
type: string
string
builder_name
named builder for use with DLC
named builder for use with DLC
No
''
type: string
string
check_track_exists
checks if the track exists
checks if the track exists
No
true
type: boolean
boolean
checkout
Determines if a checkout will be executed or not
Determines if a checkout will be executed or not
No
true
type: boolean
boolean
component
The component type for development environment deployment
Required
The component type for development environment deployment
Yes
-
type: string
string
disable_provenance
disable provenance for image. necessary for lambda images
disable provenance for image. necessary for lambda images
No
false
type: boolean
boolean
dockerfile
Name of the Dockerfile to build
Name of the Dockerfile to build
No
Dockerfile
type: string
string
enable_cache_to
use --cache-to flag to push cache artifact to remote registry
use --cache-to flag to push cache artifact to remote registry
No
false
type: boolean
boolean
enable_dlc
enable docker layer cache
enable docker layer cache
No
false
type: boolean
boolean
enable_load
Load image into local docker
Load image into local docker
No
false
type: boolean
boolean
enable_push
push the image to the registry
push the image to the registry
No
true
type: boolean
boolean
executor
Executor to use
Executor to use
No
build-executor
type: executor
executor
extra_build_args
Arguments to pass while building the docker image
Arguments to pass while building the docker image
No
''
type: string
string
force_execute
force to update the build, if there is a change or not.
force to update the build, if there is a change or not.
No
false
type: boolean
boolean
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
inject_aws_credentials
Inject AWS credentials into the build
Inject AWS credentials into the build
No
false
type: boolean
boolean
kms_key
KMS Key to sign the containers
KMS Key to sign the containers
No
awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf
type: string
string
local_registry
Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file)
Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file)
No
false
type: boolean
boolean
local_registry_container_image
container image to run verdaccio
container image to run verdaccio
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
package
Monorepo package.
Monorepo package.
No
''
type: string
string
package_folder
Package folder to check
Package folder to check
No
packages
type: string
string
platform
Platform to build the image for
Platform to build the image for
No
linux/amd64
type: string
string
remote_docker_version
Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge
Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge
No
default
type: string
string
request_remote_docker
Add the option to request a new remote docker, set to false when you concat docker jobs
Add the option to request a new remote docker, set to false when you concat docker jobs
No
true
type: boolean
boolean
sem_ver_override
Semantic release version of the package
Semantic release version of the package
No
''
type: string
string
update_track_file
Determines if the track file will be updated or not
Determines if the track file will be updated or not
No
true
type: boolean
boolean

validate-chart-version-bump

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
chart_directory
Directory containing charts
Directory containing charts
No
./
type: string
string
charts
List of charts to validate
List of charts to validate
No
''
type: string
string

waiter

Waiter job to be used as a dependency for the Release and Delete job

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
wait-duration
Waiter Sleep time
Waiter Sleep time
No
15
type: integer
integer

Commands

add_ip_to_security_group

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
execute_when
When execute this command
When execute this command
No
on_success
type: string
string
sg_id
Id of the security group
Required
Id of the security group
Yes
-
type: string
string

analyze_dependencies

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
run_in_backgorund
run the command in background
run the command in background
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Analyze dependencies
type: string
string
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

authenticate_npm

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

authenticate_poetry

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
working_directory
Directory containing pyproject.toml
Directory containing pyproject.toml
No
./
type: string
string

build

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
container_image_to_build
Container image to run the build
Container image to run the build
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
package
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
package_folder
Package folder
Package folder
No
packages
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Build
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

build_push_image

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
build_context
Path to the context for the docker build
Path to the context for the docker build
No
.
type: string
string
checkout
Determines if a checkout will be executed or not
Determines if a checkout will be executed or not
No
true
type: boolean
boolean
dockerfile
Name of the Dockerfile to build
Name of the Dockerfile to build
No
Dockerfile
type: string
string
force_execute
[DEPRECATED] no effect, kept for backward compatibility
[DEPRECATED] no effect, kept for backward compatibility
No
false
type: boolean
boolean
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
inject_aws_credentials
Inject AWS credentials into the build
Inject AWS credentials into the build
No
false
type: boolean
boolean
kms_key
KMS Key to sign the containers
KMS Key to sign the containers
No
awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf
type: string
string
local_registry_container_image
container image to run verdaccio
container image to run verdaccio
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
monorepo_directory
the root directory of monorepo, uses a local registry to pre-release package versions
the root directory of monorepo, uses a local registry to pre-release package versions
No
''
type: string
string
package
The monorepo package that has been changed
The monorepo package that has been changed
No
''
type: string
string
package_folder
The monorepo package that has been changed
The monorepo package that has been changed
No
packages
type: string
string
request_remote_docker
Add the option to request a new remote docker, set to false when you concat docker jobs
Add the option to request a new remote docker, set to false when you concat docker jobs
No
true
type: boolean
boolean
sem_ver_override
Semantic release version of the package
Semantic release version of the package
No
''
type: string
string
use_tag_versioning
Use tag versioning to tag the image
Use tag versioning to tag the image
No
true
type: boolean
boolean

buildx_cleanup

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
builder
Buildx builder name Consider this the key for CircleCI DLC
Buildx builder name Consider this the key for CircleCI DLC
No
''
type: string
string
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
target
Dockerfile stage to build
Required
Dockerfile stage to build
Yes
-
type: string
string

check_commit_message

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
commit_message
Commit message to check
Required
Commit message to check
Yes
-
type: string
string
match_env_var
Environment variable to set with the result of the match
Environment variable to set with the result of the match
No
COMMIT_MESSAGE_MATCH
type: env_var_name
env_var_name
should_halt
Whether to halt the job if the commit message does not match
Whether to halt the job if the commit message does not match
No
true
type: boolean
boolean

check_env_var_exists

Check if an environment variable exists

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
env_var
Environment variable to check
Required
Environment variable to check
Yes
-
type: env_var_name
env_var_name

check_image_exists

Check if a Docker image exists

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
request_remote_docker
Add the option to request a new remote docker, set to false when you concat docker jobs
Add the option to request a new remote docker, set to false when you concat docker jobs
No
true
type: boolean
boolean

check_track_exists

Check if a track exists

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
bucket
The container image repository
The container image repository
No
com.voiceflow.ci.assets
type: string
string
component
The container image repository
Required
The container image repository
Yes
-
type: string
string
stop_if_not_exists
Stop if the bucket does not exists
Stop if the bucket does not exists
No
false
type: boolean
boolean

checkout_clone

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
clone_type
type of clone to perform [shallow, treeless]
type of clone to perform [shallow, treeless]
No
shallow
type: string
string
github_branch
git branch for the repo provided
git branch for the repo provided
No
CIRCLE_BRANCH
type: env_var_name
env_var_name
github_repo_name
github repo name
github repo name
No
CIRCLE_PROJECT_REPONAME
type: env_var_name
env_var_name
github_tag
git tag for the repo provided
git tag for the repo provided
No
CIRCLE_TAG
type: env_var_name
env_var_name
github_token
token for cloning git repositories
token for cloning git repositories
No
GITHUB_TOKEN
type: env_var_name
env_var_name
github_username
username for cloning git repositories
username for cloning git repositories
No
GITHUB_USERNAME
type: env_var_name
env_var_name
path_to_clone
Path to clone the github repo
Path to clone the github repo
No
.
type: string
string
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean

clone_repo

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
github_commit
git commit hash for the repo provided
git commit hash for the repo provided
No
''
type: string
string
github_repo_name
github repo name
Required
github repo name
Yes
-
type: string
string
github_token
token for cloning git repositories
token for cloning git repositories
No
GITHUB_TOKEN
type: env_var_name
env_var_name
github_username
username for cloning git repositories
username for cloning git repositories
No
GITHUB_USERNAME
type: env_var_name
env_var_name
path_to_clone
Path to clone the github repo
Path to clone the github repo
No
./
type: string
string
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Clone git repository
type: string
string

clone_s3_assets

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_control
Cache control header value
Cache control header value
No
''
type: string
string
clean_destination
Clean destination
Clean destination
No
false
type: boolean
boolean
from
S3 URL
Required
S3 URL
Yes
-
type: string
string
step_name
Name of the step
Name of the step
No
Clone S3 assets
type: string
string
to
Path to clone S3 assets
Required
Path to clone S3 assets
Yes
-
type: string
string

compute_base_revision

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
base_revision
Git revision to compare against
Git revision to compare against
No
master
type: string
string
git_branch
Current git branch
Current git branch
No
master
type: string
string
target_env_var
Environment variable to set with the list of changed files
Environment variable to set with the list of changed files
No
COMPUTED_BASE_REVISION
type: env_var_name
env_var_name

copy_s3_asset

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
from
S3 URL
Required
S3 URL
Yes
-
type: string
string
step_name
Name of the step
Name of the step
No
Copy S3 asset
type: string
string
to
Path to copy S3 asset
Required
Path to copy S3 asset
Yes
-
type: string
string

create_commit_status

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
check-name
Name of the job to skip
Required
Name of the job to skip
Yes
-
type: string
string
description
Text that shows in GH checks
Required
Text that shows in GH checks
Yes
-
type: string
string
status
Status of check
Required
Status of check
Yes
-
type: enum
enum

delete_branch

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
branch_name
Name of the branch to delete
Required
Name of the branch to delete
Yes
-
type: string
string
ssh_key
The SSH key with write permissions to the repository
Required
The SSH key with write permissions to the repository
Yes
-
type: string
string
step_name
Name of the step
Name of the step
No
Delete branch
type: string
string

dependency_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Dependency tests
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

docker_prune

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
clean_images
Whether to prune images
Whether to prune images
No
true
type: boolean
boolean
clean_volumes
Whether to prune volumes
Whether to prune volumes
No
true
type: boolean
boolean
when
When to execute pruning (`always`, `on_success`, `on_fail`)
When to execute pruning (`always`, `on_success`, `on_fail`)
No
on_success
type: string
string

docker_run_networked

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
command
Command to run in docker container
Command to run in docker container
No
yarn test:integration
type: string
string
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
platforms
Platform to build against
Platform to build against
No
linux/amd64
type: string
string
post_steps
post steps
post steps
No
[]
type: steps
steps
pre_steps
pre steps
pre steps
No
[]
type: steps
steps

gen_certs

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Generate certificates
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

gen_certs_e2e

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Generate certificates for e2e tests
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

generate-track-mapping

Generate component-track mapping file for provisioning an environment with the correct components for e2e

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
components
Space-separated list of components to include in the track-mapping file
Space-separated list of components to include in the track-mapping file
No
''
type: string
string
track
Track to use for the components
Required
Track to use for the components
Yes
-
type: string
string
track-file
Path to the track-mapping file to use
Path to the track-mapping file to use
No
tracks.yaml
type: string
string

get_changed_files

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
target_file
Absolute path to write the list of changed files to. Absolute so it survives consumers that set a custom working_directory (e.g. helm).
Absolute path to write the list of changed files to. Absolute so it survives consumers that set a custom working_directory (e.g. helm).
No
/tmp/changed_files.txt
type: string
string

hadolint_presteps

Install git and setup for treeless shallow clone before hadolint

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
ssh_fingerprint
SSH Key
Required
SSH Key
Yes
-
type: string
string

helm-add-repos

Add voiceflow Helm repos

Show command Source

helm-get-modified-charts

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
chart_directory
Directory containing the charts
Directory containing the charts
No
.
type: string
string
modified_charts_env_var
Environment variable to set with the list of modified charts
Environment variable to set with the list of modified charts
No
MODIFIED_CHARTS
type: env_var_name
env_var_name

install-vfcli

Uses curl to install the specified version of vfcli

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
arch
Architecture to install vfcli for
Architecture to install vfcli for
No
amd64
type: string
string
init-cluster
Cluster to initialize vfcli with
Cluster to initialize vfcli with
No
''
type: string
string
os
Operating system to install vfcli for
Operating system to install vfcli for
No
linux
type: string
string
version
Version of vfcli to install
Version of vfcli to install
No
latest
type: string
string

install_latest_hadolint

Show command Source

install_node_modules

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
avoid_post_install_scripts
Skip running post install scripts
Skip running post install scripts
No
true
type: boolean
boolean
cache_prefix
Cache prefix
Cache prefix
No
''
type: string
string
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
container_image
Container image to run the yarn command
Container image to run the yarn command
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
install_args
Additional yarn install command options
Additional yarn install command options
No
''
type: string
string
language
language to execute
language to execute
No
node
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
Run yarn install in background mode
Run yarn install in background mode
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Install node modules
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string
yarn_lock_restore_cache_directory
Cache directory for yarn.lock file
Cache directory for yarn.lock file
No
./
type: string
string

install_python_modules

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_prefix
Cache prefix
Cache prefix
No
''
type: string
string
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
install_args
Additional poetry install command options
Additional poetry install command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
Run poetry install in background mode
Run poetry install in background mode
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Install node modules
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

integration_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Integration Tests
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

invalidate_cloudfront_distribution

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cloudfront_distribution_id
AWS Cloudfront Distribution ID
Required
AWS Cloudfront Distribution ID
Yes
-
type: string
string
paths
Paths to invalidate
Required
Paths to invalidate
Yes
-
type: string
string
step_name
Name of the step
Name of the step
No
Invalidate Cloudfront Distribution
type: string
string

lint_dockerfile

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Lint dockerfiles
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

lint_report

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Generate Lint report
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

lint_source

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Lint source
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

monorepo_analyze_dependencies

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Analyze dependencies
type: string
string

monorepo_build

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Build
type: string
string

monorepo_dependency_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Dependency tests
type: string
string

monorepo_exec_command

execute commands

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
command
command to execute
Required
command to execute
Yes
-
type: string
string
extra_args
command to execute
command to execute
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Description to run
Required
Description to run
Yes
-
type: string
string

monorepo_exec_command_when_package_changed

execute commands

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
command
command to execute
Required
command to execute
Yes
-
type: string
string
extra_parameters
command to execute
command to execute
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
package_folder
Package folder
Package folder
No
packages
type: string
string
package_to_force_execution
Package to force execution
Required
Package to force execution
Yes
-
type: string
string
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Description to run
Required
Description to run
Yes
-
type: string
string

monorepo_integration_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
command
Command to run
Command to run
No
yarn test:integration
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Integration Tests
type: string
string

monorepo_lint_dockerfile

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Lint Dockerfile
type: string
string

monorepo_lint_report

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Generate Lint report
type: string
string

monorepo_publish_to_local_registry

Publish all packages in monorepo to a local NPM registry

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
working_directory
root directory of the monorepo
root directory of the monorepo
No
./
type: string
string

monorepo_restore_cache

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_branch
Branch name to use for caching
Branch name to use for caching
No
''
type: string
string
cache_identifier
Cache prefix id
Cache prefix id
No
monorepo-build-cache
type: string
string
monorepo_engine
Monorepo engine
Monorepo engine
No
lerna
type: string
string
package
Package name
Package name
No
''
type: string
string
package_folder
Package folder
Package folder
No
packages
type: string
string

monorepo_save_cache

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_branch
Branch name to use for caching
Branch name to use for caching
No
''
type: string
string
cache_identifier
Cache prefix id
Cache prefix id
No
monorepo-build-cache
type: string
string
monorepo_engine
Monorepo engine
Monorepo engine
No
lerna
type: string
string
package
Package name
Package name
No
''
type: string
string
package_folder
Package folder
Package folder
No
packages
type: string
string
paths_to_cache
Paths to cache
Paths to cache
No
'{build,*.tsbuildinfo}'
type: string
string

monorepo_types_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Set to `true` to run the command on root
Set to `true` to run the command on root
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Types Tests
type: string
string

monorepo_unit_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
force_execution
Force execution of the command on all packages
Force execution of the command on all packages
No
false
type: boolean
boolean
run_on_root
Check that allow the command to run on root
Check that allow the command to run on root
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Unit Tests
type: string
string

notify_slack

Notify build status on Slack Channel

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
branch_pattern
Branch pattern to allow the notification to be sent
Branch pattern to allow the notification to be sent
No
.*
type: string
string
channel
The Slack Channel where we receive the notification
Required
The Slack Channel where we receive the notification
Yes
-
type: string
string
event
event when the notify is triggered
Required
event when the notify is triggered
Yes
-
type: enum
enum
mentions
Mention on the slack channel
Mention on the slack channel
No
''
type: string
string
template
Slack Message template
Required
Slack Message template
Yes
-
type: string
string

openapi_persist_schemas

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
app_dir
Sub-folder containing the application schemas in named folders
Sub-folder containing the application schemas in named folders
No
apps
type: string
string
schema_name
Name of the schema files to persist
Name of the schema files to persist
No
openapi.json
type: string
string
workspace_dir
The location to persist schemas to
Required
The location to persist schemas to
Yes
-
type: string
string

openapi_restore_schemas

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
app_dir
Sub-folder containing the application schemas in named folders
Sub-folder containing the application schemas in named folders
No
apps
type: string
string
attach_workspace
Attach the workspace to restore schemas from a previous step
Attach the workspace to restore schemas from a previous step
No
false
type: boolean
boolean
from
The location to restore schemas from
Required
The location to restore schemas from
Yes
-
type: string
string
schema_name
Name of the schema files to restore
Name of the schema files to restore
No
openapi.json
type: string
string
to
The location to restore schemas to
Required
The location to restore schemas to
Yes
-
type: string
string

persist_node_build

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
package
Package name
Package name
No
''
type: string
string
package_folder
Package folder
Package folder
No
packages
type: string
string

persist_python_build

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
package
Package name
Package name
No
''
type: string
string
package_folder
Package folder
Package folder
No
packages
type: string
string

post_image_push_actions

Deploy an image into a K8s cluster

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
component
The component name that has changed
The component name that has changed
No
''
type: string
string
force_execute
[DEPRECATED] no effect, kept for backward compatibility
[DEPRECATED] no effect, kept for backward compatibility
No
false
type: boolean
boolean
namespace
The namespace the target resides in
Required
The namespace the target resides in
Yes
-
type: string
string
package
The monorepo package that has been changed
The monorepo package that has been changed
No
''
type: string
string
package_folder
The monorepo package that has been changed
The monorepo package that has been changed
No
packages
type: string
string
sentry
Report deployment to sentry
Report deployment to sentry
No
false
type: boolean
boolean
ssh_key
The SSH key with write permissions to the repository
The SSH key with write permissions to the repository
No
4c:f6:5f:e5:7a:e9:b4:03:91:6a:93:e5:0e:60:c2:a6
type: string
string
success_slack_notify
Post to Slack on successful deployment?
Post to Slack on successful deployment?
No
true
type: boolean
boolean
tagged
Running on a git tag?
Running on a git tag?
No
false
type: boolean
boolean

promote_production

Promote master to production

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
image_registry
The container image repository
Required
The container image repository
Yes
-
type: string
string
modifiedComponentNames
Space-delimited string of modified service names
Required
Space-delimited string of modified service names
Yes
-
type: string
string

remove_ip_to_security_group

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
execute_when
When execute this command
When execute this command
No
on_success
type: string
string
sg_id
Id of the security group
Required
Id of the security group
Yes
-
type: string
string

run_command_with_retry

Run command with retry

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
background
Run it in background
Run it in background
No
false
type: boolean
boolean
command
Command to run
Required
Command to run
Yes
-
type: string
string
retry-count
Number of retries
Number of retries
No
3
type: integer
integer
sleep
Wait duration until next retry
Wait duration until next retry
No
5
type: integer
integer
step_name
Name of the Step
Name of the Step
No
Executing Command with retry policy
type: string
string
working_directory
Directory to work on
Directory to work on
No
./
type: string
string

serverless_deploy

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
environment
environment where to deploy the serverless application
environment where to deploy the serverless application
No
dev
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Deploy application
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

set-beta-version

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
target_env_var
Environment variable to set with the beta version for this commit
Environment variable to set with the beta version for this commit
No
BETA_VERSION
type: env_var_name
env_var_name
working_directory
Directory of git repo
Directory of git repo
No
.
type: string
string

set-env-name

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
target_env_var
Environment variable to set with the environment name for this commit
Environment variable to set with the environment name for this commit
No
ENV_NAME
type: env_var_name
env_var_name
working_directory
Directory of git repo
Directory of git repo
No
.
type: string
string

set-if-file-changed

Set the given env var to true if a changed file matches one of the given patterns. The `CHANGED_FILES_FILE` environment variable (a path to the changed-files list, set by the `get_changed_files` command) must be set prior to running this command.

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
file-patterns
Space-separated list of file patterns to match against the changed files. If a changed file matches one of these patterns, the given env var will be set to true.
Required
Space-separated list of file patterns to match against the changed files. If a changed file matches one of these patterns, the given env var will be set to true.
Yes
-
type: string
string
target-env-var
Environment variable to set with the environment name for this commit
Required
Environment variable to set with the environment name for this commit
Yes
-
type: env_var_name
env_var_name

set-json-array

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
value
The value to set the field to, passed as a string-separated list. If an item in the list contains a space, it must be enclosed in double quotes.
Required
The value to set the field to, passed as a string-separated list. If an item in the list contains a space, it must be enclosed in double quotes.
Yes
-
type: string
string

set-json-array-from-env

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
value-env-var
Environment variable containing the value to set the field to
Required
Environment variable containing the value to set the field to
Yes
-
type: env_var_name
env_var_name

set-json-boolean

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
value
The value to set the field to
Required
The value to set the field to
Yes
-
type: boolean
boolean

set-json-boolean-from-env

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
value-env-var
Environment variable containing the value to set the field to
Required
Environment variable containing the value to set the field to
Yes
-
type: env_var_name
env_var_name

set-json-command

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
command
The command to set the field to
Required
The command to set the field to
Yes
-
type: string
string
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string

set-json-number

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
value
The value to set the field to
Required
The value to set the field to
Yes
-
type: integer
integer

set-json-number-from-env

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
value-env-var
Environment variable containing the value to set the field to
Required
Environment variable containing the value to set the field to
Yes
-
type: env_var_name
env_var_name

set-json-string

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
value
The value to set the field to
Required
The value to set the field to
Yes
-
type: string
string

set-json-string-from-env

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set
Required
The field of the json file to set
Yes
-
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
value-env-var
Environment variable containing the value to set the field to
Required
Environment variable containing the value to set the field to
Yes
-
type: env_var_name
env_var_name

set-pr-branch

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
pr_number_env_var
Environment variable to get the PR number from
Environment variable to get the PR number from
No
PR_NUMBER
type: env_var_name
env_var_name
target_env_var
Environment variable to set with the branch name for the PR
Environment variable to set with the branch name for the PR
No
PR_BRANCH
type: env_var_name
env_var_name
working_directory
Directory of git repo
Directory of git repo
No
.
type: string
string

set-pr-number

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
target_env_var
Environment variable to set with the environment name for this commit
Environment variable to set with the environment name for this commit
No
PR_NUMBER
type: env_var_name
env_var_name
working_directory
Directory of git repo
Directory of git repo
No
.
type: string
string

set-service-data-json

Set the service metadata array in a json file. The `CHANGED_FILES_FILE` environment variable (a path to the changed-files list, set by the `get_changed_files` command) must be set prior to running this command.

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
field
The field of the json file to set the service metadata array
The field of the json file to set the service metadata array
No
services
type: string
string
json-file
The json file to set the field in
The json file to set the field in
No
values.json
type: string
string
service-directories
List of directories containing services. Each subdirectory of these directories containing a package.json file will be considered a service.
Required
List of directories containing services. Each subdirectory of these directories containing a package.json file will be considered a service.
Yes
-
type: string
string

set_etc_hosts_e2e

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Set etc hosts
type: string
string

set_yarn_bash_default_shell

Show command Source

setup_dynamodb

Show command Source

setup_local_registry

Setup a local NPM registry

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_image
container image to run verdaccio
container image to run verdaccio
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
verdaccio_config
location of verdaccio configuration file
Required
location of verdaccio configuration file
Yes
-
type: string
string

skip_while_draft

Show command Source

smoke_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Smoke tests
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

staged_buildx

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
builder
Buildx builder name Consider this the key for CircleCI DLC
Buildx builder name Consider this the key for CircleCI DLC
No
''
type: string
string
dockerfile
Location of Dockerfile
Location of Dockerfile
No
Dockerfile
type: string
string
enable_cache_to
use --cache-to flag to push cache artifact to remote registry
use --cache-to flag to push cache artifact to remote registry
No
false
type: boolean
boolean
extra_build_args
build args
build args
No
''
type: string
string
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
no_cache_filter
Do not use cache for these stages
Do not use cache for these stages
No
''
type: string
string
output
Buildx build --output flag
Buildx build --output flag
No
''
type: string
string
package
should probably be workspace
should probably be workspace
No
''
type: string
string
platforms
Platform to build against
Platform to build against
No
linux/amd64
type: string
string
post_steps
post steps
post steps
No
[]
type: steps
steps
pre_steps
pre steps
pre steps
No
[]
type: steps
steps
run_in_background
Run in background
Run in background
No
false
type: boolean
boolean
target
Dockerfile stage to build
Required
Dockerfile stage to build
Yes
-
type: string
string

start_e2e

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Start in e2e mode
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

start_ec2_instance

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
execute_when
When execute this command
When execute this command
No
on_success
type: string
string
instance_id
Id of the EC2 instance
Required
Id of the EC2 instance
Yes
-
type: string
string

stop_ec2_instance

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
execute_when
When execute this command
When execute this command
No
on_success
type: string
string
instance_id
Id of the EC2 instance
Required
Id of the EC2 instance
Yes
-
type: string
string

stress_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Stress Tests
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

sync_branches

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
check_commit_message
The SSH key with write permissions to the repository
The SSH key with write permissions to the repository
No
''
type: string
string
checkout
Checkout code
Checkout code
No
false
type: boolean
boolean
destination_branch_name
Name of the production branch
Name of the production branch
No
production
type: string
string
source_branch_name
Name of the source branch
Name of the source branch
No
master
type: string
string
ssh_key
The SSH key with write permissions to the repository
Required
The SSH key with write permissions to the repository
Yes
-
type: string
string
step_name
Name of the step
Name of the step
No
Sync 2 branches
type: string
string

tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Run all tests
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

trigger_tags_pipelines

Triggers the CircleCI pipeline for every tag in the provided list

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
published_tags
Environment variable in which to store the list of tags to trigger
Required
Environment variable in which to store the list of tags to trigger
Yes
-
type: env_var_name
env_var_name

unit_tests

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
extra_args
Additional yarn command options
Additional yarn command options
No
''
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
step_name
Name of the step
Name of the step
No
Unit Tests
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

update_database_track

Update Database Track

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
bucket
The container image repository
The container image repository
No
com.voiceflow.ci.assets
type: string
string
build_context
Path to the context for the docker build
Path to the context for the docker build
No
.
type: string
string
builder_name
named builder for use with DLC
named builder for use with DLC
No
''
type: string
string
check_track_exists
checks if the track exists
checks if the track exists
No
true
type: boolean
boolean
checkout
Determines if a checkout will be executed or not
Determines if a checkout will be executed or not
No
true
type: boolean
boolean
component
The component type for development environment deployment
Required
The component type for development environment deployment
Yes
-
type: string
string
dockerfile
Name of the Dockerfile to build
Name of the Dockerfile to build
No
Dockerfile
type: string
string
enable_cache_to
use --cache-to flag to push cache artifact to remote registry
use --cache-to flag to push cache artifact to remote registry
No
false
type: boolean
boolean
enable_dlc
enable docker layer cache
enable docker layer cache
No
false
type: boolean
boolean
enable_load
Load image into local docker
Load image into local docker
No
false
type: boolean
boolean
enable_push
push the image to the registry
push the image to the registry
No
true
type: boolean
boolean
force_execute
force to update the build, if there is a change or not.
force to update the build, if there is a change or not.
No
false
type: boolean
boolean
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
inject_aws_credentials
Inject AWS credentials into the build
Inject AWS credentials into the build
No
false
type: boolean
boolean
kms_key
KMS Key to sign the containers
KMS Key to sign the containers
No
awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf
type: string
string
local_registry
Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file)
Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file)
No
false
type: boolean
boolean
local_registry_container_image
container image to run verdaccio
container image to run verdaccio
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
node_version
Node version
Required
Node version
Yes
-
type: string
string
package
Monorepo package.
Monorepo package.
No
''
type: string
string
package_folder
Package folder to check
Package folder to check
No
packages
type: string
string
platform
Platform to build the image
Platform to build the image
No
linux/amd64
type: string
string
remote_docker_version
Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge
Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge
No
default
type: string
string
request_remote_docker
Add the option to request a new remote docker, set to false when you concat docker jobs
Add the option to request a new remote docker, set to false when you concat docker jobs
No
true
type: boolean
boolean
semantic_version
-
-
No
''
type: string
string

update_track

Update Component Track

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
bucket
The container image repository
The container image repository
No
com.voiceflow.ci.assets
type: string
string
build_context
Path to the context for the docker build
Path to the context for the docker build
No
.
type: string
string
builder_name
named builder for use with DLC
named builder for use with DLC
No
''
type: string
string
check_track_exists
checks if the track exists
checks if the track exists
No
true
type: boolean
boolean
checkout
Determines if a checkout will be executed or not
Determines if a checkout will be executed or not
No
true
type: boolean
boolean
component
The component type for development environment deployment
Required
The component type for development environment deployment
Yes
-
type: string
string
disable_provenance
disable provenance for image. necessary for lambda images
disable provenance for image. necessary for lambda images
No
false
type: boolean
boolean
dockerfile
Name of the Dockerfile to build
Name of the Dockerfile to build
No
Dockerfile
type: string
string
enable_cache_to
use --cache-to flag to push cache artifact to remote registry
use --cache-to flag to push cache artifact to remote registry
No
false
type: boolean
boolean
enable_dlc
enable docker layer cache
enable docker layer cache
No
false
type: boolean
boolean
enable_load
Load image into local docker
Load image into local docker
No
false
type: boolean
boolean
enable_push
push the image to the registry
push the image to the registry
No
true
type: boolean
boolean
extra_build_args
Arguments to pass while building the docker image
Arguments to pass while building the docker image
No
''
type: string
string
force_execute
force to update the build, if there is a change or not.
force to update the build, if there is a change or not.
No
false
type: boolean
boolean
image_repo
The container image repository
Required
The container image repository
Yes
-
type: string
string
image_tag
The container image tag
The container image tag
No
''
type: string
string
inject_aws_credentials
Inject AWS credentials into the build
Inject AWS credentials into the build
No
false
type: boolean
boolean
kms_key
KMS Key to sign the containers
KMS Key to sign the containers
No
awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf
type: string
string
local_registry
Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file)
Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file)
No
false
type: boolean
boolean
local_registry_container_image
container image to run verdaccio
container image to run verdaccio
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
package
Monorepo package.
Monorepo package.
No
''
type: string
string
package_folder
Package folder to check
Package folder to check
No
packages
type: string
string
platform
Platform to build the image
Platform to build the image
No
linux/amd64
type: string
string
remote_docker_version
Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge
Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge
No
default
type: string
string
request_remote_docker
Add the option to request a new remote docker, set to false when you concat docker jobs
Add the option to request a new remote docker, set to false when you concat docker jobs
No
true
type: boolean
boolean
sem_ver_override
Semantic release version of the package
Semantic release version of the package
No
''
type: string
string
update_track_file
Determines if the track file will be updated or not
Determines if the track file will be updated or not
No
true
type: boolean
boolean

vf_python_restore_cache

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_prefix
Cache prefix
Cache prefix
No
''
type: string
string
working_directory
Cache directory for poetry.lock file
Cache directory for poetry.lock file
No
./
type: string
string

vf_python_save_cache

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_prefix
Cache prefix
Cache prefix
No
''
type: string
string
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

vf_restore_cache

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_prefix
Cache prefix
Cache prefix
No
''
type: string
string
yarn_lock_restore_cache_directory
Cache directory for yarn.lock file
Cache directory for yarn.lock file
No
./
type: string
string

vf_save_cache

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
cache_prefix
Cache prefix
Cache prefix
No
''
type: string
string
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string

vfcli-create-or-get-free-env-from-pool

Uses vfcli to create a new environment (vfcli must already be installed)

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
env-name
Name of the environment to create
Required
Name of the environment to create
Yes
-
type: string
string
force
Whether to force environment creation without checking for free environment
Whether to force environment creation without checking for free environment
No
false
type: boolean
boolean
lease
Time to lease the environment for
Time to lease the environment for
No
1h
type: string
string
node-group
Name of the node group to use
Name of the node group to use
No
e2e
type: string
string
pool-type
Type of the pool to get the environment from
Required
Type of the pool to get the environment from
Yes
-
type: string
string
track-file
Path to the track-mapping file to use
Path to the track-mapping file to use
No
''
type: string
string

vfcli-delete-or-release-env

Uses vfcli to delete an environment

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
env-name
Name of the environment to create
Required
Name of the environment to create
Yes
-
type: string
string
env-name-path
Path to the env_name file
Path to the env_name file
No
/home/circleci/voiceflow/env_name.txt
type: string
string
force
Whether to delete the environment forcefully
Whether to delete the environment forcefully
No
false
type: boolean
boolean
reset-db
Whether to reset the database
Whether to reset the database
No
false
type: boolean
boolean
when
When to run this command
When to run this command
No
always
type: string
string

vfcli-fetch-endpoints

Uses vfcli fetch the specified component URLs from an environment and stores them in env vars

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
components
Space-separated list of components to fetch
Required
Space-separated list of components to fetch
Yes
-
type: string
string
env-name
Name of the environment to create
Required
Name of the environment to create
Yes
-
type: string
string
env-var-suffix
Suffix to use for the environment variables (e.g. "CREATOR_APP_SUFFIX")
Suffix to use for the environment variables (e.g. "CREATOR_APP_SUFFIX")
No
_URL
type: string
string

vfcli-resetdb-free-env

Uses vfcli to reset database and free an environment back into the pool

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
env-name
Name of the environment to reset database and free back into the pool
Required
Name of the environment to reset database and free back into the pool
Yes
-
type: string
string

vfcli-suspend-env

Uses vfcli to suspend an existing environment with a set of tracks (vfcli must already be installed)

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
env-name
Name of the environment to prepare
Required
Name of the environment to prepare
Yes
-
type: string
string
env-name-path
Path to the env_name file
Path to the env_name file
No
/home/circleci/voiceflow/env_name.txt
type: string
string
track-file
Path to the track-mapping file to use
Required
Path to the track-mapping file to use
Yes
-
type: string
string

yarn_command

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
container_folder_to_copy
Container folder to copy after the execution
Container folder to copy after the execution
No
''
type: string
string
container_image
Container image to run the yarn command
Container image to run the yarn command
No
168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1
type: string
string
max_retries
Maximum number of retries
Maximum number of retries
No
2
type: integer
integer
monorepo_package
Monorepo Package Name
Monorepo Package Name
No
''
type: string
string
monorepo_package_folder
Package folder
Package folder
No
packages
type: string
string
request_remote_docker
Request remote Docker
Request remote Docker
No
false
type: boolean
boolean
run_in_background
run the command in background
run the command in background
No
false
type: boolean
boolean
run_in_container
Run build in a container
Run build in a container
No
false
type: boolean
boolean
sleep_time
Time (in seconds) to sleep between retries
Time (in seconds) to sleep between retries
No
5
type: integer
integer
step_name
Name of the step
Name of the step
No
Deploy application
type: string
string
wait
wait until all the commands are finished
wait until all the commands are finished
No
false
type: boolean
boolean
working_directory
Directory containing package.json
Directory containing package.json
No
./
type: string
string
yarn_command
Yarn command to execute
Required
Yarn command to execute
Yes
-
type: string
string

Executors

build-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
medium
type: string
string
tag
-
-
No
25.0.5-dind-vf-4
type: string
string

code-test-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
large
type: string
string

code-test-executor-node-20

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
large
type: string
string
tag
-
-
No
v3
type: string
string

collector-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_node_memory
Default node memory.
Default node memory.
No
'4096'
type: string
string
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
medium+
type: string
string
tag
-
-
No
'2024.12'
type: string
string

cypress-e2e-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
xlarge
type: string
string

default-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
medium
type: string
string

default-executor-node-20

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
medium
type: string
string
tag
-
-
No
20.17.0-vf-5
type: string
string

e2e-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
xlarge
type: string
string
user
Default user to run the commands
Default user to run the commands
No
root
type: string
string

go-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
large
type: string
string

gomplate-executor

Show executor Source

java-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
medium+
type: string
string

lambda-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
arm.medium
type: string
string

node-codegen-executor

Show executor Source

node-codegen-executor-node-20

Show executor Source

node-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_node_memory
Default node memory
Default node memory
No
'4096'
type: string
string
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
medium+
type: string
string

node-executor-node-20

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_node_memory
Default node memory.
Default node memory.
No
'4096'
type: string
string
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
medium+
type: string
string
tag
-
-
No
20.17-vf-5
type: string
string

node-large-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_node_memory
Default node memory
Default node memory
No
'4096'
type: string
string
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
large
type: string
string

node-large-executor-node-20

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_node_memory
Default node memory
Default node memory
No
'4096'
type: string
string
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
large
type: string
string

playwright-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
playwright-version
-
Required
-
Yes
-
type: string
string

python-executor

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
default_resource_class
Default resource class for the executor
Default resource class for the executor
No
medium+
type: string
string

smoke-executor

Show executor Source

Orb Source

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 # This code is licensed from CircleCI to the user under the MIT license. # See here for details: https://circleci.com/developer/orbs/licensing version: 2.1 description: Voiceflow's common CI/CD orb orbs: gh: circleci/github-cli@1.0 slack: circleci/slack@4.2.1 sonarcloud: sonarsource/sonarcloud@2.0.0 commands: add_ip_to_security_group: parameters: execute_when: default: on_success description: When execute this command type: string sg_id: description: Id of the security group type: string steps: - run: command: | # Get the public IP of the current CircleCI runner PUBLIC_IP=$(curl ipinfo.io/ip) # Add an ingress rule to the security group to allow access to current machine aws ec2 authorize-security-group-ingress --group-id $SG_ID --protocol tcp --port 22 --cidr $PUBLIC_IP/24 environment: SG_ID: << parameters.sg_id >> name: Add IP to Security Group when: << parameters.execute_when >> analyze_dependencies: parameters: extra_args: default: "" description: Additional yarn command options type: string run_in_backgorund: default: false description: run the command in background type: boolean step_name: default: Analyze dependencies description: Name of the step type: string working_directory: default: ./ description: Directory containing package.json type: string steps: - run: background: << parameters.run_in_backgorund >> command: yarn analyze:dependencies << parameters.extra_args >> name: << parameters.step_name >> working_directory: << parameters.working_directory >> authenticate_npm: parameters: run_in_background: default: false description: run the command in background type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - run: background: << parameters.run_in_background >> command: |- #!/bin/bash echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc cat \<< EOF > ~/.yarnrc.yml npmRegistries: "https://registry.yarnpkg.com": npmAuthToken: $NPM_TOKEN "https://registry.npmjs.org": npmAuthToken: $NPM_TOKEN EOF name: authenticate npm working_directory: << parameters.working_directory >> authenticate_poetry: parameters: run_in_background: default: false description: run the command in background type: boolean working_directory: default: ./ description: Directory containing pyproject.toml type: string steps: - run: background: << parameters.run_in_background >> command: |- #!/bin/bash domain=${1:-voiceflow-libs} repo=${2:-voiceflow-libs} owner=${3:-168387678261} CODEARTIFACT_REPOSITORY_URL=$(aws codeartifact get-repository-endpoint \ --domain "$domain" \ --domain-owner "$owner" --repository "$repo" \ --format pypi --query repositoryEndpoint --output text) CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain "$domain" \ --domain-owner "$owner" \ --query authorizationToken --output text) CODEARTIFACT_USER=aws poetry config repositories."$repo" "$CODEARTIFACT_REPOSITORY_URL" poetry config http-basic."$repo" "$CODEARTIFACT_USER" "$CODEARTIFACT_AUTH_TOKEN" name: authenticate poetry working_directory: << parameters.working_directory >> build: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string container_image_to_build: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: Container image to run the build type: string extra_args: default: "" description: Additional yarn command options type: string package: default: "" description: Container folder to copy after the execution type: string package_folder: default: packages description: Package folder type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Build description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> container_image: << parameters.container_image_to_build >> monorepo_package: << parameters.package >> monorepo_package_folder: << parameters.package_folder >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn build<<# parameters.package >>:<</ parameters.package >><< parameters.package >> << parameters.extra_args >> build_push_image: parameters: build_context: default: . description: Path to the context for the docker build type: string checkout: default: true description: Determines if a checkout will be executed or not type: boolean dockerfile: default: Dockerfile description: Name of the Dockerfile to build type: string force_execute: default: false description: '[DEPRECATED] no effect, kept for backward compatibility' type: boolean image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string inject_aws_credentials: default: false description: Inject AWS credentials into the build type: boolean kms_key: default: awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf description: KMS Key to sign the containers type: string local_registry_container_image: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: container image to run verdaccio type: string monorepo_directory: default: "" description: the root directory of monorepo, uses a local registry to pre-release package versions type: string package: default: "" description: The monorepo package that has been changed type: string package_folder: default: packages description: The monorepo package that has been changed type: string request_remote_docker: default: true description: Add the option to request a new remote docker, set to false when you concat docker jobs type: boolean sem_ver_override: default: "" description: Semantic release version of the package type: string use_tag_versioning: default: true description: Use tag versioning to tag the image type: boolean steps: - when: condition: << parameters.checkout >> steps: - checkout_clone - run: command: git pull || echo "Nothing to pull" name: Get latest tags - when: condition: << parameters.request_remote_docker >> steps: - setup_remote_docker: version: default - attach_workspace: at: ~/voiceflow - docker_login - when: condition: << parameters.monorepo_directory >> steps: - setup_local_registry: container_image: << parameters.local_registry_container_image >> verdaccio_config: << parameters.monorepo_directory >>/config/verdaccio/config.yaml - monorepo_publish_to_local_registry: working_directory: << parameters.monorepo_directory >> - run: command: | #!/bin/bash # Expected env vars echo "SEM_VER_OVERRIDE: $SEM_VER_OVERRIDE" echo "IMAGE_TAG_OVERRIDE: $IMAGE_TAG_OVERRIDE" echo "IMAGE_REPO: $IMAGE_REPO" echo "PACKAGE: $PACKAGE" echo "BUILD_CONTEXT: $BUILD_CONTEXT" echo "DOCKERFILE: $DOCKERFILE" echo "MONOREPO_DIRECTORY: $MONOREPO_DIRECTORY" echo "INJECT_AWS_CREDENTIALS: ${INJECT_AWS_CREDENTIALS?}" echo "USE_TAG_VERSIONING: ${USE_TAG_VERSIONING:-true}" if [[ "$IMAGE_TAG_OVERRIDE" == "" ]]; then IMAGE_TAG="k8s-$CIRCLE_SHA1" else IMAGE_TAG="$IMAGE_TAG_OVERRIDE" fi IMAGE_NAME="$IMAGE_REPO:$IMAGE_TAG" # Semantic release from the current tags if [[ "$CIRCLE_BRANCH" == "master" || "$CIRCLE_BRANCH" == "production" ]]; then if [[ "${USE_TAG_VERSIONING:-false}" == "true" ]]; then git fetch --tags SEM_VER=$(git describe --abbrev=0 --tags) if [[ -n "$PACKAGE" ]]; then SEM_VER=$(git describe --abbrev=0 --tags --match "@voiceflow/$PACKAGE@*") SEM_VER="${SEM_VER##*@}" fi else SEM_VER="$CIRCLE_BRANCH-$CIRCLE_SHA1" fi elif [[ "$SEM_VER_OVERRIDE" != "" ]]; then SEM_VER=$SEM_VER_OVERRIDE else SEM_VER=$CIRCLE_BRANCH-$CIRCLE_SHA1 fi echo -e "Building with SEM_VER=$SEM_VER" if [[ ! -f "$BUILD_CONTEXT/yarn.lock" && -f "yarn.lock" ]]; then echo "Copying yarn.lock file from root" cp yarn.lock "$BUILD_CONTEXT"/yarn.lock fi if [ -z "$MONOREPO_DIRECTORY" ]; then REGISTRY_ARG=(--build-arg NPM_TOKEN=//registry.npmjs.org/:_authToken="${NPM_TOKEN}") else REGISTRY_ARG=(--network host --build-arg build_REGISTRY_URL=http://localhost:4873) fi if [[ -n "$PACKAGE" ]]; then PACKAGE_ARG=(--build-arg APP_NAME="$PACKAGE") fi if (( INJECT_AWS_CREDENTIALS )); then AWS_CREDENTIALS_ARG=(--build-arg AWS_REGION="${AWS_REGION}" --build-arg AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" --build-arg AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}") fi docker build \ "${REGISTRY_ARG[@]}" \ "${PACKAGE_ARG[@]}" \ "${AWS_CREDENTIALS_ARG[@]}" \ --build-arg build_BUILD_NUM="${CIRCLE_BUILD_NUM}" \ --build-arg build_BUILD_URL="${CIRCLE_BUILD_URL}" \ --build-arg build_GITHUB_TOKEN="${GITHUB_TOKEN}" \ --build-arg build_GIT_SHA="${CIRCLE_SHA1}" \ --build-arg build_SEM_VER="${SEM_VER}" \ -f "$BUILD_CONTEXT"/"$DOCKERFILE" \ -t "$IMAGE_NAME" "$BUILD_CONTEXT" environment: BUILD_CONTEXT: << parameters.build_context >> DOCKERFILE: << parameters.dockerfile >> IMAGE_REPO: << parameters.image_repo >> IMAGE_TAG_OVERRIDE: << parameters.image_tag >> INJECT_AWS_CREDENTIALS: << parameters.inject_aws_credentials >> MONOREPO_DIRECTORY: << parameters.monorepo_directory >> PACKAGE: << parameters.package >> SEM_VER_OVERRIDE: << parameters.sem_ver_override >> USE_TAG_VERSIONING: << parameters.use_tag_versioning >> name: Build docker image - run: command: |- #!/bin/bash if [[ "$IMAGE_TAG_OVERRIDE" == "" ]]; then IMAGE_TAG="k8s-$CIRCLE_SHA1" else IMAGE_TAG="$IMAGE_TAG_OVERRIDE" fi IMAGE_NAME="$IMAGE_REPO:$IMAGE_TAG" echo "Pushing $IMAGE_NAME" docker push "$IMAGE_NAME" # Signing Docker Image cosign sign --key "$KMS_KEY" "$IMAGE_NAME" # if a tag is set, do not push to latest-$BRANCH_NAME if [[ "$IMAGE_TAG_OVERRIDE" == "" ]]; then if [[ -z "$CIRCLE_BRANCH" && -n "$CIRCLE_TAG" ]]; then BRANCH_NAME="master" else BRANCH_NAME="${CIRCLE_BRANCH//[^[:alnum:]]/-}" fi docker tag "$IMAGE_NAME" "$IMAGE_REPO":latest-"$BRANCH_NAME" docker push "$IMAGE_REPO":latest-"$BRANCH_NAME" # Signing Docker Image cosign sign --key "$KMS_KEY" "$IMAGE_REPO":latest-"$BRANCH_NAME" # To not to have untagged images docker tag "$IMAGE_NAME" "$IMAGE_REPO":k8s-"$BRANCH_NAME"-"$CIRCLE_SHA1" docker push "$IMAGE_REPO":k8s-"$BRANCH_NAME"-"$CIRCLE_SHA1" cosign sign --key "$KMS_KEY" "$IMAGE_REPO":k8s-"$BRANCH_NAME"-"$CIRCLE_SHA1" fi environment: IMAGE_REPO: << parameters.image_repo >> IMAGE_TAG_OVERRIDE: << parameters.image_tag >> INJECT_AWS_CREDENTIALS: << parameters.inject_aws_credentials >> KMS_KEY: << parameters.kms_key >> name: Push docker images buildx_cleanup: parameters: builder: default: "" description: | Buildx builder name Consider this the key for CircleCI DLC type: string image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string target: description: Dockerfile stage to build type: string steps: - run: command: | if [[ -z "$CIRCLE_BRANCH" && -n "$CIRCLE_TAG" ]]; then BRANCH_NAME="master" else BRANCH_NAME="${CIRCLE_BRANCH//[^[:alnum:]]/-}" # Change all non alphanumeric characters to - fi BUILDER="<< parameters.builder >>" echo "BUILDER: ${BUILDER:=buildy-${BRANCH_NAME-}}" docker buildx inspect "<< parameters.builder >>" >/dev/null 2>&1 || docker buildx create --platform="${PLATFORMS}" --name "${BUILDER}" docker buildx use "${BUILDER-}" docker buildx inspect --bootstrap docker image rm "<< parameters.image_repo >>:<< parameters.image_tag >>" name: Cleaning up build artifacts check_commit_message: parameters: commit_message: description: Commit message to check type: string match_env_var: default: COMMIT_MESSAGE_MATCH description: Environment variable to set with the result of the match type: env_var_name should_halt: default: true description: Whether to halt the job if the commit message does not match type: boolean steps: - when: condition: << parameters.should_halt >> steps: - run: command: | # If a message has been introduced, we have to check that in the commit message, if it is not included, the braches will not be synced # this is for the use case of the bugfix mechanism COMMIT_MESSAGE="$(git log --format=oneline -n 1 $CIRCLE_SHA1)" # If CHECK_COMMIT_MESSAGE is empty, this is always false if [[ $COMMIT_MESSAGE != *"$CHECK_COMMIT_MESSAGE"* ]]; then circleci-agent step halt fi environment: CHECK_COMMIT_MESSAGE: << parameters.commit_message >> name: Check commit message - unless: condition: << parameters.should_halt >> steps: - run: command: | # If a message has been introduced, we have to check that in the commit message, if it is not included, the braches will not be synced # this is for the use case of the bugfix mechanism COMMIT_MESSAGE="$(git log --format=oneline -n 1 $CIRCLE_SHA1)" # If CHECK_COMMIT_MESSAGE is empty, this is always false MATCH="false" if [[ $COMMIT_MESSAGE == *"$CHECK_COMMIT_MESSAGE"* ]]; then MATCH="true" fi echo "export << parameters.match_env_var >>=\"$MATCH\"" >> "$BASH_ENV" environment: CHECK_COMMIT_MESSAGE: << parameters.commit_message >> name: Check commit message and set env var check_env_var_exists: description: Check if an environment variable exists parameters: env_var: description: Environment variable to check type: env_var_name steps: - run: command: | ENV_VAR="<< parameters.env_var >>" ENV_VAR_VALUE="${<< parameters.env_var >>}" echo "Checking if environment variable $ENV_VAR exists" if [[ -z "${ENV_VAR_VALUE}" ]]; then echo "Environment variable $ENV_VAR is not defined" exit 1 else echo "Environment variable $ENV_VAR is defined" exit 0 fi name: Fail if environment variable does not exist check_image_exists: description: Check if a Docker image exists parameters: image_repo: description: The container image repository type: string request_remote_docker: default: true description: Add the option to request a new remote docker, set to false when you concat docker jobs type: boolean steps: - when: condition: << parameters.request_remote_docker >> steps: - setup_remote_docker: version: default - docker_login - run: command: | IMAGE_REPO="<< parameters.image_repo >>" IMAGE_TAG="k8s-$CIRCLE_SHA1" IMAGE_NAME="$IMAGE_REPO:$IMAGE_TAG" set +e DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $IMAGE_NAME > /dev/null 2>&1 SEARCH_IMAGE_RESULT=$? set -e # Store the result on a file in tmp folder to use in future steps if [[ $SEARCH_IMAGE_RESULT -eq 0 ]]; then echo 'export IMAGE_EXISTS="true"' > /tmp/IMAGE_STATUS # Image exists, skip following steps else echo 'export IMAGE_EXISTS="false"' > /tmp/IMAGE_STATUS # Image exists, skip following steps fi name: If container with this git SHA already exists, don't build check_track_exists: description: Check if a track exists parameters: bucket: default: com.voiceflow.ci.assets description: The container image repository type: string component: description: The container image repository type: string stop_if_not_exists: default: false description: Stop if the bucket does not exists type: boolean steps: - run: command: | #!/bin/bash # Expected env vars echo "${STOP?}" echo "${COMPONENT?}" echo "${BUCKET?}" BRANCH_NAME="$CIRCLE_BRANCH" if [[ -z "$CIRCLE_BRANCH" && -n "$CIRCLE_TAG" ]]; then BRANCH_NAME="master" fi TRACK="tracks/$COMPONENT/$BRANCH_NAME" echo "$TRACK" set +e aws s3 cp "s3://$BUCKET/$TRACK" "/tmp/$TRACK" SEARCH_TRACK_RESULT=$? set -e # Store the result on a file in tmp folder to use in future steps if [[ $SEARCH_TRACK_RESULT -eq 0 || "$CIRCLE_BRANCH" =~ ^gtmq_ ]]; then # Track exists, skip following steps cat \<<-EOF >/tmp/TRACK_STATUS export TRACK_EXISTS="true" export TRACK="${TRACK}" EOF else echo 'export TRACK_EXISTS="false"' >/tmp/TRACK_STATUS # Track does not exist if ((STOP)); then curl --request POST \ --url "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/cancel" \ --header "Circle-Token: ${CIRCLECI_API_TOKEN}" fi fi environment: BUCKET: << parameters.bucket >> COMPONENT: << parameters.component >> STOP: << parameters.stop_if_not_exists >> name: If track does not exists, don't build checkout_clone: parameters: clone_type: default: shallow description: type of clone to perform [shallow, treeless] type: string github_branch: default: CIRCLE_BRANCH description: git branch for the repo provided type: env_var_name github_repo_name: default: CIRCLE_PROJECT_REPONAME description: github repo name type: env_var_name github_tag: default: CIRCLE_TAG description: git tag for the repo provided type: env_var_name github_token: default: GITHUB_TOKEN description: token for cloning git repositories type: env_var_name github_username: default: GITHUB_USERNAME description: username for cloning git repositories type: env_var_name path_to_clone: default: . description: Path to clone the github repo type: string run_in_background: default: false description: run the command in background type: boolean steps: - when: condition: equal: - shallow - << parameters.clone_type >> steps: - run: background: << parameters.run_in_background >> command: | git clone --depth=2 -b ${<< parameters.github_branch >>:-${<< parameters.github_tag >>:?}} https://${<< parameters.github_username >>}:${<< parameters.github_token >>}@github.com/voiceflow/${<< parameters.github_repo_name >>} << parameters.path_to_clone >> git fetch origin master --depth=2 name: Checkout code with shallow clone - when: condition: equal: - treeless - << parameters.clone_type >> steps: - run: background: << parameters.run_in_background >> command: | git clone --filter=tree:0 https://${<< parameters.github_username >>}:${<< parameters.github_token >>}@github.com/voiceflow/${<< parameters.github_repo_name >>} << parameters.path_to_clone >> git checkout ${<< parameters.github_branch >>:-${<< parameters.github_tag >>:?}} name: Checkout code with treeless clone clone_repo: parameters: github_commit: default: "" description: git commit hash for the repo provided type: string github_repo_name: description: github repo name type: string github_token: default: GITHUB_TOKEN description: token for cloning git repositories type: env_var_name github_username: default: GITHUB_USERNAME description: username for cloning git repositories type: env_var_name path_to_clone: default: ./ description: Path to clone the github repo type: string run_in_background: default: false description: run the command in background type: boolean step_name: default: Clone git repository description: Name of the step type: string steps: - run: background: << parameters.run_in_background >> command: | git clone https://${<< parameters.github_username >>}:${<< parameters.github_token >>}@github.com/voiceflow/<< parameters.github_repo_name >> << parameters.path_to_clone >> cd << parameters.path_to_clone >> git checkout << parameters.github_commit >> name: << parameters.step_name >> clone_s3_assets: parameters: cache_control: default: "" description: Cache control header value type: string clean_destination: default: false description: Clean destination type: boolean from: description: S3 URL type: string step_name: default: Clone S3 assets description: Name of the step type: string to: description: Path to clone S3 assets type: string steps: - run: command: | #!/bin/bash if (( CLEAN_DESTINATION )); then if [[ -n "$CACHE_CONTROL" ]]; then aws s3 sync "$FROM" "$TO" --delete --cache-control "$CACHE_CONTROL" else aws s3 sync "$FROM" "$TO" --delete fi else if [[ -n "$CACHE_CONTROL" ]]; then aws s3 sync "$FROM" "$TO" --cache-control "$CACHE_CONTROL" else aws s3 sync "$FROM" "$TO" fi fi environment: CACHE_CONTROL: << parameters.cache_control >> CLEAN_DESTINATION: << parameters.clean_destination >> FROM: << parameters.from >> TO: << parameters.to >> name: << parameters.step_name >> compute_base_revision: parameters: base_revision: default: master description: Git revision to compare against type: string git_branch: default: master description: Current git branch type: string target_env_var: default: COMPUTED_BASE_REVISION description: Environment variable to set with the list of changed files type: env_var_name steps: - run: command: | # For all branches: # For review envs, normal PR's,branch rebases,bors trying/staging and renovate builds, use master as the base revision; except for production BASE="master" # For production branch: # Multiple PR's are merged into it master independently before the `branch-sync` to production occurs. # After sync, the 2 branches are a mirror of each other because the current SHA for production is similar to the SHA for master branch # In the case where the SHA's are the same, we then do a diff between HEAD and HEAD~1, which discards all other changes # Using latest master as base revision for production would cause us to skip detecting all other changes except HEAD~1 up to HEAD, for monorepos # The fix is to use the base revision as the commit of the previous circleci build on production branch, ensuring that all changes are detected # Circleci exposes the last build's commit as an environment variable `pipeline.git.base_revision` which is passed to this command as `base_revision` parameter if [[ $GIT_BRANCH == "production" ]] ; then BASE="$BASE_REVISION" echo "Setting base revision to $BASE_REVISION for $GIT_BRANCH" fi echo "COMPUTED_BASE_REVISION environment variable to set to $BASE" echo "export << parameters.target_env_var >>=\"$BASE\"" >> "$BASH_ENV" environment: BASE_REVISION: << parameters.base_revision >> GIT_BRANCH: << parameters.git_branch >> name: Put computed base revision in << parameters.target_env_var >> environment variable copy_s3_asset: parameters: from: description: S3 URL type: string step_name: default: Copy S3 asset description: Name of the step type: string to: description: Path to copy S3 asset type: string steps: - run: command: aws s3 cp << parameters.from >> << parameters.to >> name: << parameters.step_name >> create_commit_status: parameters: check-name: description: Name of the job to skip type: string description: description: Text that shows in GH checks type: string status: description: Status of check enum: - error - failure - pending - success type: enum steps: - run: command: | curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/voiceflow/${CIRCLE_PROJECT_REPONAME}/statuses/${CIRCLE_SHA1}" \ --data-binary @- \<<EOF { "state": "<< parameters.status >>", "target_url": "https://app.circleci.com/pipelines/github/voiceflow/${CIRCLE_PROJECT_REPONAME}", "description": "<< parameters.description >>", "context": "<< parameters.check-name >>" } EOF environment: CHECK_NAME: << parameters.check-name >> DESCRIPTION: << parameters.description >> STATUS: << parameters.status >> name: Setting << parameters.check-name >> check to << parameters.status >> delete_branch: parameters: branch_name: description: Name of the branch to delete type: string ssh_key: description: The SSH key with write permissions to the repository type: string step_name: default: Delete branch description: Name of the step type: string steps: - add_ssh_keys: fingerprints: - << parameters.ssh_key >> - run: command: git push origin --delete << parameters.branch_name >> --no-verify name: << parameters.step_name >> dependency_tests: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Dependency tests description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn test:dependencies << parameters.extra_args >> docker_login: steps: - run: command: | if aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 168387678261.dkr.ecr.us-east-1.amazonaws.com; then echo "Login succeeded with get-login-password" else echo "Login with get-login-password failed, falling back to get-login" $(aws ecr get-login --no-include-email --region us-east-1) fi name: ECR Docker Login docker_prune: parameters: clean_images: default: true description: Whether to prune images type: boolean clean_volumes: default: true description: Whether to prune volumes type: boolean when: default: on_success description: When to execute pruning (`always`, `on_success`, `on_fail`) type: string steps: - run: command: |- #!/bin/bash echo "Clean Volumes: $CLEAN_VOLUMES" echo "Clean Images: $CLEAN_IMAGES" if (( CLEAN_IMAGES )); then echo "cleaning unused images..." docker system prune -f fi if (( CLEAN_VOLUMES )); then echo "cleaning unused volumes..." docker volume prune -f fi environment: CLEAN_IMAGES: << parameters.clean_images >> CLEAN_VOLUMES: << parameters.clean_volumes >> name: Docker Prune when: << parameters.when >> docker_run_networked: parameters: command: default: yarn test:integration description: Command to run in docker container type: string image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string platforms: default: linux/amd64 description: Platform to build against type: string post_steps: default: [] description: post steps type: steps pre_steps: default: [] description: pre steps type: steps steps: - steps: << parameters.pre_steps >> - run: command: | # Get the container id for kubernetes/pause, which is used as the shared network with secondary container services K8S_ID="$(docker container ls --format '{{ .Image }} | {{ .ID }}' | grep 'pause' | sed -E 's/^.* | (.*)$/\1/g' )" docker run \ --rm -i \ --network="container:${K8S_ID-}" \ --platform "<< parameters.platforms >>" \ --entrypoint /bin/sh \ << parameters.image_repo >>:<< parameters.image_tag >> \<<EOF echo '127.0.0.1 creator-app.test.e2e postgres.test.e2e redis.test.e2e localstack.test.e2e mongodb.test.e2e server-data-api.test.e2e creator-api.test.e2e admin-api.test.e2e auth-api.test.e2e analytics-api.test.e2e billing-api.test.e2e identity-api.test.e2e luis-authoring-service.test.e2e integrations.test.e2e custom-api.test.e2e canvas-export.test.e2e alexa-runtime.test.e2e alexa-service.test.e2e general-runtime.test.e2e general-service.test.e2e google-runtime.test.e2e google-service.test.e2e realtime.test.e2e ingest.test.e2e event-ingestion-service.test.e2e billing-api.test.e2e identity-api.test.e2e auth-api.test.e2e runtime-api.test.e2e analytics-api.test.e2e admin-api.test.e2e test-api.test.e2e' >> /etc/hosts # Passthrough secrets export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY << parameters.command >> EOF name: Running command in networked docker container - steps: << parameters.post_steps >> gen_certs: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Generate certificates description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn gen-certs gen_certs_e2e: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Generate certificates for e2e tests description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn gen-certs:e2e generate-track-mapping: description: | Generate component-track mapping file for provisioning an environment with the correct components for e2e parameters: components: default: "" description: Space-separated list of components to include in the track-mapping file type: string track: description: Track to use for the components type: string track-file: default: tracks.yaml description: Path to the track-mapping file to use type: string steps: - run: command: | touch "${TRACK_FILE:?}" for COMPONENT in ${COMPONENTS?}; do echo "${COMPONENT}: ${TRACK:?}" >> "${TRACK_FILE:?}" done cat "${TRACK_FILE:?}" environment: COMPONENTS: << parameters.components >> TRACK: << parameters.track >> TRACK_FILE: << parameters.track-file >> name: Generate track-mapping file get_changed_files: parameters: target_file: default: /tmp/changed_files.txt description: Absolute path to write the list of changed files to. Absolute so it survives consumers that set a custom working_directory (e.g. helm). type: string steps: - run: command: | if [[ -z $COMPUTED_BASE_REVISION ]]; then BASE_REVISION="master" echo "Computed base revision is empty.Using default base revision of master" else BASE_REVISION="$COMPUTED_BASE_REVISION" echo "Setting base revision to computed base revision: $BASE_REVISION" fi BASE="$(git merge-base $CIRCLE_SHA1 $BASE_REVISION)" # If we are on master, use the previous commit as the base if [[ $BASE == $CIRCLE_SHA1 ]]; then BASE="$(git rev-parse HEAD~1)" fi git diff --name-status --no-commit-id -r $BASE...$CIRCLE_SHA1 > "<< parameters.target_file >>" echo "export CHANGED_FILES_FILE=\"<< parameters.target_file >>\"" >> "$BASH_ENV" name: Write list of changed files to << parameters.target_file >> hadolint_presteps: description: | Install git and setup for treeless shallow clone before hadolint parameters: ssh_fingerprint: description: SSH Key type: string steps: - add_ssh_keys: fingerprints: - << parameters.ssh_fingerprint >> - run: command: apt update && apt install -y git name: Install git - run: command: | mkdir -p ~/.ssh echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=' >>~/.ssh/known_hosts name: Setup SSH - run: command: | git clone --single-branch --no-tags --filter=tree:0 --depth 1 -b "${CIRCLE_BRANCH}" "${CIRCLE_REPOSITORY_URL}" ~/project name: Treeless Shallow Checkout helm-add-repos: description: Add voiceflow Helm repos steps: - run: command: | helm repo add voiceflow-charts-s3 s3://voiceflow-charts helm repo add voiceflow-charts-s3-private s3://voiceflow-charts-private helm repo add voiceflow-charts-s3-beta s3://voiceflow-charts-beta helm repo add external-secrets-operator https://charts.external-secrets.io helm repo update name: Add voiceflow Helm repos helm-get-modified-charts: parameters: chart_directory: default: . description: Directory containing the charts type: string modified_charts_env_var: default: MODIFIED_CHARTS description: Environment variable to set with the list of modified charts type: env_var_name steps: - run: command: | #!/bin/bash # Expected environment variables: echo "CHANGED_FILES_FILE: ${CHANGED_FILES_FILE:?}" echo "CHART_DIR: ${CHART_DIR:?}" echo "MODIFIED_CHARTS_ENV: ${MODIFIED_CHARTS_ENV:?}" # Add trailing slash to CHART_DIR if missing if [[ "$CHART_DIR" != */ ]]; then CHART_DIR="${CHART_DIR}/" fi # Handle chart directory being the root if [[ "$CHART_DIR" == "./" ]]; then CHART_DIR="" fi # Get the list of all charts ALL_CHARTS=() for DIR in * ; do if [[ -d "$DIR" && -f "$DIR/$DIR/Chart.yaml" ]]; then ALL_CHARTS+=("$DIR") fi; done # Extract only modified charts MODIFIED_CHARTS=() for CHART in "${ALL_CHARTS[@]}"; do if grep -q -oP "(M|A)\s*${CHART_DIR}${CHART}/${CHART}/.*" "${CHANGED_FILES_FILE:?}"; then MODIFIED_CHARTS+=("$CHART") fi; done echo "${MODIFIED_CHARTS[@]}" # shellcheck disable=SC2145 echo "export ${MODIFIED_CHARTS_ENV:?}=\"${MODIFIED_CHARTS[@]}\"" >> "$BASH_ENV" environment: CHART_DIR: << parameters.chart_directory >> MODIFIED_CHARTS_ENV: << parameters.modified_charts_env_var >> name: Set << parameters.modified_charts_env_var >> environment variable to contain list of modified charts working_directory: << parameters.chart_directory >> install-vfcli: description: Uses curl to install the specified version of vfcli parameters: arch: default: amd64 description: Architecture to install vfcli for type: string init-cluster: default: "" description: Cluster to initialize vfcli with type: string os: default: linux description: Operating system to install vfcli for type: string version: default: latest description: Version of vfcli to install type: string steps: - run: command: |- #!/bin/bash # Expected environment variables: echo "VERSION: ${VERSION:?}" echo "OS: ${OS:?}" echo "ARCH: ${ARCH:?}" API_URL="https://${GITHUB_TOKEN:?}:@api.github.com/repos/voiceflow/vfcli" ASSET_ID="$(curl "$API_URL/releases/${VERSION:?}" | jq -r ".assets[] | select(.name | contains(\"${OS:?}_${ARCH:?}\")) | .id")" curl -J -L -H "Accept: application/octet-stream" "$API_URL/releases/assets/${ASSET_ID:?}" --output vfcli.tar.gz tar -xf vfcli.tar.gz chmod 755 ./vfcli sudo cp ./vfcli /usr/local/bin/vfcli vfcli version environment: ARCH: << parameters.arch >> OS: << parameters.os >> VERSION: << parameters.version >> name: Install vfcli - when: condition: << parameters.init-cluster >> steps: - run: command: vfcli init --interactive false --no-telepresence --cluster << parameters.init-cluster >> name: Initialize vfcli with cluster << parameters.init-cluster >> install_latest_hadolint: steps: - run: command: | curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/hadolint/hadolint/releases/latest | jq -r ".assets[] | select(.name == \"hadolint-$(uname -o | sed 's/.*\///g')-$(uname -m)\") | .browser_download_url" | xargs curl -Lo hadolint sudo chown root:root ./hadolint sudo chmod 755 ./hadolint sudo mv hadolint $(which hadolint) name: Install Latest Hadolint install_node_modules: parameters: avoid_post_install_scripts: default: true description: Skip running post install scripts type: boolean cache_prefix: default: "" description: Cache prefix type: string container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string container_image: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: Container image to run the yarn command type: string install_args: default: "" description: Additional yarn install command options type: string language: default: node description: language to execute type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: Run yarn install in background mode type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Install node modules description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string yarn_lock_restore_cache_directory: default: ./ description: Cache directory for yarn.lock file type: string steps: - authenticate_npm - when: condition: equal: - python - << parameters.language >> steps: - authenticate_poetry: working_directory: << parameters.working_directory >> - vf_python_restore_cache: cache_prefix: << parameters.cache_prefix >> - run: command: | poetry install source .venv/bin/activate # Activates the virtual environment for the current job echo "source .venv/bin/activate" >> $BASH_ENV name: Install Python dependencies - vf_restore_cache: cache_prefix: << parameters.cache_prefix >> yarn_lock_restore_cache_directory: << parameters.yarn_lock_restore_cache_directory >> - when: condition: << parameters.avoid_post_install_scripts >> steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> container_image: << parameters.container_image >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn install --immutable << parameters.install_args >> 2>&1 | tee output.file - unless: condition: << parameters.avoid_post_install_scripts >> steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> container_image: << parameters.container_image >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn install --immutable << parameters.install_args >> - when: condition: equal: - python - << parameters.language >> steps: - vf_python_save_cache: cache_prefix: << parameters.cache_prefix >> - vf_save_cache: cache_prefix: << parameters.cache_prefix >> working_directory: << parameters.working_directory >> install_python_modules: parameters: cache_prefix: default: "" description: Cache prefix type: string container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string install_args: default: "" description: Additional poetry install command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: Run poetry install in background mode type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Install node modules description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - authenticate_poetry - vf_python_restore_cache: cache_prefix: << parameters.cache_prefix >> working_directory: << parameters.working_directory >> - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: poetry install --directory << parameters.working_directory >>/.poetry << parameters.install_args >> - vf_python_save_cache: cache_prefix: << parameters.cache_prefix >> working_directory: << parameters.working_directory >> integration_tests: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Integration Tests description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - set_etc_hosts_e2e - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn test:integration << parameters.extra_args >> invalidate_cloudfront_distribution: parameters: cloudfront_distribution_id: description: AWS Cloudfront Distribution ID type: string paths: description: Paths to invalidate type: string step_name: default: Invalidate Cloudfront Distribution description: Name of the step type: string steps: - run: command: |- #!/bin/bash aws cloudfront create-invalidation --distribution-id "$DISTRIBUTION" --paths "$PATHS" environment: DISTRIBUTION: << parameters.cloudfront_distribution_id >> PATHS: << parameters.paths >> name: << parameters.step_name >> lint_dockerfile: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Lint dockerfiles description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn lint:dockerfiles << parameters.extra_args >> lint_report: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Generate Lint report description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn lint:report << parameters.extra_args >> lint_source: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Lint source description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn lint:quiet << parameters.extra_args >> monorepo_analyze_dependencies: parameters: extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: default: Analyze dependencies description: Name of the step type: string steps: - monorepo_exec_command: command: yarn analyze:dependencies extra_args: << parameters.extra_args >> force_execution: << parameters.force_execution >> run_on_root: << parameters.run_on_root >> step_name: << parameters.step_name >> monorepo_build: parameters: extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: default: Build description: Name of the step type: string steps: - monorepo_exec_command: command: yarn build extra_args: << parameters.extra_args >> force_execution: << parameters.force_execution >> run_on_root: << parameters.run_on_root >> step_name: << parameters.step_name >> monorepo_dependency_tests: parameters: extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: default: Dependency tests description: Name of the step type: string steps: - monorepo_exec_command: command: yarn test:dependencies extra_args: << parameters.extra_args >> force_execution: << parameters.force_execution >> run_on_root: << parameters.run_on_root >> step_name: << parameters.step_name >> monorepo_exec_command: description: execute commands parameters: command: description: command to execute type: string extra_args: default: "" description: command to execute type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: description: Description to run type: string steps: - when: condition: << parameters.run_on_root >> steps: - run: command: << parameters.command >> << parameters.extra_args >> name: << parameters.step_name >> - unless: condition: << parameters.run_on_root >> steps: - run: command: | #!/bin/bash # shellcheck disable=SC2164 FILES_CHANGED=$(git diff HEAD^ --name-only ) echo "files changed: $FILES_CHANGED" jq -rc '.workspaces[]' package.json | while read -r i; do # Find all packages down a pacakge root directory. for example packages/*, apps/*, types/* PACKAGES=$(find . -maxdepth 2 -wholename "./$i") echo "Packages found on $i: $PACKAGES" for f in $PACKAGES; do # The find command add the ./ We dont need it. This command removes it by removing the first 2 characters. package="${f:2}" echo "Checking package $package" if [[ $FILES_CHANGED == *"$package"* || "${CIRCLE_BRANCH}" =~ ^(master|production|trying|staging|gtmq_.*)$ || -n "$CIRCLE_TAG" ]] || (( FORCE_EXECUTION )); then # Work only on folders that are real packages if [[ -d $f ]]; then ( cd "$f" echo "running command \"$COMMAND\" on $package" # Execute command $COMMAND ) fi fi done done environment: COMMAND: << parameters.command >> << parameters.extra_args >> FORCE_EXECUTION: << parameters.force_execution >> name: << parameters.step_name >> monorepo_exec_command_when_package_changed: description: execute commands parameters: command: description: command to execute type: string extra_parameters: default: "" description: command to execute type: string force_execution: default: false description: Force execution of the command on all packages type: boolean package_folder: default: packages description: Package folder type: string package_to_force_execution: description: Package to force execution type: string run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: description: Description to run type: string steps: - when: condition: << parameters.run_on_root >> steps: - run: command: << parameters.command >> << parameters.extra_parameters >> name: << parameters.step_name >> - unless: condition: << parameters.run_on_root >> steps: - run: command: | FILES_CHANGED=$(git diff HEAD^ --name-only ) echo "files changed: $FILES_CHANGED" if [[ $FILES_CHANGED == *"<< parameters.package_to_force_execution >>"* || $CIRCLE_BRANCH == "master" || $CIRCLE_BRANCH == "production" || -n "$CIRCLE_TAG" || << parameters.force_execution >> == true ]]; then << parameters.command >> << parameters.extra_parameters >> fi name: << parameters.step_name >> working_directory: << parameters.package_folder >>/<< parameters.package_to_force_execution >> monorepo_integration_tests: parameters: command: default: yarn test:integration description: Command to run type: string extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: default: Integration Tests description: Name of the step type: string steps: - monorepo_exec_command: command: << parameters.command >> extra_args: << parameters.extra_args >> force_execution: << parameters.force_execution >> run_on_root: << parameters.run_on_root >> step_name: << parameters.step_name >> monorepo_lint_dockerfile: parameters: extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: default: Lint Dockerfile description: Name of the step type: string steps: - install_latest_hadolint - monorepo_exec_command: command: yarn lint:dockerfiles extra_args: << parameters.extra_args >> force_execution: << parameters.force_execution >> run_on_root: << parameters.run_on_root >> step_name: << parameters.step_name >> monorepo_lint_report: parameters: extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: default: Generate Lint report description: Name of the step type: string steps: - monorepo_exec_command: command: yarn lint:report extra_args: << parameters.extra_args >> force_execution: << parameters.force_execution >> run_on_root: << parameters.run_on_root >> step_name: << parameters.step_name >> - store_test_results: path: ./reports monorepo_publish_to_local_registry: description: Publish all packages in monorepo to a local NPM registry parameters: working_directory: default: ./ description: root directory of the monorepo type: string steps: - run: command: | #!/bin/bash docker run -d --name prepublish --network host -v /src 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v2 tail -f /dev/null docker cp ./ prepublish:/src docker exec prepublish git config --global user.email "serviceaccount@voiceflow.com" docker exec prepublish git config --global user.name "Voiceflow" docker exec prepublish npx wait-on http://localhost:4873/-/ping docker exec -w /src prepublish npx lerna@4.0.0 publish prerelease \ --registry=http://localhost:4873 \ --force-publish \ --amend \ --exact \ --no-verify-access \ --no-commit-hooks \ --yes docker cp prepublish:/src/. ./ name: Publish pre-release versions to local proxy registry working_directory: << parameters.working_directory >> monorepo_restore_cache: parameters: cache_branch: default: "" description: Branch name to use for caching type: string cache_identifier: default: monorepo-build-cache description: Cache prefix id type: string monorepo_engine: default: lerna description: Monorepo engine type: string package: default: "" description: Package name type: string package_folder: default: packages description: Package folder type: string steps: - when: condition: equal: - all - << parameters.package >> steps: - restore_cache: keys: - << parameters.cache_identifier >>--{{ .Environment.CACHE_VERSION }}-{{ .Branch }}--{{ .Revision }} - | <<# parameters.cache_branch >> << parameters.cache_identifier >>--{{ .Environment.CACHE_VERSION }}-<< parameters.cache_branch >>- <</ parameters.cache_branch >> <<^ parameters.cache_branch >> << parameters.cache_identifier >>--{{ .Environment.CACHE_VERSION }}-{{ .Branch }}- <</ parameters.cache_branch >> - << parameters.cache_identifier >>--{{ .Environment.CACHE_VERSION }}-master- - << parameters.cache_identifier >>--{{ .Environment.CACHE_VERSION }}-production- - when: condition: equal: - lerna - << parameters.monorepo_engine >> steps: - run: command: |- # do not copy the build cache on master to avoid contamination if [ -d /tmp/build_cache ] && [ "master" != "${CIRCLE_BRANCH}" ]; then rsync --archive --update --verbose /tmp/build_cache/ . fi name: Unpack monorepo build cache monorepo_save_cache: parameters: cache_branch: default: "" description: Branch name to use for caching type: string cache_identifier: default: monorepo-build-cache description: Cache prefix id type: string monorepo_engine: default: lerna description: Monorepo engine type: string package: default: "" description: Package name type: string package_folder: default: packages description: Package folder type: string paths_to_cache: default: '{build,*.tsbuildinfo}' description: Paths to cache type: string steps: - when: condition: equal: - all - << parameters.package >> steps: - when: condition: equal: - lerna - << parameters.monorepo_engine >> steps: - run: command: |- rm -rf /tmp/build_cache mkdir --parents /tmp/build_cache find ./<< parameters.package_folder >>/*/<< parameters.paths_to_cache >> -print0 | rsync --archive --files-from=- --from0 . /tmp/build_cache name: Collect monorepo build cache - save_cache: key: << parameters.cache_identifier >>--{{ .Environment.CACHE_VERSION }}-{{ .Branch }}--{{ .Revision }} paths: - /tmp/build_cache - when: condition: equal: - turborepo - << parameters.monorepo_engine >> steps: - run: command: find node_modules/.cache/turbo -type f -mtime +7 -delete name: Clean cache directory - save_cache: key: | <<# parameters.cache_branch >> << parameters.cache_identifier >>--{{ .Environment.CACHE_VERSION }}-<< parameters.cache_branch >>--{{ .Revision }} <</ parameters.cache_branch >> <<^ parameters.cache_branch >> << parameters.cache_identifier >>--{{ .Environment.CACHE_VERSION }}-{{ .Branch }}--{{ .Revision }}" <</ parameters.cache_branch >> paths: - node_modules/.cache/turbo - when: condition: equal: - nx - << parameters.monorepo_engine >> steps: - persist_to_workspace: paths: - .cache root: . monorepo_types_tests: parameters: extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Set to `true` to run the command on root type: boolean step_name: default: Types Tests description: Name of the step type: string steps: - monorepo_exec_command: command: yarn test:types extra_args: << parameters.extra_args >> force_execution: << parameters.force_execution >> run_on_root: << parameters.run_on_root >> step_name: << parameters.step_name >> monorepo_unit_tests: parameters: extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean step_name: default: Unit Tests description: Name of the step type: string steps: - monorepo_exec_command: command: yarn test:unit extra_args: << parameters.extra_args >> force_execution: << parameters.force_execution >> run_on_root: << parameters.run_on_root >> step_name: << parameters.step_name >> notify_slack: description: Notify build status on Slack Channel parameters: branch_pattern: default: .* description: Branch pattern to allow the notification to be sent type: string channel: description: The Slack Channel where we receive the notification type: string event: description: event when the notify is triggered enum: - fail - pass - always type: enum mentions: default: "" description: Mention on the slack channel type: string template: description: Slack Message template type: string steps: - when: condition: << parameters.mentions >> steps: - slack/notify: branch_pattern: << parameters.branch_pattern >> channel: << parameters.channel >> event: << parameters.event >> mentions: << parameters.mentions >> template: << parameters.template >> - unless: condition: << parameters.mentions >> steps: - slack/notify: branch_pattern: << parameters.branch_pattern >> channel: << parameters.channel >> event: << parameters.event >> template: << parameters.template >> openapi_persist_schemas: parameters: app_dir: default: apps description: Sub-folder containing the application schemas in named folders type: string schema_name: default: openapi.json description: Name of the schema files to persist type: string workspace_dir: description: The location to persist schemas to type: string steps: - run: command: | mkdir -p << parameters.workspace_dir >> cp -v --parents << parameters.app_dir >>/*/<< parameters.schema_name >> << parameters.workspace_dir >> name: Collect Schemas when: always - persist_to_workspace: paths: - '*/*/<< parameters.schema_name >>' root: << parameters.workspace_dir >> - store_artifacts: destination: schemas path: << parameters.workspace_dir >>/<< parameters.app_dir >> openapi_restore_schemas: parameters: app_dir: default: apps description: Sub-folder containing the application schemas in named folders type: string attach_workspace: default: false description: Attach the workspace to restore schemas from a previous step type: boolean from: description: The location to restore schemas from type: string schema_name: default: openapi.json description: Name of the schema files to restore type: string to: description: The location to restore schemas to type: string steps: - when: condition: << parameters.attach_workspace >> steps: - attach_workspace: at: << parameters.from >> - run: command: cp -v --parents << parameters.app_dir >>/*/<< parameters.schema_name >> << parameters.to >> name: Restore OpenAPI Schemas working_directory: << parameters.from >> persist_node_build: parameters: package: default: "" description: Package name type: string package_folder: default: packages description: Package folder type: string steps: - when: condition: equal: - all - << parameters.package >> steps: - persist_to_workspace: paths: - ./*/*/build - .yarn/cache root: . - when: condition: and: - << parameters.package >> - not: equal: - all - << parameters.package >> steps: - persist_to_workspace: paths: - << parameters.package_folder >>/<< parameters.package >>/build - << parameters.package_folder >>/<< parameters.package >>/yarn.lock - .yarn/cache root: . - unless: condition: << parameters.package >> steps: - persist_to_workspace: paths: - build root: . persist_python_build: parameters: package: default: "" description: Package name type: string package_folder: default: packages description: Package folder type: string steps: - when: condition: equal: - all - << parameters.package >> steps: - persist_to_workspace: paths: - ./*/*/dist root: . - when: condition: and: - << parameters.package >> - not: equal: - all - << parameters.package >> steps: - persist_to_workspace: paths: - << parameters.package_folder >>/<< parameters.package >>/dist - << parameters.package_folder >>/<< parameters.package >>/poetry.lock root: . - unless: condition: << parameters.package >> steps: - persist_to_workspace: paths: - dist root: . post_image_push_actions: description: Deploy an image into a K8s cluster parameters: component: default: "" description: The component name that has changed type: string force_execute: default: false description: '[DEPRECATED] no effect, kept for backward compatibility' type: boolean namespace: description: The namespace the target resides in type: string package: default: "" description: The monorepo package that has been changed type: string package_folder: default: packages description: The monorepo package that has been changed type: string sentry: default: false description: Report deployment to sentry type: boolean ssh_key: default: 4c:f6:5f:e5:7a:e9:b4:03:91:6a:93:e5:0e:60:c2:a6 description: The SSH key with write permissions to the repository type: string success_slack_notify: default: true description: Post to Slack on successful deployment? type: boolean tagged: default: false description: Running on a git tag? type: boolean steps: - checkout_clone - add_ssh_keys: fingerprints: - << parameters.ssh_key >> - when: condition: << parameters.tagged >> steps: - run: command: |- #!/bin/bash # Expected env vars echo "SENTRY: $SENTRY" echo "NAMESPACE: $NAMESPACE" echo "COMPONENT: $COMPONENT" echo "PACKAGE: $PACKAGE" START_TIME=$(date +%s) sleep 60 #Production aws eks --region us-east-1 update-kubeconfig --name "$KUBERNETES_CLUSTER" #Cloud Snapshot aws s3 cp s3://com.voiceflow.ci.assets/scripts/cloud_snapshot.sh cloud_snapshot.sh chmod +x cloud_snapshot.sh ./cloud_snapshot.sh "$NAMESPACE" "$COMPONENT" "$PACKAGE" #FIXME THIS IS A WA with a problem with the Slack Orb and dynamic templates DEPLOY_TEMPLATE="$(cat /tmp/voiceflow/common/deploy_app_template.json)" export DEPLOY_TEMPLATE export SLACK_PARAM_TEMPLATE=DEPLOY_TEMPLATE export SLACK_PARAM_CHANNEL="deployed_versions" aws s3 cp s3://com.voiceflow.ci.assets/scripts/slack_notify.sh slack_notify.sh chmod +x slack_notify.sh ./slack_notify.sh if (( SENTRY )); then END_TIME=$(date +%s) npm config set unsafe-perm true npx @sentry/cli@1 releases deploys "${CIRCLE_TAG:1}" new -e public -t $((END_TIME-START_TIME)) fi environment: COMPONENT: << parameters.component >> NAMESPACE: << parameters.namespace >> PACKAGE: << parameters.package >> SENTRY: << parameters.sentry >> name: Post Image Push Actions - when: condition: <<parameters.success_slack_notify>> steps: - notify_slack: channel: product_releases event: pass template: success_tagged_deploy_1 - notify_slack: channel: product_releases event: fail mentions: '@engteam' template: basic_fail_1 promote_production: description: Promote master to production parameters: image_registry: description: The container image repository type: string modifiedComponentNames: description: Space-delimited string of modified service names type: string steps: - run: command: | #!/bin/bash set -x # Static ORG="gh/voiceflow" BRANCH="master" REVISION="$CIRCLE_SHA1" PROJECT="$CIRCLE_PROJECT_REPONAME" list_pipelines() { ## # get paginated list of master pipelines for specified repo ## local PAGE_TOKEN PAGE_TOKEN="$1" PAGE_TOKEN="${PAGE_TOKEN:+&page-token=${PAGE_TOKEN}}" curl --fail --silent --request GET \ --url "https://circleci.com/api/v2/project/${ORG}/${PROJECT}/pipeline?branch=${BRANCH}${PAGE_TOKEN}" \ --header "Circle-Token: ${CIRCLECI_API_TOKEN}" } get_pipeline() { ## # find master pipeline by long commit hash ## local LENGTH local PIPELINES local PAGE_TOKEN local MAX_PAGES local COUNT LENGTH=0 COUNT=0 MAX_PAGES=10 while [[ "$LENGTH" == 0 && "$((COUNT++))" -lt "$MAX_PAGES" ]]; do PIPELINES=$(list_pipelines "${PAGE_TOKEN}") PAGE_TOKEN=$(\<<<"$PIPELINES" jq -r '.next_page_token // empty' || echo "") LENGTH=$(\<<<"$PIPELINES" jq --arg revision "${REVISION}" '.items | map(select(.vcs.revision == $revision and .state != "setup")) | length') done \<<<"$PIPELINES" jq -r --arg revision "${REVISION}" '.items | map(select(.vcs.revision == $revision and .state != "setup")) | first | .id' } get_workflow() { ## # get non-setup workflow for pipeline ## local PIPELINE_ID PIPELINE_ID="$1" curl --fail --silent --request GET \ --url "https://circleci.com/api/v2/pipeline/${PIPELINE_ID?}/workflow" \ --header "Circle-Token: ${CIRCLECI_API_TOKEN}" \ | jq -r '.items | map(select(.name != "setup")) | first' } MASTER_PIPELINE_ID=$(get_pipeline) WORKFLOW=$(get_workflow "$MASTER_PIPELINE_ID") COUNT=0 MAX_RETRY=25 INTERVAL=60 while [[ "$((COUNT++))" -lt "$MAX_RETRY" ]]; do case $(\<<<"$WORKFLOW" jq -r '.status') in "running") echo "waiting for master workflow to finish" echo "sleep ${INTERVAL}s..." sleep "$INTERVAL" WORKFLOW=$(get_workflow "$MASTER_PIPELINE_ID") ;; "success") echo "Found master workflow successfully completed" exit 0 ;; *) echo "master workflow not successful. exiting..." exit 1 ;; esac done echo "Timing out" exit 1 name: Check and wait for master build - run: command: | #!/bin/bash set -eE BUCKET="com.voiceflow.ci.assets" echo "IMAGE_REGISTRY=${IMAGE_REGISTRY}" echo "BUCKET=${BUCKET}" < <(echo "$COMPONENT_NAMES") read -r -a COMPONENT_NAMES echo "COMPONENT_NAMES: ${COMPONENT_NAMES[*]}" TMP_DIR="$(mktemp -d)" get_master_tracks() { local DIR local TRACK_PATH DIR="${1?}" shift 1 echo "Fetching tracks to ${DIR}..." for COMPONENT in "$@"; do TRACK_PATH="tracks/${COMPONENT}/master" echo " $COMPONENT..." mkdir -p "$(dirname "${DIR}/${TRACK_PATH}")" aws s3 cp --no-progress "s3://${BUCKET}/${TRACK_PATH}" "${DIR}/${TRACK_PATH}" done } parse_tag() { local DIR local COMPONENT local TRACK_PATH_ABSOLUTE DIR="${1?}" COMPONENT="${2?}" TRACK_PATH_ABSOLUTE="${DIR}/tracks/${COMPONENT}/master" if [[ "${COMPONENT}" == "database-cli" ]]; then # The full contents of database-cli track is the image tag cat "${TRACK_PATH_ABSOLUTE}" else yq -r ".[\"$COMPONENT\"].image.tag" "${TRACK_PATH_ABSOLUTE}" fi } add_production_tags() { local SERVICE local IMAGE_TAG local IMAGE_NAME SERVICE="${1?}" IMAGE_TAG="${2?}" IMAGE_NAME="${IMAGE_REGISTRY}/${SERVICE}:${IMAGE_TAG}" crane tag "${IMAGE_NAME}" "latest-production" if [[ "$SERVICE" = "database-cli" ]]; then crane tag "${IMAGE_NAME}" "latest" fi } copy_track() { local DIR local COMPONENT local MASTER_TRACK local PRODUCTION_TRACK DIR="${1?}" COMPONENT="${2?}" ### update the track MASTER_TRACK="${DIR}/tracks/${COMPONENT}/master" PRODUCTION_TRACK="tracks/${COMPONENT}/production" echo "Copying ${COMPONENT} master track from ${DIR} to production..." aws s3 cp --no-progress "${MASTER_TRACK}" "s3://${BUCKET}/${PRODUCTION_TRACK}" } get_master_tracks "${TMP_DIR}" "${COMPONENT_NAMES[@]}" echo "Adding production tag and updating tracks for..." for INDEX in "${!COMPONENT_NAMES[@]}"; do NAME="${COMPONENT_NAMES[$INDEX]}" TAG="$(parse_tag "$TMP_DIR" "${NAME}")" add_production_tags "${NAME}" "${TAG}" copy_track "${TMP_DIR}" "${NAME}" done environment: COMPONENT_NAMES: << parameters.modifiedComponentNames >> IMAGE_REGISTRY: << parameters.image_registry>> name: Tag Images remove_ip_to_security_group: parameters: execute_when: default: on_success description: When execute this command type: string sg_id: description: Id of the security group type: string steps: - run: command: | # Get the public IP of the current CircleCI runner PUBLIC_IP=$(curl ipinfo.io/ip) # Remove ingress rule from the security group that grants access to current machine aws ec2 revoke-security-group-ingress --group-id $SG_ID --protocol tcp --port 22 --cidr $PUBLIC_IP/24 environment: SG_ID: << parameters.sg_id >> name: Remove IP from Security Group when: << parameters.execute_when >> run_command_with_retry: description: Run command with retry parameters: background: default: false description: Run it in background type: boolean command: description: Command to run type: string retry-count: default: 3 description: Number of retries type: integer sleep: default: 5 description: Wait duration until next retry type: integer step_name: default: Executing Command with retry policy description: Name of the Step type: string working_directory: default: ./ description: Directory to work on type: string steps: - run: background: << parameters.background >> command: |- #!/bin/bash for _ in $(seq 0 "${MAX_RETRY:?}"); do if bash -c "${COMMAND?}"; then exit 0 fi sleep "${SLEEP:?}" echo "Retrying command: ${COMMAND?}" done echo "failed: ${COMMAND?}" >&2 exit 1 environment: COMMAND: << parameters.command >> MAX_RETRY: << parameters.retry-count >> SLEEP: << parameters.sleep >> name: << parameters.step_name >> working_directory: << parameters.working_directory >> serverless_deploy: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string environment: default: dev description: environment where to deploy the serverless application type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Deploy application description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn serverless:deploy-<< parameters.environment >> << parameters.extra_args >> set-beta-version: parameters: target_env_var: default: BETA_VERSION description: Environment variable to set with the beta version for this commit type: env_var_name working_directory: default: . description: Directory of git repo type: string steps: - run: command: | #!/bin/bash # Sets BETA_VERSION to contain the beta version for this commit echo "Getting short SHA1 of git commit" SHA="$(git rev-parse --short HEAD)" VERSION="0.0.0" # Use constant version for beta releases # Export to subsequent steps echo "export BETA_VERSION=\"${VERSION}-${SHA}\"" >> "$BASH_ENV" name: Set << parameters.target_env_var >> variable working_directory: << parameters.working_directory >> set-env-name: parameters: target_env_var: default: ENV_NAME description: Environment variable to set with the environment name for this commit type: env_var_name working_directory: default: . description: Directory of git repo type: string steps: - run: command: | SHA="$(git rev-parse --short HEAD)" echo "export << parameters.target_env_var >>=\"e2e-${SHA:?}\"" >> "$BASH_ENV" name: Set << parameters.target_env_var >> variable with e2e env name working_directory: << parameters.working_directory >> set-if-file-changed: description: | Set the given env var to true if a changed file matches one of the given patterns. The `CHANGED_FILES_FILE` environment variable (a path to the changed-files list, set by the `get_changed_files` command) must be set prior to running this command. parameters: file-patterns: description: | Space-separated list of file patterns to match against the changed files. If a changed file matches one of these patterns, the given env var will be set to true. type: string target-env-var: description: Environment variable to set with the environment name for this commit type: env_var_name steps: - run: command: | # Disable globbing so that the * in the file patterns are not expanded set -o noglob << parameters.target-env-var >>=false for FILE_PATTERN in ${FILE_PATTERNS?}; do if egrep "^.\s+$FILE_PATTERN\$" "${CHANGED_FILES_FILE:?}"; then << parameters.target-env-var >>=true echo "Found $FILE_PATTERN in changed files, setting << parameters.target-env-var >> to true" break fi done echo "export << parameters.target-env-var >>=${<< parameters.target-env-var >>}" >> $BASH_ENV environment: FILE_PATTERNS: << parameters.file-patterns >> name: 'Set << parameters.target-env-var >> to true if one of the following files changed: << parameters.file-patterns >>' set-json-array: parameters: field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string value: description: | The value to set the field to, passed as a string-separated list. If an item in the list contains a space, it must be enclosed in double quotes. type: string steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi jq '.<< parameters.field >> = $ARGS.positional' << parameters.json-file >> --args -- << parameters.value >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to << parameters.value >> in << parameters.json-file >> set-json-array-from-env: parameters: field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string value-env-var: description: Environment variable containing the value to set the field to type: env_var_name steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi jq '.<< parameters.field >> = $ARGS.positional' << parameters.json-file >> --args -- ${<< parameters.value-env-var >>} > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to << parameters.value-env-var >> in << parameters.json-file >> set-json-boolean: parameters: field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string value: description: The value to set the field to type: boolean steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi jq --argjson value "<< parameters.value >>" '.<< parameters.field >> = $value' << parameters.json-file >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to << parameters.value >> in << parameters.json-file >> set-json-boolean-from-env: parameters: field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string value-env-var: description: Environment variable containing the value to set the field to type: env_var_name steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi jq --argjson value "${<< parameters.value-env-var >>}" '.<< parameters.field >> = $value' << parameters.json-file >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to << parameters.value-env-var >> in << parameters.json-file >> set-json-command: parameters: command: description: The command to set the field to type: string field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi # can be extended with /bin/sh - \<<EOF and such for multiline OUTPUT=$(<< parameters.command >>) jq --arg value "${OUTPUT-}" '.<< parameters.field >> = $value' << parameters.json-file >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to "<< parameters.command >>" in << parameters.json-file >> set-json-number: parameters: field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string value: description: The value to set the field to type: integer steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi jq --argjson value "<< parameters.value >>" '.<< parameters.field >> = $value' << parameters.json-file >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to << parameters.value >> in << parameters.json-file >> set-json-number-from-env: parameters: field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string value-env-var: description: Environment variable containing the value to set the field to type: env_var_name steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi jq --argjson value "${<< parameters.value-env-var >>}" '.<< parameters.field >> = $value' << parameters.json-file >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to << parameters.value-env-var >> in << parameters.json-file >> set-json-string: parameters: field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string value: description: The value to set the field to type: string steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi jq --arg value "<< parameters.value >>" '.<< parameters.field >> = $value' << parameters.json-file >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to << parameters.value >> in << parameters.json-file >> set-json-string-from-env: parameters: field: description: The field of the json file to set type: string json-file: default: values.json description: The json file to set the field in type: string value-env-var: description: Environment variable containing the value to set the field to type: env_var_name steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi jq --arg value "${<< parameters.value-env-var >>}" '.<< parameters.field >> = $value' << parameters.json-file >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> name: Set << parameters.field >> to << parameters.value-env-var >> in << parameters.json-file >> set-pr-branch: parameters: pr_number_env_var: default: PR_NUMBER description: Environment variable to get the PR number from type: env_var_name target_env_var: default: PR_BRANCH description: Environment variable to set with the branch name for the PR type: env_var_name working_directory: default: . description: Directory of git repo type: string steps: - run: command: | if [ -z "${<< parameters.pr_number_env_var >>}" ]; then echo "No PR number found, skipping" exit 0 fi API_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${<< parameters.pr_number_env_var >>:?}" RESPONSE=$(curl -s -H "Authorization: token ${GITHUB_TOKEN:?}" "${API_URL}") PR_BRANCH=$(echo "${RESPONSE:?}" | jq -r '.head.ref') echo "export << parameters.target_env_var >>=\"${PR_BRANCH}\"" >> "$BASH_ENV" name: Set << parameters.target_env_var >> variable with the PR branch working_directory: << parameters.working_directory >> set-pr-number: parameters: target_env_var: default: PR_NUMBER description: Environment variable to set with the environment name for this commit type: env_var_name working_directory: default: . description: Directory of git repo type: string steps: - run: command: | # If multiple PRs are merged at the same time, CIRCLE_PULL_REQUEST will # be a random one of them. We need to get the PR number from the URL. PR="${CIRCLE_PULL_REQUEST##*/}" # If this is a bors branch, CIRCLE_PULL_REQUEST will be empty. We need # to get the PR number from the commit message (e.g. "fix: bug (CT-000) (#1234)") PR="${PR:-$(git log --format=oneline -n 1 $CIRCLE_SHA1 | grep --only-matching --extended-regexp '#[0-9]+' || echo '')}" # Trim leading # from PR number PR="${PR##\#}" echo "export << parameters.target_env_var >>=\"${PR}\"" >> "$BASH_ENV" name: Set << parameters.target_env_var >> variable with the PR number working_directory: << parameters.working_directory >> set-service-data-json: description: | Set the service metadata array in a json file. The `CHANGED_FILES_FILE` environment variable (a path to the changed-files list, set by the `get_changed_files` command) must be set prior to running this command. parameters: field: default: services description: The field of the json file to set the service metadata array type: string json-file: default: values.json description: The json file to set the field in type: string service-directories: description: | List of directories containing services. Each subdirectory of these directories containing a package.json file will be considered a service. type: string steps: - run: command: | if [ ! -f << parameters.json-file >> ]; then echo "Creating file << parameters.json-file >>" echo "{}" > << parameters.json-file >> fi for DIRECTORY in ${SERVICE_DIRECTORIES}; do for SERVICE in $(ls $DIRECTORY); do if [ ! -f $DIRECTORY/$SERVICE/package.json ]; then echo "Skipping $SERVICE because it does not have a package.json file" continue fi echo "Checking if $SERVICE was modified..." MODIFIED=false if grep "$DIRECTORY/$SERVICE" "${CHANGED_FILES_FILE:?}"; then MODIFIED=true fi COMPONENT_NAME=$(jq --raw-output ".serviceName" $DIRECTORY/$SERVICE/package.json) DOCKERFILE=$(jq --raw-output ".dockerfile" $DIRECTORY/$SERVICE/package.json) ENABLED=$(jq --raw-output ".cienabled" $DIRECTORY/$SERVICE/package.json) if [[ $ENABLED != "false" ]]; then echo "Adding $SERVICE to << parameters.json-file >> with modified=$MODIFIED" jq --argjson modified "$MODIFIED" --arg dockerfile "$DOCKERFILE" --arg name "$SERVICE" --arg component_name "$COMPONENT_NAME" --arg directory "$DIRECTORY" '.<< parameters.field >> += [{name: $name, modified: $modified, component_name: $component_name, directory: $directory, dockerfile: $dockerfile}]' << parameters.json-file >> > << parameters.json-file >>.tmp mv << parameters.json-file >>.tmp << parameters.json-file >> else echo "$SERVICE disabled using the property cienabled in the package.json file" fi done done environment: SERVICE_DIRECTORIES: << parameters.service-directories >> name: Write service metadata to << parameters.json-file >> set_etc_hosts_e2e: parameters: run_in_background: default: false description: run the command in background type: boolean step_name: default: Set etc hosts description: Name of the step type: string steps: - run: background: << parameters.run_in_background >> command: | # Modify the hosts of the executor set +e # with sudo - machine executor echo '127.0.0.1 creator-app.test.e2e postgres.test.e2e redis.test.e2e localstack.test.e2e mongodb.test.e2e server-data-api.test.e2e creator-api.test.e2e admin-api.test.e2e auth-api.test.e2e analytics-api.test.e2e billing-api.test.e2e identity-api.test.e2e luis-authoring-service.test.e2e integrations.test.e2e custom-api.test.e2e canvas-export.test.e2e alexa-runtime.test.e2e alexa-service.test.e2e general-runtime.test.e2e general-service.test.e2e google-runtime.test.e2e google-service.test.e2e realtime.test.e2e ingest.test.e2e event-ingestion-service.test.e2e billing-api.test.e2e identity-api.test.e2e auth-api.test.e2e runtime-api.test.e2e analytics-api.test.e2e admin-api.test.e2e test-api.test.e2e' | sudo tee -a /etc/hosts > /dev/null # without sudo - docker executor echo '127.0.0.1 creator-app.test.e2e postgres.test.e2e redis.test.e2e localstack.test.e2e mongodb.test.e2e server-data-api.test.e2e creator-api.test.e2e admin-api.test.e2e auth-api.test.e2e analytics-api.test.e2e billing-api.test.e2e identity-api.test.e2e luis-authoring-service.test.e2e integrations.test.e2e custom-api.test.e2e canvas-export.test.e2e alexa-runtime.test.e2e alexa-service.test.e2e general-runtime.test.e2e general-service.test.e2e google-runtime.test.e2e google-service.test.e2e realtime.test.e2e ingest.test.e2e event-ingestion-service.test.e2e billing-api.test.e2e identity-api.test.e2e auth-api.test.e2e runtime-api.test.e2e analytics-api.test.e2e admin-api.test.e2e test-api.test.e2e' | tee -a /etc/hosts > /dev/null set -e name: << parameters.step_name >> set_yarn_bash_default_shell: steps: - run: command: yarn config set script-shell /bin/bash name: Set Bash as a default shell for yarn commands setup_dynamodb: steps: - run: command: ./scripts/mock_aws_credentials.sh name: AWS Config - run: command: dockerize -wait tcp://localhost:8000 -timeout 1m name: Wait for Dynamo Docker Image setup_local_registry: description: Setup a local NPM registry parameters: container_image: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: container image to run verdaccio type: string verdaccio_config: description: location of verdaccio configuration file type: string steps: - run: background: true command: | docker create -v /verdaccio/conf --name verdaccio-conf alpine:3.4 /bin/true docker cp << parameters.verdaccio_config >> verdaccio-conf:/verdaccio/conf docker run -it --name verdaccio --network host -e NPM_TOKEN=${NPM_TOKEN} --volumes-from verdaccio-conf verdaccio/verdaccio:5 name: Setup local proxy registry - run_command_with_retry: command: docker pull << parameters.container_image >> step_name: Download Docker image setup_mongodb: steps: - run: command: dockerize -wait tcp://localhost:27017 -timeout 1m name: Wait for MongoDB Docker Image setup_pg: steps: - run: command: | sudo apt update sudo apt install -y postgresql-client name: Install psql for seeding db - run: command: dockerize -wait tcp://localhost:5432 -timeout 1m name: Wait for Postgres & Dynamo Docker Images skip_while_draft: steps: - gh/setup - run: command: | #!/bin/bash REPO=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME PR_NUMBER=${CIRCLE_PULL_REQUEST##*/} if [ -z "$PR_NUMBER" ]; then if [[ "$CIRCLE_BRANCH" == "master" || $CIRCLE_BRANCH == "production" ]]; then echo "Always run e2e tests on changes to master" else echo "No PR associated with branch; skipping rest of job" circleci-agent step halt fi else echo "Checking whether PR $PR_NUMBER is draft" IS_DRAFT=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json isDraft --jq '.isDraft') if $IS_DRAFT; then echo "PR $PR_NUMBER is a draft; skipping rest of job" circleci-agent step halt else echo "PR $PR_NUMBER is not a draft; continuing job" fi fi name: Skip current job if pull request is draft smoke_tests: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Smoke tests description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn test:smoke << parameters.extra_args >> staged_buildx: parameters: builder: default: "" description: | Buildx builder name Consider this the key for CircleCI DLC type: string dockerfile: default: Dockerfile description: Location of Dockerfile type: string enable_cache_to: default: false description: use --cache-to flag to push cache artifact to remote registry type: boolean extra_build_args: default: "" description: build args type: string image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string no_cache_filter: default: "" description: Do not use cache for these stages type: string output: default: "" description: Buildx build --output flag type: string package: default: "" description: should probably be workspace type: string platforms: default: linux/amd64 description: Platform to build against type: string post_steps: default: [] description: post steps type: steps pre_steps: default: [] description: pre steps type: steps run_in_background: default: false description: Run in background type: boolean target: description: Dockerfile stage to build type: string steps: - steps: << parameters.pre_steps >> - run: background: << parameters.run_in_background >> command: | #!/bin/bash # Expected env vars echo "TARGET: ${TARGET:=runner}" echo "IMAGE_REPO: ${IMAGE_REPO?}" echo "IMAGE_TAG: ${IMAGE_TAG:=${TARGET}}" echo "PLATFORMS: ${PLATFORMS:=linux/amd64}" echo "DOCKERFILE: ${DOCKERFILE:=Dockerfile}" echo "NO_CACHE_FILTER: ${NO_CACHE_FILTER:=runner}" echo "ENABLE_CACHE_TO: ${ENABLE_CACHE_TO:=0}" echo "EXTRA_BUILD_ARGS: ${EXTRA_BUILD_ARGS[*]}" # force string to array read -r -a EXTRA_BUILD_ARGS \<<< "$EXTRA_BUILD_ARGS" if [ -z "${OUTPUT-}" ] ; then OUTPUT_ARG=(--load) else OUTPUT_ARG=(--output "${OUTPUT}") fi echo "OUTPUT: ${OUTPUT_ARG[*]}" if [[ -z "$CIRCLE_BRANCH" && -n "$CIRCLE_TAG" ]]; then BRANCH_NAME="master" else BRANCH_NAME="${CIRCLE_BRANCH//[^[:alnum:]]/-}" # Change all non alphanumeric characters to - fi # NOTE: think of this as the CircleCI DLC key echo "BUILDER: ${BUILDER:=buildy-${BRANCH_NAME-}}" CACHE_FROM_ARG=(--cache-from "${IMAGE_REPO-}:cache-master") if [ "${BRANCH_NAME}" != "master" ] ; then CACHE_FROM_ARG+=(--cache-from "${IMAGE_REPO-}:cache-${BRANCH_NAME-}") fi IMAGE_CACHE_TAG_BASE="${IMAGE_REPO-}:cache-${BRANCH_NAME-}" if [[ "${ENABLE_CACHE_TO-}" -eq 1 ]] ; then CACHE_TO_ARG=(--cache-to "mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${IMAGE_CACHE_TAG_BASE}") fi for arg in "${EXTRA_BUILD_ARGS[@]}" ; do BUILD_ARGS+=(--build-arg "${arg}") done echo "BUILD_ARGS: ${BUILD_ARGS[*]}" # This is specific echo "NPM_TOKEN: ${NPM_TOKEN#"//registry.npmjs.org/:_authToken="}" # TODO: make file secret ~/.yarnrc.yml,target=$HOME/.yarnrc.yml # TODO: extensible secrets and build args docker buildx inspect "${BUILDER}" >/dev/null 2>&1 || docker buildx create --platform="${PLATFORMS}" --name "${BUILDER}" docker buildx use "${BUILDER-}" docker buildx inspect --bootstrap docker buildx build . \ -f "${DOCKERFILE}" \ -t "${IMAGE_REPO}:${IMAGE_TAG}" \ "${PACKAGE_ARG[@]}" \ "${BUILD_ARGS[@]}" \ "${CACHE_FROM_ARG[@]}" \ "${CACHE_TO_ARG[@]}" \ --secret id=NPM_TOKEN \ --target "${TARGET}" \ --platform "${PLATFORMS}" \ "${OUTPUT_ARG[@]}" environment: BUILDER: << parameters.builder >> DOCKERFILE: << parameters.dockerfile >> ENABLE_CACHE_TO: << parameters.enable_cache_to >> EXTRA_BUILD_ARGS: << parameters.extra_build_args >> IMAGE_REPO: << parameters.image_repo >> IMAGE_TAG: << parameters.image_tag >> NO_CACHE_FILTER: << parameters.no_cache_filter >> OUTPUT: << parameters.output >> PACKAGE: << parameters.package >> PLATFORMS: << parameters.platforms >> TARGET: << parameters.target >> name: Building '<< parameters.target >>' stage of file '<< parameters.dockerfile >>' with tag '<< parameters.image_tag >>' - steps: << parameters.post_steps >> start_e2e: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Start in e2e mode description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn e2e start_ec2_instance: parameters: execute_when: default: on_success description: When execute this command type: string instance_id: description: Id of the EC2 instance type: string steps: - run: command: | aws ec2 start-instances --instance-ids $EC2_INSTANCE_ID aws ec2 wait instance-status-ok --instance-ids $EC2_INSTANCE_ID environment: EC2_INSTANCE_ID: << parameters.instance_id >> name: Start EC2 instance no_output_timeout: 30m when: << parameters.execute_when >> stop_ec2_instance: parameters: execute_when: default: on_success description: When execute this command type: string instance_id: description: Id of the EC2 instance type: string steps: - run: command: aws ec2 stop-instances --instance-ids $EC2_INSTANCE_ID environment: EC2_INSTANCE_ID: << parameters.instance_id >> name: Stop EC2 instance no_output_timeout: 30m when: << parameters.execute_when >> stress_tests: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Stress Tests description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn test:stress << parameters.extra_args >> sync_branches: parameters: check_commit_message: default: "" description: The SSH key with write permissions to the repository type: string checkout: default: false description: Checkout code type: boolean destination_branch_name: default: production description: Name of the production branch type: string source_branch_name: default: master description: Name of the source branch type: string ssh_key: description: The SSH key with write permissions to the repository type: string step_name: default: Sync 2 branches description: Name of the step type: string steps: - when: condition: << parameters.checkout >> steps: - checkout_clone: clone_type: treeless - add_ssh_keys: fingerprints: - << parameters.ssh_key >> - check_commit_message: commit_message: << parameters.check_commit_message >> - run: command: | git checkout << parameters.source_branch_name >> git checkout << parameters.destination_branch_name >> git rebase << parameters.source_branch_name >> git push origin << parameters.destination_branch_name >> name: << parameters.step_name >> tests: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Run all tests description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn test << parameters.extra_args >> trigger_tags_pipelines: description: Triggers the CircleCI pipeline for every tag in the provided list parameters: published_tags: description: Environment variable in which to store the list of tags to trigger type: env_var_name steps: - run: command: | for TAG in ${<< parameters.published_tags >>} do URI="https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline" curl -u ${CIRCLECI_API_TOKEN}: -X POST --header 'Content-Type: application/json' -d "{\"tag\":\"$TAG\", \"parameters\": {}}" "$URI" done name: Trigger Pipelines for each updated tag unit_tests: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string extra_args: default: "" description: Additional yarn command options type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean step_name: default: Unit Tests description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string steps: - yarn_command: container_folder_to_copy: << parameters.container_folder_to_copy >> request_remote_docker: << parameters.request_remote_docker >> run_in_background: << parameters.run_in_background >> run_in_container: << parameters.run_in_container >> step_name: << parameters.step_name >> wait: << parameters.wait >> working_directory: << parameters.working_directory >> yarn_command: yarn test:unit << parameters.extra_args >> update_database_track: description: Update Database Track parameters: bucket: default: com.voiceflow.ci.assets description: The container image repository type: string build_context: default: . description: Path to the context for the docker build type: string builder_name: default: "" description: named builder for use with DLC type: string check_track_exists: default: true description: checks if the track exists type: boolean checkout: default: true description: Determines if a checkout will be executed or not type: boolean component: description: The component type for development environment deployment type: string dockerfile: default: Dockerfile description: Name of the Dockerfile to build type: string enable_cache_to: default: false description: use --cache-to flag to push cache artifact to remote registry type: boolean enable_dlc: default: false description: enable docker layer cache type: boolean enable_load: default: false description: Load image into local docker type: boolean enable_push: default: true description: push the image to the registry type: boolean force_execute: default: false description: force to update the build, if there is a change or not. type: boolean image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string inject_aws_credentials: default: false description: Inject AWS credentials into the build type: boolean kms_key: default: awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf description: KMS Key to sign the containers type: string local_registry: default: false description: Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file) type: boolean local_registry_container_image: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: container image to run verdaccio type: string node_version: description: Node version type: string package: default: "" description: Monorepo package. type: string package_folder: default: packages description: Package folder to check type: string platform: default: linux/amd64 description: Platform to build the image type: string remote_docker_version: default: default description: Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge type: string request_remote_docker: default: true description: Add the option to request a new remote docker, set to false when you concat docker jobs type: boolean semantic_version: default: "" type: string steps: - update_track: bucket: << parameters.bucket >> build_context: << parameters.build_context >> builder_name: << parameters.builder_name >> check_track_exists: << parameters.check_track_exists >> checkout: << parameters.checkout >> component: << parameters.component >> dockerfile: << parameters.dockerfile >> enable_cache_to: << parameters.enable_cache_to >> enable_dlc: << parameters.enable_dlc >> enable_load: << parameters.enable_load >> enable_push: << parameters.enable_push >> extra_build_args: NODE_VERSION=<< parameters.node_version >> force_execute: << parameters.force_execute >> image_repo: << parameters.image_repo >> image_tag: << parameters.image_tag >> inject_aws_credentials: << parameters.inject_aws_credentials >> kms_key: << parameters.kms_key >> local_registry: << parameters.local_registry >> local_registry_container_image: << parameters.local_registry_container_image >> package: << parameters.package >> package_folder: << parameters.package_folder >> remote_docker_version: << parameters.remote_docker_version >> request_remote_docker: << parameters.request_remote_docker >> sem_ver_override: << parameters.semantic_version >> update_track_file: false update_track: description: Update Component Track parameters: bucket: default: com.voiceflow.ci.assets description: The container image repository type: string build_context: default: . description: Path to the context for the docker build type: string builder_name: default: "" description: named builder for use with DLC type: string check_track_exists: default: true description: checks if the track exists type: boolean checkout: default: true description: Determines if a checkout will be executed or not type: boolean component: description: The component type for development environment deployment type: string disable_provenance: default: false description: disable provenance for image. necessary for lambda images type: boolean dockerfile: default: Dockerfile description: Name of the Dockerfile to build type: string enable_cache_to: default: false description: use --cache-to flag to push cache artifact to remote registry type: boolean enable_dlc: default: false description: enable docker layer cache type: boolean enable_load: default: false description: Load image into local docker type: boolean enable_push: default: true description: push the image to the registry type: boolean extra_build_args: default: "" description: Arguments to pass while building the docker image type: string force_execute: default: false description: force to update the build, if there is a change or not. type: boolean image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string inject_aws_credentials: default: false description: Inject AWS credentials into the build type: boolean kms_key: default: awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf description: KMS Key to sign the containers type: string local_registry: default: false description: Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file) type: boolean local_registry_container_image: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: container image to run verdaccio type: string package: default: "" description: Monorepo package. type: string package_folder: default: packages description: Package folder to check type: string platform: default: linux/amd64 description: Platform to build the image type: string remote_docker_version: default: default description: Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge type: string request_remote_docker: default: true description: Add the option to request a new remote docker, set to false when you concat docker jobs type: boolean sem_ver_override: default: "" description: Semantic release version of the package type: string update_track_file: default: true description: Determines if the track file will be updated or not type: boolean steps: - when: condition: << parameters.checkout >> steps: - checkout_clone: clone_type: treeless - run: command: git pull || echo "Nothing to pull" name: Get latest tags - when: condition: << parameters.request_remote_docker >> steps: - setup_remote_docker: docker_layer_caching: << parameters.enable_dlc >> version: << parameters.remote_docker_version >> - docker_login - attach_workspace: at: ~/voiceflow - check_image_exists: image_repo: << parameters.image_repo >> request_remote_docker: false - when: condition: << parameters.check_track_exists >> steps: - check_track_exists: bucket: << parameters.bucket >> component: << parameters.component >> - when: condition: << parameters.local_registry >> steps: - setup_local_registry: container_image: << parameters.local_registry_container_image >> verdaccio_config: config/verdaccio/config.yaml - monorepo_publish_to_local_registry - run: command: | #!/bin/bash # shellcheck disable=SC2086 # Expected env vars echo "IMAGE_REPO: ${IMAGE_REPO?}" echo "IMAGE_TAG_OVERRIDE: ${IMAGE_TAG_OVERRIDE?}" echo "SEM_VER_OVERRIDE: ${SEM_VER_OVERRIDE?}" echo "KMS_KEY: ${KMS_KEY?}" echo "PACKAGE: ${PACKAGE?}" echo "BUILD_CONTEXT: ${BUILD_CONTEXT?}" echo "COMPONENT: ${COMPONENT?}" echo "BUCKET: ${BUCKET?}" echo "LOCAL_REGISTRY: ${LOCAL_REGISTRY?}" echo "DOCKERFILE: ${DOCKERFILE?}" echo "INJECT_AWS_CREDENTIALS: ${INJECT_AWS_CREDENTIALS?}" echo "BUILDER_NAME: ${BUILDER_NAME-}" echo "EXTRA_BUILD_ARGS: ${EXTRA_BUILD_ARGS[*]}" echo "ENABLE_CACHE_TO: ${ENABLE_CACHE_TO:=0}" echo "ENABLE_LOAD: ${ENABLE_LOAD:=0}" echo "ENABLE_PUSH: ${ENABLE_PUSH:=0}" echo "UPDATE_TRACK_FILE: ${UPDATE_TRACK_FILE:=0}" echo "DISABLE_PROVENANCE: ${DISABLE_PROVENANCE:=0}" # force string to array read -r -a EXTRA_BUILD_ARGS \<<<"$EXTRA_BUILD_ARGS" # Load IMAGE_EXISTS variable from file previously stored in the tmp folder # shellcheck disable=SC1091 source "/tmp/IMAGE_STATUS" # shellcheck disable=SC1091 source "/tmp/TRACK_STATUS" if [[ "$TRACK_EXISTS" != "true" ]]; then echo "Track does not exist! avoiding update!" exit 0 fi if [[ -z "$CIRCLE_BRANCH" && -n "$CIRCLE_TAG" ]]; then BRANCH_NAME="master" else BRANCH_NAME="${CIRCLE_BRANCH//[^[:alnum:]]/-}" # Change all non alphanumeric characters to - fi IMAGE_TAG="${IMAGE_TAG_OVERRIDE:-"k8s-$CIRCLE_SHA1"}" IMAGE_NAME="$IMAGE_REPO:$IMAGE_TAG" set_platform_from_host() { # Determine architecture based on resource class local ARCH ARCH="$(uname -m)" case "$ARCH" in aarch64 | arm64) ARCH="arm64" ;; *) ARCH="amd64" ;; esac PLATFORM="linux/${ARCH}" } get_sem_ver() { local SEM_VER # Get the tag that is running right now if [[ "$CIRCLE_BRANCH" == "master" || "$CIRCLE_BRANCH" == "production" ]]; then # Update the tags git fetch --tags --quiet if [[ -n "$PACKAGE" ]]; then SEM_VER=$(git describe --abbrev=0 --tags --match "@voiceflow/$PACKAGE@*") SEM_VER="${SEM_VER##*@}" else SEM_VER=$(git describe --abbrev=0 --tags) fi # Only used by database-cli elif [[ "$SEM_VER_OVERRIDE" != "" ]]; then SEM_VER="${SEM_VER_OVERRIDE}" else SEM_VER="${CIRCLE_BRANCH}-${CIRCLE_SHA1}" fi echo "${SEM_VER}" } SEM_VER=$(get_sem_ver) # In a monorepo we need to copy the yarn lock file from root if [[ ! -f "$BUILD_CONTEXT/yarn.lock" && -f "yarn.lock" ]]; then echo "Copying yarn.lock file from root" cp yarn.lock "$BUILD_CONTEXT/yarn.lock" fi echo -e "Building with SEM_VER=$SEM_VER" if [[ $IMAGE_EXISTS == "false" || "$CIRCLE_BRANCH" == "master" || "$CIRCLE_BRANCH" == "production" ]]; then # Build Docker Image echo "Image not found, building..." if ((LOCAL_REGISTRY)); then REGISTRY_ARG=(--network host --build-arg build_REGISTRY_URL=http://localhost:4873) else REGISTRY_ARG=(--build-arg NPM_TOKEN=//registry.npmjs.org/:_authToken="${NPM_TOKEN}") fi if [[ -n "$PACKAGE" ]]; then PACKAGE_ARG=(--build-arg APP_NAME="$PACKAGE") fi if ((INJECT_AWS_CREDENTIALS)); then AWS_CREDENTIALS_ARG=(--build-arg AWS_REGION="${AWS_REGION}" --build-arg AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" --build-arg AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}") fi for arg in "${EXTRA_BUILD_ARGS[@]}"; do BUILD_ARGS+=(--build-arg "${arg}") done # NOTE: think of this as the CircleCI DLC key echo "BUILDER_NAME: ${BUILDER_NAME:=buildy-${BRANCH_NAME-}}" BUILDER_ARGS=(--name "${BUILDER_NAME-}") docker buildx create --use --bootstrap \ "${BUILDER_ARGS[@]}" OUTPUT_ARGS=() if ((ENABLE_PUSH)); then OUTPUT_ARGS+=(--push) fi if ((ENABLE_LOAD)); then OUTPUT_ARGS+=(--load) fi if ((DISABLE_PROVENANCE)); then OUTPUT_ARGS+=(--provenance=false) fi NPM_TOKEN_SECRET=(--secret id=NPM_TOKEN) CACHE_FROM_ARG=(--cache-from "${IMAGE_REPO-}:cache-master") if [ "${BRANCH_NAME}" != "master" ]; then CACHE_FROM_ARG+=(--cache-from "${IMAGE_REPO-}:cache-${BRANCH_NAME-}") fi if [[ "${ENABLE_CACHE_TO-}" -eq 1 ]]; then CACHE_TO_ARG=(--cache-to "mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${IMAGE_REPO-}:cache-${BRANCH_NAME-}") fi BUILD_ARGS+=("${CACHE_FROM_ARG[@]}") BUILD_ARGS+=("${CACHE_TO_ARG[@]}") BUILD_ARGS+=(--builder "${BUILDER_NAME-}") DD_TAGS_ARG+=(--build-arg DD_GIT_REPOSITORY_URL="${CIRCLE_REPOSITORY_URL}") TAGS=(-t "$IMAGE_NAME") if [[ -z "$IMAGE_TAG_OVERRIDE" ]]; then TAGS+=(-t "$IMAGE_REPO:latest-$BRANCH_NAME") TAGS+=(-t "$IMAGE_REPO:k8s-$BRANCH_NAME-$CIRCLE_SHA1") fi LEGACY_BUILD_ARGS=( --build-arg build_BUILD_NUM="${CIRCLE_BUILD_NUM}" --build-arg build_GITHUB_TOKEN="${GITHUB_TOKEN}" --build-arg build_BUILD_URL="${CIRCLE_BUILD_URL}" --build-arg build_GIT_SHA="${CIRCLE_SHA1}" --build-arg build_SEM_VER="${SEM_VER}" ) DATADOG_LABELS=( --label "com.datadoghq.tags.version=${CIRCLE_SHA1}" --label "com.datadoghq.tags.git.commit.sha=${CIRCLE_SHA1}" --label "com.datadoghq.tags.git.repository_url=${CIRCLE_REPOSITORY_URL}" ) BUILD_SECRETS=( --secret "type=env,id=GITHUB_TOKEN" ) set_platform_from_host PLATFORM_ARG=(--platform "${PLATFORM}") echo "BUILD_ARGS: ${BUILD_ARGS[*]}" docker buildx build \ "${LEGACY_BUILD_ARGS[@]}" \ "${DD_TAGS_ARG[@]}" \ "${REGISTRY_ARG[@]}" \ "${PACKAGE_ARG[@]}" \ "${AWS_CREDENTIALS_ARG[@]}" \ "${NPM_TOKEN_SECRET[@]}" \ "${PLATFORM_ARG[@]}" \ "${BUILD_ARGS[@]}" \ "${BUILD_SECRETS[@]}" \ "${OUTPUT_ARGS[@]}" \ "${DATADOG_LABELS[@]}" \ -f "$BUILD_CONTEXT/$DOCKERFILE" \ --progress=plain \ "${TAGS[@]}" \ "$BUILD_CONTEXT" IMAGE_DIGEST=$(crane digest "$IMAGE_NAME") # Signing Docker Image cosign sign --key "$KMS_KEY" "$IMAGE_REPO@$IMAGE_DIGEST" fi IMAGE_SHA=$(crane digest "$IMAGE_NAME") # Remove the sha256: string IMAGE_SHA="${IMAGE_SHA//sha256:/}" update_track() { ### update the track BUCKET="com.voiceflow.ci.assets" echo "TRACK: $TRACK" mkdir -p "$(dirname "/tmp/$TRACK")" if [[ "$COMPONENT" = "database-cli" ]]; then echo "New version published: ${SEM_VER?}" echo "${SEM_VER}" >"/tmp/${TRACK}" else cat \<<EOF >"/tmp/${TRACK}" ${COMPONENT}: image: tag: ${IMAGE_TAG} sha: ${IMAGE_DIGEST#sha256:} EOF fi aws s3 cp "/tmp/${TRACK}" "s3://$BUCKET/$TRACK" } if ((UPDATE_TRACK_FILE)); then echo "Creating track for ${CIRCLE_BRANCH}" update_track else echo "Skipping track update" fi environment: BUCKET: << parameters.bucket >> BUILD_CONTEXT: << parameters.build_context >> BUILDER_NAME: << parameters.builder_name >> COMPONENT: << parameters.component >> DISABLE_PROVENANCE: << parameters.disable_provenance >> DOCKERFILE: << parameters.dockerfile >> ENABLE_CACHE_TO: << parameters.enable_cache_to >> ENABLE_LOAD: << parameters.enable_load >> ENABLE_PUSH: << parameters.enable_push >> EXTRA_BUILD_ARGS: << parameters.extra_build_args >> IMAGE_REPO: << parameters.image_repo >> IMAGE_TAG_OVERRIDE: << parameters.image_tag >> INJECT_AWS_CREDENTIALS: << parameters.inject_aws_credentials >> KMS_KEY: << parameters.kms_key >> LOCAL_REGISTRY: << parameters.local_registry >> PACKAGE: << parameters.package >> SEM_VER_OVERRIDE: << parameters.sem_ver_override >> UPDATE_TRACK_FILE: << parameters.update_track_file >> name: Building image and uploading track vf_python_restore_cache: parameters: cache_prefix: default: "" description: Cache prefix type: string working_directory: default: ./ description: Cache directory for poetry.lock file type: string steps: - restore_cache: keys: - python-package-cache-<< parameters.cache_prefix >>-{{ .Environment.CACHE_VERSION }}-{{ checksum "<< parameters.working_directory >>/poetry.lock" }} vf_python_save_cache: parameters: cache_prefix: default: "" description: Cache prefix type: string working_directory: default: ./ description: Directory containing package.json type: string steps: - save_cache: key: python-package-cache-<< parameters.cache_prefix >>-{{ .Environment.CACHE_VERSION }}-{{ checksum "<< parameters.working_directory >>/poetry.lock" }} paths: - << parameters.working_directory >>/.venv vf_restore_cache: parameters: cache_prefix: default: "" description: Cache prefix type: string yarn_lock_restore_cache_directory: default: ./ description: Cache directory for yarn.lock file type: string steps: - restore_cache: keys: - node-module-cache-<< parameters.cache_prefix >>-{{ .Branch }}-{{ .Environment.CACHE_VERSION }}-{{ checksum "<< parameters.yarn_lock_restore_cache_directory >>/yarn.lock" }} vf_save_cache: parameters: cache_prefix: default: "" description: Cache prefix type: string working_directory: default: ./ description: Directory containing package.json type: string steps: - save_cache: key: node-module-cache-<< parameters.cache_prefix >>-{{ .Branch }}-{{ .Environment.CACHE_VERSION }}-{{ checksum "<< parameters.working_directory >>/yarn.lock" }} paths: - << parameters.working_directory >>/.yarn/cache - << parameters.working_directory >>/.yarn/install-state.gz - << parameters.working_directory >>/node_modules - ~/.cache/Cypress vfcli-create-or-get-free-env-from-pool: description: Uses vfcli to create a new environment (vfcli must already be installed) parameters: env-name: description: Name of the environment to create type: string force: default: false description: Whether to force environment creation without checking for free environment type: boolean lease: default: 1h description: Time to lease the environment for type: string node-group: default: e2e description: Name of the node group to use type: string pool-type: description: Type of the pool to get the environment from type: string track-file: default: "" description: Path to the track-mapping file to use type: string steps: - run: mkdir -p workspace - run: command: | # fetches a free environment from the pool if pool-type is provided # otherwise creates a new environment with the provided name # and stores the env name in the cache force="<< parameters.force >>" if [[ -n "<< parameters.pool-type >>" ]]; then if [[ $force == true ]]; then echo "Force option is enabled... Proceeding with environment creation." echo "null" > env_name.txt # Write 'null' to indicate no environment was found echo "create" > skip_create_env else result=$(vfcli pool get-free-env --pool-type "<< parameters.pool-type >>" --output json) if [[ -z $result ]] || [[ $(echo "$result" | jq 'keys | length') -eq 0 ]]; then echo "No free environment found. Proceeding with environment creation." echo "null" > env_name.txt # Write 'null' to indicate no environment was found echo "create" > skip_create_env else echo "Free environment found: $result" env_name=$(echo "$result" | jq -r '.name') echo ${env_name} > env_name.txt cat env_name.txt echo "export ENV_NAME=${env_name}" >> $BASH_ENV vfcli pool use-env --env-name ${env_name} echo "skip" > skip_create_env # Indicate no need to create environment exit 0 # Skip environment creation fi fi else echo "Pool type not provided." echo "null" > env_name.txt # Handle case where pool-type is not provided echo "create" > skip_create_env fi name: Check for free environment or Create environment - save_cache: key: env_name_cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_WORKFLOW_ID }} paths: - env_name.txt - run: command: | if [[ -f skip_create_env && $(cat skip_create_env) != "skip" ]]; then if [ -n "<< parameters.track-file >>" ]; then TRACK_ARG=("--track-file" "<< parameters.track-file >>") fi vfcli env create "<< parameters.env-name >>" --interactive false --node-group "<< parameters.node-group >>" --prefix "" --lease "<< parameters.lease >>" "${TRACK_ARG[@]}" else echo "Environment creation skipped as a free environment was used." fi name: Create environment vfcli-delete-or-release-env: description: Uses vfcli to delete an environment parameters: env-name: description: Name of the environment to create type: string env-name-path: default: /home/circleci/voiceflow/env_name.txt description: Path to the env_name file type: string force: default: false description: Whether to delete the environment forcefully type: boolean reset-db: default: false description: Whether to reset the database type: boolean when: default: always description: When to run this command type: string steps: - restore_cache: key: env_name_cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_WORKFLOW_ID }} - run: command: | force="<< parameters.force >>" if [[ $force == true ]]; then vfcli env delete --name "<< parameters.env-name >>" --interactive false else if [[ -f << parameters.env-name-path >> ]]; then env_name=$(cat << parameters.env-name-path >>) echo "Env: $env_name will be released" else env_name="null" echo "Env name file was not found. Will proceed to deleting the environment." fi if [[ "$env_name" != "null" ]] && [[ -n "$env_name" ]]; then echo "Releasing the environment..... $env_name" vfcli pool release-env --env-name "$env_name" if [[ << parameters.reset-db >> == true ]]; then echo "Resetting the database for $env_name" echo "Triggering pipeline with env-name parameter" response=$(curl -s -w "\n%{http_code}" \ --request POST \ --url "https://circleci.com/api/v2/project/gh/voiceflow/env-release-system/pipeline" \ --header "Circle-Token: ${CIRCLECI_API_TOKEN}" \ --header "content-type: application/json" \ --data "{\"parameters\":{\"e2e_env_name\":\"$env_name\",\"trigger_pipeline\":true}}") http_status=$(echo "$response" | tail -n1) response_body=$(echo "$response" | sed '$d') if [[ $http_status == "201" || $http_status == "200" ]]; then if echo "$response_body" | jq empty 2>/dev/null; then pipeline_id=$(echo "$response_body" | jq -r '.id // empty') pipeline_number=$(echo "$response_body" | jq -r '.number // empty') if [[ -n $pipeline_number ]]; then pipeline_url="https://app.circleci.com/pipelines/github/voiceflow/env-release-system/$pipeline_number" echo "Env Release Pipeline triggered successfully." echo "Pipeline URL: $pipeline_url" echo "Pipeline ID: $pipeline_id" echo "Exiting with success." exit 0 else echo "Failed to retrieve pipeline number. Response body: $response_body" fi else echo "Response is not valid JSON. Response body: $response_body" fi else echo "Failed to trigger pipeline. HTTP status code: $http_status" echo "Response body: $response_body" fi fi vfcli env resume "$env_name" --interactive false vfcli track attach --branch master --components all --name "$env_name" --interactive false --no-circleci vfcli pool free-env --env-name "$env_name" else echo "Kick-starting the deletion of the environment." vfcli env delete --name "<< parameters.env-name >>" --interactive false fi fi name: Release or Delete Env when: << parameters.when >> vfcli-fetch-endpoints: description: Uses vfcli fetch the specified component URLs from an environment and stores them in env vars parameters: components: description: Space-separated list of components to fetch type: string env-name: description: Name of the environment to create type: string env-var-suffix: default: _URL description: Suffix to use for the environment variables (e.g. "CREATOR_APP_SUFFIX") type: string steps: - run: command: |- #!/bin/bash # Expected environment variables: echo "COMPONENTS: ${COMPONENTS?}" echo "ENV_NAME: ${ENV_NAME:?}" COMPONENT_DATA="$(vfcli component list --name "${ENV_NAME:?}" --full --output json --interactive false)" for COMPONENT in ${COMPONENTS?}; do echo "Fetching $COMPONENT URL" echo "${COMPONENT_DATA}" | jq --raw-output ".[] | select(.id == \"${COMPONENT}\") | .endpoint" > "${COMPONENT}.url" ENV_VAR_NAME=$(echo "${COMPONENT^^}_URL" | tr '-' '_') echo "Storing url for $COMPONENT in $ENV_VAR_NAME: $(cat "${COMPONENT}.url")" echo "export ${ENV_VAR_NAME}=\"https://$(cat "${COMPONENT}.url")\"" >> "$BASH_ENV" done environment: COMPONENTS: << parameters.components >> ENV_NAME: << parameters.env-name >> name: Fetch endpoints for << parameters.components >> vfcli-resetdb-free-env: description: Uses vfcli to reset database and free an environment back into the pool parameters: env-name: description: Name of the environment to reset database and free back into the pool type: string steps: - run: command: | env_name="<< parameters.env-name >>" echo "Releasing the environment..... $env_name" vfcli env database reset --name "$env_name" sleep 10 vfcli env resume "$env_name" --interactive false vfcli track attach --branch master --components all --name "$env_name" --interactive false --no-circleci vfcli pool free-env --env-name "$env_name" name: Reset Database and Free Environment vfcli-suspend-env: description: Uses vfcli to suspend an existing environment with a set of tracks (vfcli must already be installed) parameters: env-name: description: Name of the environment to prepare type: string env-name-path: default: /home/circleci/voiceflow/env_name.txt description: Path to the env_name file type: string track-file: description: Path to the track-mapping file to use type: string steps: - restore_cache: key: env_name_cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_WORKFLOW_ID }} - run: command: | echo "Contents of << parameters.env-name-path >>:" cat << parameters.env-name-path >> if [[ -f << parameters.env-name-path >> ]]; then echo "Using env_name from file << parameters.env-name-path >> in the suspend action" env_name=$(cat << parameters.env-name-path >>) else env_name="<< parameters.env-name >>" fi if [[ "$env_name" == "null" ]] || [[ -z "$env_name" ]]; then # If env_name from file is "null" or empty, use the default parameter env_name="<< parameters.env-name >>" fi vfcli env suspend "$env_name" --interactive false --wait --track-file "<< parameters.track-file >>" name: Suspend Environment yarn_command: parameters: container_folder_to_copy: default: "" description: Container folder to copy after the execution type: string container_image: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: Container image to run the yarn command type: string max_retries: default: 2 description: Maximum number of retries type: integer monorepo_package: default: "" description: Monorepo Package Name type: string monorepo_package_folder: default: packages description: Package folder type: string request_remote_docker: default: false description: Request remote Docker type: boolean run_in_background: default: false description: run the command in background type: boolean run_in_container: default: false description: Run build in a container type: boolean sleep_time: default: 5 description: Time (in seconds) to sleep between retries type: integer step_name: default: Deploy application description: Name of the step type: string wait: default: false description: wait until all the commands are finished type: boolean working_directory: default: ./ description: Directory containing package.json type: string yarn_command: description: Yarn command to execute type: string steps: - when: condition: << parameters.wait >> steps: - run: command: |- #!/bin/bash while [ "$(ls -A /tmp/lock)" != "" ] do if [ -f "/tmp/failure" ]; then echo "A failure was detected in previous steps." exit 1 fi echo "Process not finished. Waiting..." sleep 5 done echo "Process finished" name: Waiting until other processes are finished - when: condition: << parameters.run_in_background >> steps: - run: command: | #!/bin/bash # Create the folder if not exists [ ! -d /tmp/lock ] && mkdir -p /tmp/lock LOCK_FILE="/tmp/lock/$(uuidgen)" touch "$LOCK_FILE" echo "Lock created at $LOCK_FILE" echo "export LOCK_FILE=$LOCK_FILE" >> "$BASH_ENV" name: Create lock for << parameters.step_name >> - when: condition: << parameters.request_remote_docker >> steps: - setup_remote_docker: version: default - when: condition: << parameters.run_in_container >> steps: - docker_login - run_command_with_retry: command: docker pull << parameters.container_image >> step_name: Download Docker image - unless: condition: << parameters.run_in_container >> steps: - run: background: << parameters.run_in_background >> command: | #!/bin/bash # shellcheck disable=SC2086 trap 'echo "fail detected"; touch /tmp/failure' ERR echo "Running command: ${COMMAND:?}" for _ in $(seq 0 "${MAX_RETRIES:?}"); do if bash -c "${COMMAND?}"; then if (( ${SHOULD_REMOVE_LOCKFILE?} )); then echo "Removing lock file ${LOCK_FILE?}" rm -rf "${LOCK_FILE}" fi exit 0 fi sleep "${SLEEP_TIME:?}" echo "Retrying command: ${COMMAND?}" done echo "failed: ${COMMAND?}" >&2 touch /tmp/failure exit 1 environment: COMMAND: << parameters.yarn_command >> MAX_RETRIES: << parameters.max_retries >> SHOULD_REMOVE_LOCKFILE: << parameters.run_in_background >> SLEEP_TIME: << parameters.sleep_time >> name: Run << parameters.step_name >> working_directory: << parameters.working_directory >> - when: condition: << parameters.run_in_container >> steps: - run: background: << parameters.run_in_background >> command: "#!/bin/bash\n\ntrap 'echo \"fail detected\"; touch /tmp/failure' ERR\n\necho \"Copying code into container\"\ndocker create -v /code --name code \"${CONTAINER_IMAGE:?}\" /bin/true\ndocker cp \"$PWD/.\" code:/code\n\necho \"Executing command \\\"${COMMAND:?}\\\" in container\"\ndocker run --name runner -it --volumes-from code -w /code \"${CONTAINER_IMAGE:?}\" /bin/bash -c \"\n for _ in {0..${MAX_RETRIES:?}}; do\n if bash -c \\\"${COMMAND?}\\\"; then\n exit 0\n fi\n sleep \\\"${SLEEP_TIME:?}\\\"\n echo \\\"Retrying command: ${COMMAND?}\\\"\n done\n\n echo \\\"failed: ${COMMAND?}\\\" >&2\n exit 1\n\"\n\n# If a folder is specified we copy that one on the host, otherwise copy all\nSOURCE_FOLDER=\"runner:/code/${FOLDER_TO_COPY:-.}\"\n\nif [[ -n \"${MONOREPO_PACKAGE?}\" && \"${MONOREPO_PACKAGE}\" != \"all\" ]]; then\n DESTINATION_FOLDER=\"$PWD/${MONOREPO_PACKAGE_FOLDER:?}/${MONOREPO_PACKAGE:?}\"\nelse\n DESTINATION_FOLDER=\"$PWD\"\nfi\n\necho \"Copying from ${SOURCE_FOLDER} into ${DESTINATION_FOLDER?}\"\ndocker cp \"${SOURCE_FOLDER}\" \"${DESTINATION_FOLDER}\"\n\nif (( ${SHOULD_REMOVE_LOCKFILE?} )); then\n echo \"Removing lock file ${LOCK_FILE?}\" \n rm -rf \"${LOCK_FILE}\"\nfi" environment: COMMAND: << parameters.yarn_command >> CONTAINER_IMAGE: << parameters.container_image >> FOLDER_TO_COPY: << parameters.container_folder_to_copy >> MAX_RETRIES: << parameters.max_retries >> MONOREPO_PACKAGE: << parameters.monorepo_package >> MONOREPO_PACKAGE_FOLDER: << parameters.monorepo_package_folder >> SHOULD_REMOVE_LOCKFILE: << parameters.run_in_background >> SLEEP_TIME: << parameters.sleep_time >> name: Run << parameters.step_name >> in a container working_directory: << parameters.working_directory >> executors: build-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-image:<< parameters.tag >> parameters: default_resource_class: default: medium description: Default resource class for the executor type: string tag: default: 25.0.5-dind-vf-4 type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow code-test-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:v2 - environment: POSTGRES_HOST_AUTH_METHOD: trust image: postgres:14.3-alpine - environment: - EDGE_PORT=8000 - SERVICES=s3,dynamodb - DEFAULT_REGION=us-east-1 - DEBUG=1 image: localstack/localstack:0.12.2 - image: circleci/redis:6.2-alpine - image: circleci/mongo:4.4.1 environment: NODE_OPTIONS: --max-old-space-size=4096 parameters: default_resource_class: default: large description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow code-test-executor-node-20: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:<< parameters.tag >> - environment: POSTGRES_HOST_AUTH_METHOD: trust image: postgres:14.3-alpine - environment: - EDGE_PORT=8000 - SERVICES=s3,dynamodb - DEFAULT_REGION=us-east-1 - DEBUG=1 image: localstack/localstack:0.12.2 - image: cimg/redis:6.2 - image: mongo:4.4.1 environment: NODE_OPTIONS: --max-old-space-size=4096 parameters: default_resource_class: default: large description: Default resource class for the executor type: string tag: default: v3 type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow collector-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-collector:<< parameters.tag >> environment: NODE_OPTIONS: --max-old-space-size=<< parameters.default_node_memory >> parameters: default_node_memory: default: "4096" description: Default node memory. type: string default_resource_class: default: medium+ description: Default resource class for the executor type: string tag: default: "2024.12" type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow cypress-e2e-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/e2e-cypress:v1 parameters: default_resource_class: default: xlarge description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> default-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:20.17-vf-5 parameters: default_resource_class: default: medium description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow default-executor-node-20: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:<< parameters.tag >> parameters: default_resource_class: default: medium description: Default resource class for the executor type: string tag: default: 20.17.0-vf-5 type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow e2e-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY environment: DEFAULT_COMMIT: master DOCKER_COMPOSE_VERSION: 1.24.1 DOCKERIZE_VERSION: v0.6.1 MKCERT_VERSION: v1.4.0 NODE_OPTIONS: --max_old_space_size=8192 image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-e2e-image:v2 user: << parameters.user >> - environment: POSTGRES_HOST_AUTH_METHOD: trust image: postgres:14.3-alpine - environment: - EDGE_PORT=8000 - SERVICES=s3,dynamodb - DEFAULT_REGION=us-east-1 - DEBUG=1 image: localstack/localstack:0.13.0 - image: circleci/mongo:4.4.5 - image: redis:6.2-alpine parameters: default_resource_class: default: xlarge description: Default resource class for the executor type: string user: default: root description: Default user to run the commands type: string resource_class: << parameters.default_resource_class >> go-executor: docker: - image: cimg/go:1.23-node parameters: default_resource_class: default: large description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> gomplate-executor: docker: - image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-gomplate-image:v1 resource_class: medium+ java-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-java-image:v1 parameters: default_resource_class: default: medium+ description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow lambda-executor: docker: - image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-lambda:3.10.13-node parameters: default_resource_class: default: arm.medium description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> node-codegen-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:v2 - environment: POSTGRES_HOST_AUTH_METHOD: trust image: postgres:14.3-alpine - image: circleci/mongo:4.4.5 environment: NODE_OPTIONS: --max-old-space-size=4096 resource_class: large working_directory: ~/voiceflow node-codegen-executor-node-20: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:v3 - environment: POSTGRES_HOST_AUTH_METHOD: trust image: postgres:14.3-alpine - image: circleci/mongo:4.4.5 environment: NODE_OPTIONS: --max-old-space-size=4096 resource_class: large working_directory: ~/voiceflow node-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:v2 environment: NODE_OPTIONS: --max-old-space-size=<< parameters.default_node_memory >> parameters: default_node_memory: default: "4096" description: Default node memory type: string default_resource_class: default: medium+ description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow node-executor-node-20: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:<< parameters.tag >> environment: NODE_OPTIONS: --max-old-space-size=<< parameters.default_node_memory >> parameters: default_node_memory: default: "4096" description: Default node memory. type: string default_resource_class: default: medium+ description: Default resource class for the executor type: string tag: default: 20.17-vf-5 type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow node-large-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:v2 environment: NODE_OPTIONS: --max-old-space-size=<< parameters.default_node_memory >> parameters: default_node_memory: default: "4096" description: Default node memory type: string default_resource_class: default: large description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow node-large-executor-node-20: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-image:v3 environment: NODE_OPTIONS: --max-old-space-size=<< parameters.default_node_memory >> parameters: default_node_memory: default: "4096" description: Default node memory type: string default_resource_class: default: large description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow playwright-executor: docker: - image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/playwright:v<< parameters.playwright-version >>-noble parameters: playwright-version: type: string resource_class: xlarge python-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-image-python:v1 parameters: default_resource_class: default: medium+ description: Default resource class for the executor type: string resource_class: << parameters.default_resource_class >> working_directory: ~/voiceflow smoke-executor: docker: - aws_auth: aws_access_key_id: $AWS_ACCESS_KEY_ID aws_secret_access_key: $AWS_SECRET_ACCESS_KEY environment: DEFAULT_COMMIT: master DOCKER_COMPOSE_VERSION: 1.24.1 DOCKERIZE_VERSION: v0.6.1 MKCERT_VERSION: v1.4.0 NODE_OPTIONS: --max_old_space_size=8192 NODE_VERSION: v20.10.0 image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-e2e-image:v2 user: root resource_class: xlarge jobs: build-e2e-tests: description: Clones the e2e tests repo and builds them executor: node-large-executor parameters: cache_prefix: default: build-e2e-tests description: Cache prefix type: string e2e_git_ref: default: master description: The git ref to checkout for the e2e tests type: string e2e_repo_name: default: creator-app description: The name of the repo to clone type: string persist_to_workspace: default: true description: Persist the e2e tests to the workspace type: boolean steps: - clone_repo: github_commit: << parameters.e2e_git_ref >> github_repo_name: << parameters.e2e_repo_name >> path_to_clone: /tmp/e2e-tests - authenticate_npm: working_directory: /tmp/e2e-tests - restore_cache: keys: - node-module-cache-<< parameters.cache_prefix >>-{{ .Environment.CACHE_VERSION }}-{{ checksum "/tmp/e2e-tests/yarn.lock" }} - run: command: | echo "Installing repo with e2e tests" yarn install --immutable echo "Building dependencies" yarn build:deps name: Build E2E Test Dependencies working_directory: /tmp/e2e-tests - save_cache: key: node-module-cache-<< parameters.cache_prefix >>-{{ .Environment.CACHE_VERSION }}-{{ checksum "/tmp/e2e-tests/yarn.lock" }} paths: - /tmp/e2e-tests/.yarn/cache - when: condition: << parameters.persist_to_workspace >> steps: - persist_to_workspace: paths: - . root: /tmp/e2e-tests build_push_image: executor: build-executor parameters: build_context: default: . description: Path to the context for the docker build type: string dockerfile: default: Dockerfile description: Name of the Dockerfile to build type: string force_execute: default: false description: force to notify, if there is a change or not. type: boolean image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string inject_aws_credentials: default: false description: Inject AWS credentials into the build type: boolean kms_key: default: awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf description: KMS Key to sign the containers type: string local_registry_container_image: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: container image to run verdaccio type: string monorepo_directory: default: "" description: the root directory of monorepo, uses a local registry to pre-release package versions type: string package: default: "" description: The monorepo package that has been changed type: string package_folder: default: packages description: The monorepo package that has been changed type: string sem_ver_override: default: "" description: Semantic release version of the package type: string use_tag_versioning: default: true description: Use tag versioning to tag the image type: boolean steps: - build_push_image: build_context: << parameters.build_context >> dockerfile: << parameters.dockerfile >> force_execute: << parameters.force_execute >> image_repo: << parameters.image_repo >> image_tag: << parameters.image_tag >> inject_aws_credentials: << parameters.inject_aws_credentials >> kms_key: << parameters.kms_key >> local_registry_container_image: << parameters.local_registry_container_image >> monorepo_directory: << parameters.monorepo_directory >> package: << parameters.package >> package_folder: << parameters.package_folder >> sem_ver_override: << parameters.sem_ver_override >> use_tag_versioning: << parameters.use_tag_versioning >> cdk-deploy: executor: << parameters.executor >> parameters: executor: default: go-executor description: Executor to use type: executor steps: - checkout_clone - run: command: sudo npm install -g aws-cdk name: Install CDK - run: command: | git config --global url."https://$GITHUB_TOKEN:x-oauth-basic@github.com/".insteadOf "https://github.com/" cdk deploy --require-approval never environment: GOPRIVATE: github.com/voiceflow name: CDK Deploy cdk-go-deploy: executor: go-executor steps: - checkout_clone - run: command: sudo npm install -g aws-cdk name: Install CDK - run: command: | git config --global url."https://$GITHUB_TOKEN:x-oauth-basic@github.com/".insteadOf "https://github.com/" cdk deploy --require-approval never environment: GOPRIVATE: github.com/voiceflow name: CDK Deploy cdk-node-deploy: executor: node-executor steps: - checkout_clone - run: command: | sudo npm install -g aws-cdk name: Install CDK - run: command: | cdk deploy --require-approval never name: CDK Deploy check_env_var_exists: executor: go-executor parameters: env_var: description: Environment variable to check type: env_var_name steps: - check_env_var_exists: env_var: << parameters.env_var >> check_track_exists: executor: build-executor parameters: component: description: Component to check if the track exists type: string force_execute: default: false description: '[DEPRECATED] no effect, kept for backward compatibility' type: boolean package: default: "" description: Monorepo package. type: string package_folder: default: packages description: Monorepo package type: string steps: - check_track_exists: component: << parameters.component >> stop_if_not_exists: true collect-e2e-logs: description: Prepare an existing environment for e2e tests executor: << parameters.executor >> parameters: cluster: default: cm4-vf-dev-eu-0-p0 description: Name of the cluster in which the environment exists type: string e2e-env-name: description: Name of the environment to collect logs from type: string env-name-path: default: /home/circleci/voiceflow/env_name.txt description: Path to the env_name file type: string executor: default: collector-executor description: Executor to run the command on type: executor smoke-test-jobs: default: vfcommon/run-smoke-tests description: Comma separated list of smoke test jobs type: string steps: - install-vfcli: init-cluster: << parameters.cluster >> - restore_cache: key: env_name_cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_WORKFLOW_ID }} - run: command: | mkdir -p "${LOG_DIR:?}/${COMPONENT_LOG_DIR:?}" mkdir -p "${LOG_DIR:?}/${KUBE_STATE_DIR:?}" environment: COMPONENT_LOG_DIR: component-logs KUBE_STATE_DIR: kubernetes-state LOG_DIR: /tmp/logs-<< parameters.e2e-env-name >> name: Create directories - run: command: | echo "Contents of << parameters.env-name-path >>:" cat << parameters.env-name-path >> if [ -f << parameters.env-name-path >> ] && [ "$(cat << parameters.env-name-path >> )" != "null" ]; then DEV_ENV_NAME=$(cat << parameters.env-name-path >> ) else DEV_ENV_NAME=<< parameters.e2e-env-name >> fi # Gather summary state of all pods in the namespace echo "Gathering Kubernetes state before run for env $DEV_ENV_NAME" kubectl get pods -n $DEV_ENV_NAME >> "${LOG_DIR:?}/${KUBE_STATE_DIR:?}/pods-summary-state-before-run.log" environment: KUBE_STATE_DIR: kubernetes-state LOG_DIR: /tmp/logs-<< parameters.e2e-env-name >> name: Gather Kubernetes state before run - run: background: true command: | export TERM=xterm-256color if [ -f << parameters.env-name-path >> ] && [ "$(cat << parameters.env-name-path >> )" != "null" ]; then DEV_ENV_NAME=$(cat << parameters.env-name-path >> ) else DEV_ENV_NAME=<< parameters.e2e-env-name >> fi mkdir /tmp/asciinema && cd /tmp/asciinema asciinema rec \ --cols 250 \ --rows 50 \ --idle-time-limit 300 \ -c "k9s --headless --namespace \"${DEV_ENV_NAME}\" --command 'pods /!Completed'" \ k9s.tape & echo $! >/tmp/asciinema.pid wait name: Asciinema - Record k9s - run: background: true command: | function capture_logs() { if [ -f << parameters.env-name-path >> ] && [ "$(cat << parameters.env-name-path >>)" != "null" ]; then DEV_ENV_NAME=$(cat << parameters.env-name-path >>) else DEV_ENV_NAME=<< parameters.e2e-env-name >> fi echo "Capturing logs for environment $DEV_ENV_NAME" # Read components into an array directly from the command output components=($(vfcli component list -n "${DEV_ENV_NAME:?}" | awk 'NR>3 {print $1}')) # Iterate over the components. Process log collection in parallel as background processes for component in "${components[@]}"; do echo "Capturing logs for component $component" stern -n "${DEV_ENV_NAME:?}" -l "app.kubernetes.io/name=$component" --since 5m >>"${LOG_DIR:?}/${COMPONENT_LOG_DIR:?}/$component.log" & done wait } capture_logs environment: COMPONENT_LOG_DIR: component-logs LOG_DIR: /tmp/logs-<< parameters.e2e-env-name >> name: Gather Logs - run: command: | # Loop through to check if each of the jobs have been completed for job in $(echo "<< parameters.smoke-test-jobs >>" | tr "," "\n"); do while [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CIRCLE_TOKEN"| jq -r ".items[]|select(.name == \"$job\")|.status" | grep -c "running") -gt 0 ]] do sleep 5 done done name: Wait for smoke test jobs to complete - run: echo "All required jobs have now completed" - run: command: | if [ -f << parameters.env-name-path >> ] && [ "$(cat << parameters.env-name-path >> )" != "null" ]; then DEV_ENV_NAME=$(cat << parameters.env-name-path >> ) else DEV_ENV_NAME=<< parameters.e2e-env-name >> fi # Read components into an array directly from the command output components=($(vfcli component list -n "${DEV_ENV_NAME:?}" | awk 'NR>3 {print $1}')) # Gather summary state of all pods in the namespace kubectl get pods -n $DEV_ENV_NAME >> "${LOG_DIR:?}/${KUBE_STATE_DIR:?}/pods-summary-state-after-run.log" # Gather detailed state of all pods in the namespace. for component in "${components[@]}"; do echo "Capturing logs for component $component" kubectl describe pod $component -n $DEV_ENV_NAME >> "${LOG_DIR:?}/${KUBE_STATE_DIR:?}/${component}-k8-state.log" & done # wait for kubectls to finish wait environment: KUBE_STATE_DIR: kubernetes-state LOG_DIR: /tmp/logs-<< parameters.e2e-env-name >> name: Gather Kubernetes state after run - run: command: | if [ -f << parameters.env-name-path >> ] && [ "$(cat << parameters.env-name-path >> )" != "null" ]; then DEV_ENV_NAME=$(cat << parameters.env-name-path >> ) else DEV_ENV_NAME=<< parameters.e2e-env-name >> fi # Ensure the log directory exists mkdir -p "${LOG_DIR}/${KUBE_STATE_DIR}" vfcli env gather-events -n "${DEV_ENV_NAME}" -o /tmp environment: KUBE_STATE_DIR: kubernetes-state LOG_DIR: /tmp/logs-<< parameters.e2e-env-name >> name: Gather Kubernetes events - run: command: | cd /tmp/asciinema pkill -SIGHUP k9s # wait for asciinema to stop gracefully while pgrep -qF /tmp/asciinema.pid ; do sleep 1 done mkdir -p artifacts gzip -c9 k9s.tape >./artifacts/k9s.tape.gz # render to gif agg --renderer fontdue \ --font-dir ~/.local/share/font/Hack \ --font-family "Hack Nerd Font Mono" \ k9s.tape ./artifacts/k9s.gif name: Render asciinema - store_artifacts: destination: asciinema name: Store asciinema path: /tmp/asciinema/artifacts - store_artifacts: destination: logs name: Store uncompressed logs path: /tmp/logs-<< parameters.e2e-env-name >> - run: command: | tar -czf /tmp/logs.tar.gz ${LOG_DIR:?} environment: LOG_DIR: /tmp/logs-<< parameters.e2e-env-name >> name: Compress logs - store_artifacts: destination: compressed-logs.tar.gz name: Store compressed logs path: /tmp/logs.tar.gz - store_artifacts: destination: raw-events/k8-events.json name: Store raw events JSON path: /tmp/k8-events.json - store_artifacts: destination: structured-events/k8-events.log name: Store k8s events in structured format path: /tmp/k8-events.log create_commit_status: description: Create GH "Commit Status" docker: - image: cimg/base:current-22.04 parameters: check-name: description: Name of the job to skip type: string description: description: Text that shows in GH checks type: string status: description: Status of check enum: - error - failure - pending - success type: enum steps: - create_commit_status: check-name: << parameters.check-name >> description: << parameters.description >> status: << parameters.status >> create_manifest: executor: name: build-executor parameters: bucket: default: com.voiceflow.ci.assets description: The container image repository type: string check_track_exists: default: true description: checks if the track exists type: boolean component: description: The component type for development environment deployment type: string image_repo: description: repo type: string image_tag: default: "" description: tag type: string kms_key: default: awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf description: KMS Key to sign the containers type: string steps: - when: condition: << parameters.check_track_exists >> steps: - check_track_exists: bucket: << parameters.bucket >> component: << parameters.component >> - docker_login - run: command: | #!/bin/bash # Input params echo "IMAGE_REPO=${IMAGE_REPO?}" echo "IMAGE_TAG_OVERRIDE=${IMAGE_TAG_OVERRIDE?}" echo "COMPONENT=${COMPONENT?}" echo "KMS_KEY=${KMS_KEY?}" ## Env Vars IMAGE_TAG="${IMAGE_TAG_OVERRIDE:-"k8s-$CIRCLE_SHA1"}" IMAGE_NAME="$IMAGE_REPO:$IMAGE_TAG" echo "IMAGE_TAG=${IMAGE_TAG}" echo "IMAGE_NAME=${IMAGE_NAME}" check_track_exist() { # Load TRACK_EXISTS variable from file previously stored in the tmp folder # shellcheck disable=SC1091 source "/tmp/TRACK_STATUS" if [[ "$TRACK_EXISTS" != "true" ]]; then echo "Track does not exist! avoiding update!" exit 0 fi } ## Functions getDigestRef() { ARCH="${1}" JQ=$( cat \<<EOF .manifests | map( select(.annotations["vnd.docker.reference.type"] != "attestation-manifest") | \$image_repo + "@" + .digest )[] // "" EOF ) docker buildx imagetools inspect --raw "${IMAGE_NAME}${ARCH:+-${ARCH}}" \ | jq -e -r --arg image_repo "${IMAGE_REPO}" "$JQ" } create_and_sign() { set +e ARM64_DIGEST_REF=$(getDigestRef arm64) AMD64_DIGEST_REF=$(getDigestRef amd64) set -e DIGESTS=() if [[ -n "$ARM64_DIGEST_REF" ]]; then DIGESTS+=("${ARM64_DIGEST_REF}") fi if [[ -n "$AMD64_DIGEST_REF" ]]; then DIGESTS+=("${AMD64_DIGEST_REF}") fi if [[ -z "${#DIGESTS}" ]]; then echo "ERROR: no digests found" exit 1 fi echo "Creating ${IMAGE_NAME} using: " printf -- "- %s\n" "${DIGESTS[@]}" docker manifest create "${IMAGE_NAME}" "${DIGESTS[@]}" --amend IMAGE_DIGEST=$(docker manifest push "${IMAGE_NAME}") echo "Pushed ${IMAGE_NAME} with digest: ${IMAGE_DIGEST}" cosign sign --key "${KMS_KEY}" --tlog-upload=false "${IMAGE_REPO}@${IMAGE_DIGEST}" } add_additional_tags() { if [[ -z "$CIRCLE_BRANCH" && -n "$CIRCLE_TAG" ]]; then BRANCH_NAME="master" else BRANCH_NAME="${CIRCLE_BRANCH//[^[:alnum:]]/-}" # Change all non alphanumeric characters to - fi if [[ -z "$IMAGE_TAG_OVERRIDE" ]]; then crane tag "${IMAGE_NAME}" "latest-${BRANCH_NAME}" crane tag "${IMAGE_NAME}" "k8s-${BRANCH_NAME}-${CIRCLE_SHA1}" fi if [[ "$COMPONENT" = "database-cli" && "$BRANCH_NAME" = "master" ]]; then crane tag "${IMAGE_NAME}" "latest-${BRANCH_NAME}" crane tag "${IMAGE_NAME}" "k8s-${BRANCH_NAME}-${CIRCLE_SHA1}" fi } update_track() { ### update the track BUCKET="com.voiceflow.ci.assets" echo "TRACK: $TRACK" mkdir -p "$(dirname "/tmp/$TRACK")" if [[ "$COMPONENT" = "database-cli" ]]; then echo "New version published: ${IMAGE_TAG_OVERRIDE?}" echo "${IMAGE_TAG_OVERRIDE}" >"/tmp/${TRACK}" else cat \<<EOF >"/tmp/${TRACK}" ${COMPONENT}: image: tag: ${IMAGE_TAG} sha: ${IMAGE_DIGEST#sha256:} EOF fi aws s3 cp "/tmp/${TRACK}" "s3://$BUCKET/$TRACK" } ## Start check_track_exist create_and_sign add_additional_tags update_track environment: COMPONENT: << parameters.component >> IMAGE_REPO: << parameters.image_repo >> IMAGE_TAG_OVERRIDE: << parameters.image_tag >> KMS_KEY: << parameters.kms_key >> name: Pull each architecture by suffix tag and create a single manifest for it generate_technical_documentation: executor: node-executor parameters: step_name: default: Generate technical documentation description: Name of the step type: string steps: - run: command: curl -X POST -d {} https://api.netlify.com/build_hooks/${NETLIFY_TOKEN} name: << parameters.step_name >> helm-publish-charts: executor: build-executor parameters: chart_directory: default: . description: Directory containining charts type: string charts: default: "" description: List of charts to publish type: string steps: - checkout_clone - helm-add-repos - run: command: |- #!/bin/bash # Expected environment variables: echo "CHARTS: ${CHARTS?}" for chart in ${CHARTS?}; do echo "Packaging $chart"; # Create a temporary directory to store the packaged chart dist="$(mktemp -d)" helm dep update "$chart/$chart" helm package "$chart/$chart" --destination "$dist" channel=$(helm show chart "$chart/$chart" | yq --raw-output '.annotations."release-repository"') echo "Publishing in $channel channel"; repo="voiceflow-charts-s3-$channel" if [[ "$channel" == "public" ]]; then repo="voiceflow-charts-s3" fi packaged_chart="$(ls "$dist")" helm s3 push --force "$dist/$packaged_chart" "$repo" rm -rf "$dist" done environment: CHARTS: << parameters.charts >> name: Package and publish charts working_directory: << parameters.chart_directory >> - run: command: |- #!/bin/bash # Expected environment variables: echo "CHARTS: ${CHARTS?}" for chart in ${CHARTS?}; do echo "Packaging $chart"; # Create a temporary directory to store the packaged chart dist="$(mktemp -d)" helm dep update "$chart/$chart" helm package "$chart/$chart" --destination "$dist" channel=$(helm show chart "$chart/$chart" | yq --raw-output '.annotations."release-repository"') echo "Publishing in $channel channel"; repo="voiceflow-charts-s3-$channel" if [[ "$channel" == "public" ]]; then repo="voiceflow-charts-s3" fi packaged_chart="$(ls "$dist")" helm s3 push --force "$dist/$packaged_chart" "$repo" rm -rf "$dist" done environment: CHARTS: << parameters.charts >> name: Package and publish charts working_directory: << parameters.chart_directory >> helm-publish-charts-dual: executor: build-executor parameters: chart_directory: default: . description: Directory containing charts type: string charts: default: "" description: List of charts to publish type: string prepublish_steps: default: [] description: Steps to run on repo before publishing charts type: steps steps: - checkout_clone - steps: << parameters.prepublish_steps >> - helm-add-repos - run: command: |- #!/bin/bash # Expected environment variables: echo "CHARTS: ${CHARTS?}" for chart in ${CHARTS?}; do echo "Packaging $chart"; # Create a temporary directory to store the packaged chart dist="$(mktemp -d)" helm dep update "$chart/$chart" helm package "$chart/$chart" --destination "$dist" channel=$(helm show chart "$chart/$chart" | yq --raw-output '.annotations."release-repository"') echo "Publishing in $channel channel"; repo="voiceflow-charts-s3-$channel" if [[ "$channel" == "public" ]]; then repo="voiceflow-charts-s3" fi packaged_chart="$(ls "$dist")" helm s3 push --force "$dist/$packaged_chart" "$repo" rm -rf "$dist" done environment: CHARTS: << parameters.charts >> name: Package and publish charts to S3 working_directory: << parameters.chart_directory >> - run: command: |- #!/bin/bash # Expected environment variables: echo "CHARTS: ${CHARTS?}" for chart in ${CHARTS?}; do echo "Packaging $chart"; # Create a temporary directory to store the packaged chart dist="$(mktemp -d)" helm dep update "$chart/$chart" helm package "$chart/$chart" --destination "$dist" channel=$(helm show chart "$chart/$chart" | yq --raw-output '.annotations."release-repository"') echo "Publishing in $channel channel"; repo="voiceflow-charts-s3-$channel" if [[ "$channel" == "public" ]]; then repo="voiceflow-charts-s3" fi packaged_chart="$(ls "$dist")" helm s3 push --force "$dist/$packaged_chart" "$repo" rm -rf "$dist" done environment: CHARTS: << parameters.charts >> name: Package and publish charts to S3 working_directory: << parameters.chart_directory >> - run: command: | #!/bin/bash # Expected environment variables: echo "CHARTS: ${CHARTS?}" echo "AWS_REGION: ${AWS_REGION?}" # Set a default value for ECR_REPOSITORY_URI if not set ECR_REPOSITORY_URI=${ECR_REPOSITORY_URI:-"168387678261.dkr.ecr.us-east-1.amazonaws.com"} echo "ECR_REPOSITORY_URI: ${ECR_REPOSITORY_URI}" # Enable experimental OCI support in Helm export HELM_EXPERIMENTAL_OCI=1 # Login to ECR aws ecr get-login-password --region "$AWS_REGION" | helm registry login --username AWS --password-stdin "$ECR_REPOSITORY_URI" for chart in ${CHARTS?}; do echo "Packaging $chart" # Create a temporary directory to store the packaged chart dist="$(mktemp -d)" helm dep update "$chart/$chart" helm package "$chart/$chart" --destination "$dist" # Get the chart version from the packaged chart packaged_chart="$(ls "$dist")" channel=$(helm show chart "$chart/$chart" | yq --raw-output '.annotations."release-repository"') echo "Publishing in $channel channel" repo="voiceflow-charts-private" if [[ "$channel" == "public" ]]; then repo="voiceflow-charts-public" fi # Construct the full ECR URL with the OCI protocol FULL_ECR_URL="oci://$ECR_REPOSITORY_URI/$repo" # Push the chart to ECR using the OCI protocol helm push "$dist/$packaged_chart" "$FULL_ECR_URL" rm -rf "$dist" done environment: CHARTS: << parameters.charts >> name: Package and publish charts to ECR working_directory: << parameters.chart_directory >> helm-publish-charts-ecr: executor: build-executor parameters: chart_directory: default: . description: Directory containining charts type: string charts: default: "" description: List of charts to publish type: string prepublish_steps: default: [] description: Steps to run on repo before publishing charts type: steps steps: - checkout_clone - steps: << parameters.prepublish_steps >> - helm-add-repos - run: command: | #!/bin/bash # Expected environment variables: echo "CHARTS: ${CHARTS?}" echo "AWS_REGION: ${AWS_REGION?}" # Set a default value for ECR_REPOSITORY_URI if not set ECR_REPOSITORY_URI=${ECR_REPOSITORY_URI:-"168387678261.dkr.ecr.us-east-1.amazonaws.com"} echo "ECR_REPOSITORY_URI: ${ECR_REPOSITORY_URI}" # Enable experimental OCI support in Helm export HELM_EXPERIMENTAL_OCI=1 # Login to ECR aws ecr get-login-password --region "$AWS_REGION" | helm registry login --username AWS --password-stdin "$ECR_REPOSITORY_URI" for chart in ${CHARTS?}; do echo "Packaging $chart" # Create a temporary directory to store the packaged chart dist="$(mktemp -d)" helm dep update "$chart/$chart" helm package "$chart/$chart" --destination "$dist" # Get the chart version from the packaged chart packaged_chart="$(ls "$dist")" channel=$(helm show chart "$chart/$chart" | yq --raw-output '.annotations."release-repository"') echo "Publishing in $channel channel" repo="voiceflow-charts-private" if [[ "$channel" == "public" ]]; then repo="voiceflow-charts-public" fi # Construct the full ECR URL with the OCI protocol FULL_ECR_URL="oci://$ECR_REPOSITORY_URI/$repo" # Push the chart to ECR using the OCI protocol helm push "$dist/$packaged_chart" "$FULL_ECR_URL" rm -rf "$dist" done environment: CHARTS: << parameters.charts >> name: Package and publish charts to ECR working_directory: << parameters.chart_directory >> helm-publish-prerelease: executor: build-executor parameters: prepublish_steps: default: [] description: Steps to run on repo before publishing charts type: steps working_directory: default: ./ description: Directory containing chart directories type: string steps: - checkout_clone - set-beta-version: working_directory: << parameters.working_directory >> - steps: << parameters.prepublish_steps >> - helm-add-repos - run: command: |- #!/bin/bash # Expected environment variables: echo "BETA_VERSION: ${BETA_VERSION:?}" # Publishes beta releases for helm charts in subdirectories of working directory # Similar implementation to the `helm-publish-charts` command. If updating this script, be sure to update that one as well for file in * ; do if [[ -d "$file" && -f "$file/$file/Chart.yaml" ]]; then echo "packaging $file"; cd "$file" || exit; helm dep update "$file"; echo "Packaging version $BETA_VERSION" helm package "$file" --version "$BETA_VERSION" echo "publishing beta release"; CHART="$file-${BETA_VERSION}.tgz" if [ ! -f "$CHART" ]; then echo "Packaged chart does not have expected name $CHART. Does the name in Chart.yaml match the directory name?" exit 3 fi helm s3 push --force "$CHART" voiceflow-charts-s3-beta; cd ..; fi; done name: Package and publish charts working_directory: << parameters.working_directory >> helm-publish-prerelease-dual: executor: build-executor parameters: prepublish_steps: default: [] description: Steps to run on repo before publishing charts type: steps working_directory: default: ./ description: Directory containing chart directories type: string steps: - checkout_clone - set-beta-version: working_directory: << parameters.working_directory >> - steps: << parameters.prepublish_steps >> - helm-add-repos - run: command: | #!/bin/bash set -euo pipefail echo "BETA_VERSION: ${BETA_VERSION:?}" echo "AWS_REGION: ${AWS_REGION:?}" ECR_REPOSITORY_URI=${ECR_REPOSITORY_URI:-"168387678261.dkr.ecr.us-east-1.amazonaws.com"} echo "ECR_REPOSITORY_URI: ${ECR_REPOSITORY_URI}" export HELM_EXPERIMENTAL_OCI=1 LOG_DIR="/tmp/helm-publish-logs" mkdir -p "$LOG_DIR" MAX_PARALLEL=2 # Login to ECR once upfront aws ecr get-login-password --region "$AWS_REGION" | \ helm registry login --username AWS --password-stdin "$ECR_REPOSITORY_URI" # Discover charts CHARTS=() for file in *; do if [[ -d "$file" && -f "$file/$file/Chart.yaml" ]]; then CHARTS+=("$file") fi done if [ ${#CHARTS[@]} -eq 0 ]; then echo "No charts found" exit 0 fi echo "Found ${#CHARTS[@]} charts: ${CHARTS[*]}" # ── Phase 1: Package charts in parallel (max $MAX_PARALLEL at a time) ── cat > /tmp/package-chart.sh \<<HELPER #!/bin/bash file="\$1" if ! ( set -euo pipefail cd "\$file" helm dep update "\$file" helm package "\$file" --version "$BETA_VERSION" CHART="\$file-${BETA_VERSION}.tgz" if [ ! -f "\$CHART" ]; then echo "ERROR: Packaged chart does not have expected name \$CHART" exit 3 fi ) > "$LOG_DIR/\$file-package.log" 2>&1; then echo "FAILED: packaging \$file" cat "$LOG_DIR/\$file-package.log" exit 1 fi echo "Packaged \$file" HELPER chmod +x /tmp/package-chart.sh printf '%s\0' "${CHARTS[@]}" | xargs -0 -n1 -P"$MAX_PARALLEL" /tmp/package-chart.sh echo "All ${#CHARTS[@]} charts packaged, starting pushes..." # ── Phase 2: Push to S3 (sequential) and ECR (parallel, max $MAX_PARALLEL) ── cat > /tmp/push-ecr.sh \<<HELPER #!/bin/bash file="\$1" CHART="\$file/\$file-${BETA_VERSION}.tgz" if ! helm push "\$CHART" "oci://${ECR_REPOSITORY_URI}/voiceflow-charts-beta" \ > "$LOG_DIR/\$file-push-ecr.log" 2>&1; then echo "FAILED: ECR push for \$file" cat "$LOG_DIR/\$file-push-ecr.log" exit 1 fi echo "Pushed \$file to ECR" HELPER chmod +x /tmp/push-ecr.sh # Start ECR pushes in background (parallel, limited to $MAX_PARALLEL) printf '%s\0' "${CHARTS[@]}" | xargs -0 -n1 -P"$MAX_PARALLEL" /tmp/push-ecr.sh & ECR_PID=$! # Push to S3 sequentially in foreground (protects shared bucket index) S3_FAILED=0 for file in "${CHARTS[@]}"; do CHART="$file/$file-${BETA_VERSION}.tgz" echo "Pushing $file to S3..." if ! helm s3 push --force "$CHART" voiceflow-charts-s3-beta \ > "$LOG_DIR/$file-push-s3.log" 2>&1; then echo "FAILED: S3 push for $file" cat "$LOG_DIR/$file-push-s3.log" S3_FAILED=1 else echo "Pushed $file to S3" fi done # Wait for ECR pushes to finish ECR_FAILED=0 if ! wait "$ECR_PID"; then ECR_FAILED=1 fi if [ "$S3_FAILED" -ne 0 ] || [ "$ECR_FAILED" -ne 0 ]; then echo "One or more pushes failed. See logs in $LOG_DIR" exit 1 fi echo "All charts published to S3 and ECR" name: Package and publish prerelease charts working_directory: << parameters.working_directory >> - store_artifacts: destination: helm-publish-logs path: /tmp/helm-publish-logs helm-publish-prerelease-ecr: executor: build-executor parameters: prepublish_steps: default: [] description: Steps to run on repo before publishing charts type: steps working_directory: default: ./ description: Directory containing chart directories type: string steps: - checkout_clone - set-beta-version: working_directory: << parameters.working_directory >> - steps: << parameters.prepublish_steps >> - helm-add-repos - run: command: "#!/bin/bash\n\n# Expected environment variables:\necho \"BETA_VERSION: ${BETA_VERSION:?}\"\necho \"AWS_REGION: ${AWS_REGION:?}\"\n\n# Set a default value for ECR_REPOSITORY_URI if not set\nECR_REPOSITORY_URI=${ECR_REPOSITORY_URI:-\"168387678261.dkr.ecr.us-east-1.amazonaws.com\"}\n\necho \"ECR_REPOSITORY_URI: ${ECR_REPOSITORY_URI}\"\n\n# Enable experimental OCI support in Helm\nexport HELM_EXPERIMENTAL_OCI=1\n\n# Login to ECR\naws ecr get-login-password --region \"$AWS_REGION\" | helm registry login --username AWS --password-stdin \"$ECR_REPOSITORY_URI\"\n\n# Publishes beta releases for helm charts in subdirectories of working directory\nfor file in * ; do\n if [[ -d \"$file\" && -f \"$file/$file/Chart.yaml\" ]]; then\n echo \"Packaging $file\"\n cd \"$file\" || exit\n helm dep update \"$file\"\n\n echo \"Packaging version $BETA_VERSION\"\n helm package \"$file\" --version \"$BETA_VERSION\"\n\n echo \"Publishing beta release\"\n CHART=\"$file-$BETA_VERSION.tgz\"\n\n if [ ! -f \"$CHART\" ]; then\n echo \"Packaged chart does not have expected name $CHART. Does the name in Chart.yaml match the directory name?\"\n exit 3\n fi\n\n # Push the chart to ECR\n helm push \"$CHART\" \"oci://$ECR_REPOSITORY_URI/voiceflow-charts-beta\"\n \n cd ..\n fi\ndone\n" name: Package and publish charts to ECR working_directory: << parameters.working_directory >> helm-repo-reindex: executor: build-executor parameters: chart-repo: description: Name of the chart repo to reindex enum: - voiceflow-charts-s3 - voiceflow-charts-s3-private - voiceflow-charts-s3-beta type: enum steps: - checkout_clone - helm-add-repos - run: command: helm s3 reindex << parameters.chart-repo >> name: Reindex the Helm chart repo << parameters.chart-repo >> install_and_build: executor: << parameters.executor >> parameters: attach_workspace: default: false description: Attach workspace to the current working directory type: boolean avoid_post_install_scripts: default: true description: Avoid post-install scripts type: boolean cache_branch: default: "" description: Branch name to use for caching type: string check_image: default: false description: Checks if the Docker image exists type: boolean container_folder_to_copy: default: build description: Avoid post-install scripts type: string container_image_to_build: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: Container image to run the build type: string docker_image_repo: default: "" description: The Docker image of the microservice type: string executor: default: node-large-executor description: The executor used to run this job type: executor force_execute: default: false description: '[DEPRECATED] no effect, kept for backward compatibility' type: boolean language: default: node description: language to execute type: string monorepo_engine: default: lerna description: Monorepo engine type: string package: default: "" description: Package name type: string package_folder: default: packages description: Package folder type: string paths_to_cache: default: '{build,*.tsbuildinfo}' description: Paths to cache type: string post_build_steps: default: [] description: Steps to be run after executing the build commands type: steps pre_build_steps: default: [] description: Steps to be run before executing the build commands type: steps request_remote_docker: default: true description: Request remote Docker type: boolean run_in_container: default: true description: Run build in remote Docker container type: boolean run_install_node_modules_in_container: default: false description: Run install node_modules in remote Docker container type: boolean use_shallow_clone: default: true description: Use shallow clone to checkout code type: boolean steps: - when: condition: << parameters.use_shallow_clone >> steps: - checkout_clone - unless: condition: << parameters.use_shallow_clone >> steps: - checkout - when: condition: << parameters.attach_workspace >> steps: - attach_workspace: at: ~/voiceflow - when: condition: << parameters.check_image >> steps: - when: condition: << parameters.request_remote_docker >> steps: - check_image_exists: image_repo: << parameters.docker_image_repo >> request_remote_docker: false - unless: condition: << parameters.request_remote_docker >> steps: - check_image_exists: image_repo: << parameters.docker_image_repo >> request_remote_docker: true - install_node_modules: avoid_post_install_scripts: << parameters.avoid_post_install_scripts >> container_image: << parameters.container_image_to_build >> language: << parameters.language >> run_in_container: << parameters.run_install_node_modules_in_container >> - monorepo_restore_cache: cache_branch: << parameters.cache_branch >> monorepo_engine: << parameters.monorepo_engine >> package: << parameters.package >> package_folder: << parameters.package_folder >> - steps: << parameters.pre_build_steps >> - build: container_folder_to_copy: << parameters.container_folder_to_copy >> container_image_to_build: << parameters.container_image_to_build >> package: << parameters.package >> package_folder: << parameters.package_folder >> request_remote_docker: << parameters.request_remote_docker >> run_in_container: << parameters.run_in_container >> - steps: << parameters.post_build_steps >> - monorepo_save_cache: cache_branch: << parameters.cache_branch >> monorepo_engine: << parameters.monorepo_engine >> package: << parameters.package >> package_folder: << parameters.package_folder >> paths_to_cache: << parameters.paths_to_cache >> - when: condition: equal: - python - << parameters.language >> steps: - persist_python_build: package: << parameters.package >> package_folder: << parameters.package_folder >> - when: condition: equal: - node - << parameters.language >> steps: - persist_node_build: package: << parameters.package >> package_folder: << parameters.package_folder >> monorepo_analyze_dependencies: executor: << parameters.executor >> parameters: executor: default: node-executor description: Executor to run the command on type: executor run_on_root: default: false description: Check that allow the command to run on root type: boolean steps: - checkout_clone - attach_workspace: at: ~/voiceflow - install_node_modules - monorepo_analyze_dependencies: force_execution: true run_on_root: << parameters.run_on_root >> monorepo_dependency_tests: executor: << parameters.executor >> parameters: executor: default: node-executor description: Executor to run the command on type: executor run_on_root: default: false description: Check that allow the command to run on root type: boolean steps: - checkout_clone - attach_workspace: at: ~/voiceflow - install_node_modules - monorepo_dependency_tests: force_execution: true run_on_root: << parameters.run_on_root >> monorepo_integration_tests: executor: << parameters.executor >> parameters: command: default: yarn test:integration description: Command to run type: string executor: default: node-executor description: Executor to run the command on type: executor request_remote_docker: default: false description: Add the option to request a new remote docker, set to false when you concat docker jobs type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean steps: - checkout_clone - when: condition: << parameters.request_remote_docker >> steps: - setup_remote_docker: version: default - docker_login - attach_workspace: at: ~/voiceflow - install_node_modules - monorepo_integration_tests: command: << parameters.command >> force_execution: true run_on_root: << parameters.run_on_root >> monorepo_lint_dockerfile: executor: << parameters.executor >> parameters: executor: default: node-executor description: Executor to run the command on type: executor run_on_root: default: false description: Check that allow the command to run on root type: boolean steps: - checkout_clone - attach_workspace: at: ~/voiceflow - install_node_modules - monorepo_lint_dockerfile: force_execution: true run_on_root: << parameters.run_on_root >> monorepo_lint_report: executor: << parameters.executor >> parameters: executor: default: node-executor description: Executor to run the command on type: executor run_on_root: default: false description: Check that allow the command to run on root type: boolean steps: - checkout_clone - attach_workspace: at: ~/voiceflow - install_node_modules - restore_cache: keys: - eslint-cache-{{`{{ .Branch }}`}} - eslint-cache-master name: Restoring eslint Cache - monorepo_lint_report: force_execution: true run_on_root: << parameters.run_on_root >> - save_cache: key: eslint-cache-{{`{{ .Branch }}`}}-{{`{{ .BuildNum }}`}} name: Saving eslint Cache paths: - ~/voiceflow/apps/creator-app/.eslintcache monorepo_mintlify_publish: executor: << parameters.executor >> parameters: docs_repo: default: docs-v2 description: Repository containing Mintlify docs type: string executor: default: node-executor description: Executor to run the command on type: executor schema_dir: default: /tmp/schemas description: Directory to store schemas between jobs type: string steps: - checkout_clone - attach_workspace: at: ~/voiceflow - install_node_modules - openapi_restore_schemas: attach_workspace: true from: << parameters.schema_dir >> to: ~/voiceflow - clone_repo: github_repo_name: << parameters.docs_repo >> github_token: GITHUB_TOKEN github_username: GITHUB_USERNAME path_to_clone: ~/docs step_name: Clone Mintlify docs repository - run: command: | yarn schema:extract:public # copy schemas to docs repo cd apps cp -v --parents */openapi.public.json ~/docs/specs # within the docs repo cd ~/docs git config --global user.email "serviceaccount@voiceflow.com" git config --global user.name "Voiceflow" git add specs/*/openapi.public.json git diff-index --quiet HEAD || git commit -m "feat: evolve ${CIRCLE_PROJECT_REPONAME} schemas" git pull --rebase git push name: Commit public OpenAPI schemas to Mintlify docs repo monorepo_rdme_publish: executor: << parameters.executor >> parameters: avoid_post_install_scripts: default: true description: Skip running post install scripts type: boolean executor: default: node-executor description: Executor to run the command on type: executor extra_args: default: "" description: Additional yarn command options type: string force_execution: default: false description: Force execution of the command on all packages type: boolean install_args: default: "" description: Additional yarn install command options type: string run_on_root: default: false description: Check that allow the command to run on root type: boolean schema_dir: default: /tmp/schemas description: Directory to store schemas between jobs type: string steps: - checkout_clone - attach_workspace: at: ~/voiceflow - install_node_modules: avoid_post_install_scripts: << parameters.avoid_post_install_scripts >> install_args: << parameters.install_args >> - openapi_restore_schemas: attach_workspace: true from: << parameters.schema_dir >> to: ~/voiceflow - monorepo_exec_command: command: yarn rdme:publish extra_args: << parameters.extra_args >> run_on_root: << parameters.run_on_root >> step_name: Publish to README monorepo_release: executor: << parameters.executor >> parameters: avoid_post_install_scripts: default: true description: Skip running post install scripts type: boolean commit_message: default: 'chore(release): publish' description: Release engine to use type: string executor: default: node-executor description: The executor used to run this job type: executor install_args: default: "" description: Additional yarn install command options type: string language: default: node description: language to execute type: string post_publish_steps: default: [] description: Steps to run after executing the publish command type: steps pre_publish_steps: default: [] description: Steps to run before executing the publish command type: steps prerelease: default: false description: Creates a prerelease type: boolean publish_args: default: "" description: Additional lerna publish command options type: string release_engine: default: lerna description: Release engine to use type: string sentry_project: default: "" description: Sentry project to associate the release with type: string ssh_key: description: The SSH key with write permissions to the repository type: string trigger_tags_pipelines: default: true description: Trigger tags after monoropo release type: boolean steps: - add_ssh_keys: fingerprints: - << parameters.ssh_key >> - checkout: method: full - install_node_modules: avoid_post_install_scripts: << parameters.avoid_post_install_scripts >> install_args: << parameters.install_args >> language: << parameters.language >> - attach_workspace: at: ~/voiceflow - run: command: |- git config --global user.email "serviceaccount@voiceflow.com" git config --global user.name "Voiceflow" name: Set Github config - steps: << parameters.pre_publish_steps >> - when: condition: equal: - lerna - << parameters.release_engine >> steps: - run: command: |- PRERELEASE="<< parameters.prerelease >>" SHORT_SHA=$(git rev-parse --short HEAD) if [ "$PRERELEASE" = "true" ]; then SENTRY_PROJECT=<< parameters.sentry_project >> HUSKY=0 npx lerna@4.0.0 publish prerelease \ --message "<< parameters.commit_message >>" --yes \ --no-push --no-git-tag-version --canary --preid $SHORT_SHA \ --conventional-commits --force-publish --no-verify-access << parameters.publish_args >> else SENTRY_PROJECT=<< parameters.sentry_project >> HUSKY=0 npx lerna@4.0.0 publish \ --message "<< parameters.commit_message >>" --yes \ --conventional-commits --no-verify-access << parameters.publish_args >> fi name: Release Monorepo - when: condition: equal: - lite - << parameters.release_engine >> steps: - run: command: |- PRERELEASE="<< parameters.prerelease >>" SHORT_SHA=$(git rev-parse --short HEAD) if [ "$PRERELEASE" = "true" ]; then SENTRY_PROJECT=<< parameters.sentry_project >> HUSKY=0 npx --package @lerna-lite/cli@1.17.0 lerna publish prerelease \ --message "<< parameters.commit_message >>" --yes \ --no-push --no-git-tag-version --canary --preid $SHORT_SHA \ --conventional-commits --force-publish --no-verify-access << parameters.publish_args >> else SENTRY_PROJECT=<< parameters.sentry_project >> HUSKY=0 npx --package @lerna-lite/cli@1.17.0 lerna publish \ --message "<< parameters.commit_message >>" --yes \ --conventional-commits --no-verify-access << parameters.publish_args >> fi name: Release Monorepo - when: condition: equal: - nx - << parameters.release_engine >> steps: - run: command: yarn run publish name: Release Monorepo - steps: << parameters.post_publish_steps >> - run: command: echo "export MONOREPO_UPDATED_TAGS=\"$(git tag --points-at HEAD)\"" >> $BASH_ENV name: Store tags - when: condition: << parameters.trigger_tags_pipelines >> steps: - trigger_tags_pipelines: published_tags: MONOREPO_UPDATED_TAGS monorepo_schema_release: executor: << parameters.executor >> parameters: executor: default: node-executor description: Executor to run the command on type: executor schema_dir: default: /tmp/schemas description: Directory to store schemas between jobs type: string steps: - clone_repo: github_repo_name: openapi-schemas github_token: GITHUB_TOKEN github_username: GITHUB_USERNAME path_to_clone: ~/schemas step_name: Clone openapi-schemas repository - openapi_restore_schemas: attach_workspace: true from: << parameters.schema_dir >> to: ~/schemas - run: command: | git config --global user.email "serviceaccount@voiceflow.com" git config --global user.name "Voiceflow" git add **/openapi.json git diff-index --quiet HEAD || git commit -m "feat: evolve ${CIRCLE_PROJECT_REPONAME} schemas" git pull --rebase git push name: Commit Schemas working_directory: ~/schemas monorepo_schema_validate: executor: << parameters.executor >> parameters: cache_prefix: default: monorepo-schema-validate description: Cache prefix type: string executor: default: node-executor description: Executor to run the command on type: executor schema_dir: default: /tmp/schemas description: Directory to store schemas between jobs type: string skip_tests: default: false description: Skip the tests but save the updated schemas type: boolean steps: - setup_remote_docker: version: default - checkout_clone - install_node_modules: avoid_post_install_scripts: false - attach_workspace: at: ~/voiceflow - clone_repo: github_repo_name: openapi-schemas github_token: GITHUB_TOKEN github_username: GITHUB_USERNAME path_to_clone: ~/schemas step_name: Clone openapi-schemas repository - openapi_restore_schemas: from: ~/schemas to: ~/voiceflow - run: command: yarn schema:validate environment: SKIP_ACCEPTANCE_TESTS: << parameters.skip_tests >> name: Validate Schemas - openapi_persist_schemas: workspace_dir: << parameters.schema_dir >> monorepo_types_tests: executor: << parameters.executor >> parameters: executor: default: node-executor description: Executor to run the command on type: executor run_on_root: default: false description: Check that allow the command to run on root type: boolean steps: - checkout_clone - attach_workspace: at: ~/voiceflow - run: command: | if [[ -d ~/voiceflow/node_modules/.cache/turbo ]]; then cp -R ~/voiceflow/node_modules/.cache/turbo /tmp/turbo-cache fi - install_node_modules - run: command: | if [[ -d /tmp/turbo-cache ]]; then rm -rf ~/voiceflow/node_modules/.cache/turbo cp -R /tmp/turbo-cache ~/voiceflow/node_modules/.cache/turbo fi - monorepo_types_tests: force_execution: true run_on_root: << parameters.run_on_root >> monorepo_unit_tests: executor: << parameters.executor >> parameters: collect_coverage: default: false description: Collect coverage information from sonar directories type: boolean executor: default: node-executor description: Executor to run the command on type: executor request_remote_docker: default: false description: Request remote Docker type: boolean run_on_root: default: false description: Check that allow the command to run on root type: boolean steps: - when: condition: << parameters.request_remote_docker >> steps: - setup_remote_docker: version: default - checkout_clone - attach_workspace: at: ~/voiceflow - install_node_modules - monorepo_unit_tests: force_execution: true run_on_root: << parameters.run_on_root >> - run: command: | mkdir -p reports # copy all .report.xml files to the root directory # and give them unique names based on their paths find . -type f -name "*.report.xml" | xargs -I {} sh -c 'cp {} reports/$(echo {} | cut -c 3- | tr "/" "_")' name: Collect test reports - store_test_results: path: ./reports - when: condition: << parameters.collect_coverage >> steps: - persist_to_workspace: paths: - '*/*/sonar' root: . post_image_push_actions: executor: build-executor parameters: component: description: The component name that has changed type: string force_execute: default: false description: force to notify, if there is a change or not. type: boolean namespace: description: The namespace to look at type: string package: default: "" description: The monorepo package that has been changed type: string package_folder: default: packages description: The monorepo package that has been changed type: string success_slack_notify: default: true description: Post to Slack on successful deployment? type: boolean tagged: default: false description: if tagged type: boolean steps: - post_image_push_actions: component: << parameters.component >> force_execute: << parameters.force_execute >> namespace: << parameters.namespace >> package: << parameters.package >> package_folder: << parameters.package_folder >> success_slack_notify: << parameters.success_slack_notify >> tagged: << parameters.tagged >> prepare-env: description: Prepare an existing environment for e2e tests executor: node-executor-node-20 parameters: branch: description: Branch to track for the specified components type: string cluster: default: cm4-vf-dev-eu-0-p0 description: Name of the cluster in which the environment exists type: string env-name: description: Name of the environment to prepare type: string tracked-components: default: "" description: Space-separated list of components to track the specified branch type: string steps: - install-vfcli: init-cluster: << parameters.cluster >> - generate-track-mapping: components: << parameters.tracked-components >> track: << parameters.branch >> track-file: /tmp/tracks.yaml - vfcli-suspend-env: env-name: << parameters.env-name >> track-file: /tmp/tracks.yaml - run: command: kubectl get pods -n << parameters.env-name >> name: Get pod list when: on_fail - run: command: vfcli logs gather-all "${LOG_DIR:?}" --name "${ENV_NAME:?}" environment: ENV_NAME: << parameters.env-name >> LOG_DIR: /tmp/pod-logs-<< parameters.env-name >> name: Gather Logs when: on_fail - store_artifacts: destination: logs name: Store Logs path: /tmp/pod-logs-<< parameters.env-name >> when: on_fail - vfcli-delete-or-release-env: env-name: << parameters.env-name >> when: on_fail promote_production: executor: << parameters.executor >> parameters: executor: default: build-executor description: Executor to use type: executor image_registry: description: The container image repository type: string modifiedComponentNames: description: Space-delimited string of modified service names type: string steps: - docker_login - promote_production: image_registry: << parameters.image_registry >> modifiedComponentNames: << parameters.modifiedComponentNames >> provision-env: description: Provision an environment for e2e tests executor: default-executor parameters: branch: default: master description: Branch to track for the specified components type: string cluster: default: cm4-vf-dev-eu-0-p0 description: Name of the cluster to create the environment on type: string env-name: description: Name of the environment to create type: string force: default: false description: Whether to force environment creation without checking for free environment type: boolean pool-type: default: "" description: Pool where a free environment will be fetched type: string tracked-components: default: "" description: Space-separated list of components to track the specified branch type: string steps: - install-vfcli: init-cluster: << parameters.cluster >> - generate-track-mapping: components: << parameters.tracked-components >> track: << parameters.branch >> track-file: /tmp/tracks.yaml - vfcli-create-or-get-free-env-from-pool: env-name: << parameters.env-name >> force: << parameters.force >> pool-type: << parameters.pool-type >> track-file: /tmp/tracks.yaml - run: command: kubectl get pods -n << parameters.env-name >> name: Get pod list when: on_fail - run: command: vfcli logs gather-all "${LOG_DIR:?}" --name "${ENV_NAME:?}" environment: ENV_NAME: << parameters.env-name >> LOG_DIR: /tmp/pod-logs-<< parameters.env-name >> name: Gather Logs when: on_fail - store_artifacts: destination: logs name: Store Logs path: /tmp/pod-logs-<< parameters.env-name >> when: on_fail - vfcli-delete-or-release-env: env-name: << parameters.env-name >> when: on_fail release: executor: << parameters.executor >> parameters: avoid_post_install_scripts: default: true description: Skip running post install scripts type: boolean executor: default: node-executor description: Executor to use in this job type: executor install_args: default: "" description: Additional yarn install command options type: string pre_release_steps: default: [] description: Steps to run before executing the release command type: steps prerelease_tag: default: "" description: Tag to use for prerelease (Must be used alongside prerelease_version) type: string prerelease_version: default: "" description: Version to use for prerelease (Must be used alongside prerelease_tag) type: string sentry_project: default: "" description: Sentry project to associate the release with type: string ssh_key: default: "" description: The SSH key with write permissions to the repository type: string working_directory: default: ~/voiceflow description: Directory containing package.json type: string yarn_lock_restore_cache_directory: default: ./ description: Cache directory for yarn.lock file type: string steps: - add_ssh_keys: fingerprints: - << parameters.ssh_key >> - checkout: method: full - install_node_modules: avoid_post_install_scripts: << parameters.avoid_post_install_scripts >> install_args: << parameters.install_args >> working_directory: << parameters.working_directory >> yarn_lock_restore_cache_directory: << parameters.working_directory >> - attach_workspace: at: << parameters.working_directory >> - steps: << parameters.pre_release_steps >> - when: condition: << parameters.prerelease_version >> steps: - run: command: | # Git user must be set for yarn publish git config --global user.email "serviceaccount@voiceflow.com" git config --global user.name "Voiceflow" YARN_VERSION=$(yarn --version) if [ "${YARN_VERSION::1}" == "1" ] ; then yarn publish --new-version << parameters.prerelease_version >> --tag << parameters.prerelease_tag >> else yarn version << parameters.prerelease_version >> --immediate yarn npm publish --tag << parameters.prerelease_tag >> fi name: Release prerelease << parameters.prerelease_version >> to << parameters.prerelease_tag >> channel working_directory: << parameters.working_directory >> - unless: condition: << parameters.prerelease_version >> steps: - run: command: | SENTRY_PROJECT=<< parameters.sentry_project >> npx semantic-release name: Release Package with semantic-release working_directory: << parameters.working_directory >> release-env: description: Release an environment from use by the e2e tests executor: default-executor parameters: cluster: default: cm4-vf-dev-eu-0-p0 description: Name of the cluster in which the environment exists type: string env-name: description: Name of the environment to release type: string force: default: false description: Whether to reset the database type: boolean reset-db: default: true description: Whether to reset the database type: boolean when: default: always description: When to run this command type: string steps: - install-vfcli: init-cluster: << parameters.cluster >> - vfcli-delete-or-release-env: env-name: << parameters.env-name >> force: << parameters.force >> reset-db: << parameters.reset-db >> when: << parameters.when >> release_golang: executor: go-executor parameters: release_package: description: Release package type: string ssh_fingerprint: description: SSH Key type: string steps: - checkout - add_ssh_keys: fingerprints: - << parameters.ssh_fingerprint >> - run: command: yarn install name: Install Dependencies - run: command: npx semantic-release name: Install and run semantic-release - run: command: git pull name: Get latest tag - run: command: |- if [ -z "$(git tag --points-at HEAD)" ]; then echo "No tag found, skipping goreleaser" else git config --global url."https://$GITHUB_TOKEN:x-oauth-basic@github.com/".insteadOf "https://github.com/" curl -sL https://git.io/goreleaser | bash fi environment: GOPRIVATE: github.com/voiceflow name: Directly run goreleaser if a new tag is found report_smoke_failures: executor: node-executor-node-20 parameters: branch-or-commit: default: master description: the branch or commit of the automated-testing repo to reference for source code type: string channel: default: test_failures description: the channel where test failures reports will be posted type: string e2e-env-name: default: "" type: string env-name-path: default: /home/circleci/voiceflow/env_name.txt description: Path to the env_name file type: string mention: default: <!subteam^S07CKAVJPLG> type: string steps: - restore_cache: key: env_name_cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_WORKFLOW_ID }} - authenticate_npm - run: command: | if [[ -f << parameters.env-name-path >> ]]; then echo "Using env_name from file << parameters.env-name-path >> in the suspend action" env_name=$(cat << parameters.env-name-path >>) else env_name="<< parameters.e2e-env-name >>" fi npx --package=@voiceflow/test-cli -- \ testcli report pull-request \ --environment "${env_name}" \ --smokeRef << parameters.branch-or-commit >> \ --channel << parameters.channel >> \ --mention '<< parameters.mention >>' name: Report Test Failures resetdb-free-env: description: Release an environment from use by the e2e tests executor: default-executor parameters: cluster: default: cm4-vf-dev-eu-0-p0 description: Name of the cluster in which the environment exists type: string env-name: description: Name of the environment to release type: string steps: - install-vfcli: init-cluster: << parameters.cluster >> - vfcli-resetdb-free-env: env-name: << parameters.env-name >> run-e2e-tests: description: Run e2e tests in specified environment. The environment and e2e repo must be provisioned before running this job. executor: cypress-e2e-executor parallelism: 4 parameters: artifacts_path: default: apps/creator-app/cypress description: The path within the repo where the e2e test artifacts will be stored type: string cluster: default: cm4-vf-dev-eu-0-p0 description: Name of the cluster to create the environment on type: string env-name: description: Name of the environment to create type: string steps: - install-vfcli: init-cluster: << parameters.cluster >> - vfcli-fetch-endpoints: components: creator-app test-api auth-api env-name: << parameters.env-name >> - attach_workspace: at: . - run: command: | cd "${REPO_PATH}" yarn cypress:ci name: Run e2e tests - store_test_results: path: << parameters.artifacts_path >>/results - store_artifacts: destination: downloads path: << parameters.artifacts_path >>/downloads - store_artifacts: destination: videos path: << parameters.artifacts_path >>/videos - store_artifacts: destination: screenshots path: << parameters.artifacts_path >>/screenshots - run: command: | # Only store logs on the first parallel job if [[ $CIRCLE_NODE_INDEX == 0 ]]; then vfcli logs gather-all "${LOG_DIR:?}" --name "${ENV_NAME:?}" fi environment: ENV_NAME: << parameters.env-name >> LOG_DIR: /tmp/e2e-logs-<< parameters.env-name >> name: Gather Logs when: always - store_artifacts: destination: logs name: Store Logs path: /tmp/e2e-logs-<< parameters.env-name >> when: always run-integration-tests: executor: << parameters.executor >> parameters: executor: default: node-executor-node-20 description: Executor to run the command on type: executor integration-command: default: test:integration type: string steps: - checkout_clone - attach_workspace: at: ~/voiceflow - install_node_modules: avoid_post_install_scripts: false cache_prefix: integration-test - run: command: git rev-parse HEAD >> commit.txt name: Reference commit SHA - restore_cache: key: integration-test-build-cache-{{ checksum "commit.txt" }} - setup_remote_docker: version: default - run: command: yarn << parameters.integration-command >> name: Run Integration Tests - save_cache: key: integration-test-build-cache-{{ checksum "commit.txt" }} paths: - node_modules/.cache/turbo run-playwright-smoke-tests: executor: name: playwright-executor playwright-version: << parameters.playwright-version >> parallelism: << parameters.parallelism >> parameters: branch-or-commit: default: master description: the branch or commit of the automated-testing repo to checkout type: string e2e-env-name: default: "" type: string env-name-path: default: /home/circleci/voiceflow/env_name.txt description: Path to the env_name file type: string parallelism: default: 4 type: integer playwright-version: default: 1.48.2 type: string smoke-command: default: test:ci:pull-request type: string target-url: default: "" description: use this to override the e2e-env-name and set the full creator-app URL type: string steps: - clone_repo: github_commit: << parameters.branch-or-commit >> github_repo_name: automated-testing path_to_clone: ~/project - install_node_modules: avoid_post_install_scripts: false cache_prefix: playwright-smoke-test - restore_cache: key: env_name_cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_WORKFLOW_ID }} - run: command: | # env_name.txt is used to store the e2e env name and passed to the smoke tests # uses e2e-env-name if env_name.txt is 'null' if [ ! -z "<< parameters.target-url >>" ]; then echo 'export CREATOR_APP_URL=<< parameters.target-url >>' >> $BASH_ENV elif [ -f << parameters.env-name-path >> ] && [ "$(cat << parameters.env-name-path >>)" != "null" ]; then echo 'export CREATOR_APP_URL=https://creator-$(cat << parameters.env-name-path >>).eu.development.voiceflow.com' >> $BASH_ENV else echo 'export CREATOR_APP_URL=https://creator-<< parameters.e2e-env-name >>.eu.development.voiceflow.com' >> $BASH_ENV fi name: Set Environment Variables shell: /bin/bash - run: command: git rev-parse HEAD >> commit.txt name: Reference commit SHA - restore_cache: key: playwright-smoke-test-build-cache-{{ checksum "commit.txt" }} - run: command: yarn << parameters.smoke-command >> name: Run Smoke Tests - save_cache: key: playwright-smoke-test-build-cache-{{ checksum "commit.txt" }} paths: - node_modules/.cache/turbo - store_test_results: path: tests/smoke-playwright/e2e.report.xml - store_artifacts: path: tests/smoke-playwright/test-results run-smoke-tests: executor: smoke-executor parallelism: << parameters.parallelism >> parameters: branch-or-commit: default: master description: the branch or commit of the automated-testing repo to checkout type: string e2e-env-name: default: "" type: string env-name-path: default: /home/circleci/voiceflow/env_name.txt description: Path to the env_name file type: string parallelism: default: 1 type: integer smoke-command: default: test:smoke:stable type: string tags: default: "" type: string target-url: default: "" description: use this to override the e2e-env-name and set the full creator-app URL type: string steps: - clone_repo: github_commit: << parameters.branch-or-commit >> github_repo_name: automated-testing path_to_clone: ~/project - install_node_modules: avoid_post_install_scripts: false cache_prefix: cypress-smoke-test - restore_cache: key: env_name_cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_WORKFLOW_ID }} - run: command: | # env_name.txt is used to store the e2e env name and passed to the smoke tests # uses e2e-env-name if env_name.txt is 'null' if [ ! -z "<< parameters.target-url >>" ]; then echo 'export CREATOR_APP_URL=<< parameters.target-url >>' >> $BASH_ENV elif [ -f << parameters.env-name-path >> ] && [ "$(cat << parameters.env-name-path >>)" != "null" ]; then echo 'export CREATOR_APP_URL=https://creator-$(cat << parameters.env-name-path >>).eu.development.voiceflow.com' >> $BASH_ENV else echo 'export CREATOR_APP_URL=https://creator-<< parameters.e2e-env-name >>.eu.development.voiceflow.com' >> $BASH_ENV fi name: Set Environment Variables shell: /bin/bash - run: command: git rev-parse HEAD >> commit.txt name: Reference commit SHA - restore_cache: key: smoke-test-build-cache-{{ checksum "commit.txt" }} - run: command: yarn << parameters.smoke-command >> environment: CYPRESS_INCLUDE_TAGS: << parameters.tags >> name: Run Smoke Tests - save_cache: key: smoke-test-build-cache-{{ checksum "commit.txt" }} paths: - node_modules/.cache/turbo - store_test_results: path: apps/smoke-test-runner/cypress/results - store_artifacts: destination: downloads path: apps/smoke-test-runner/cypress/downloads - store_artifacts: destination: videos path: apps/smoke-test-runner/cypress/videos - store_artifacts: destination: screenshots path: apps/smoke-test-runner/cypress/screenshots - store_artifacts: destination: logs path: apps/smoke-test-runner/cypress/logs sonarcloud_scan: executor: << parameters.executor >> parameters: executor: default: java-executor description: Executor to run the command on type: executor install_node_modules: default: false description: Install dependencies before scanning type: boolean steps: - checkout - attach_workspace: at: ~/voiceflow - when: condition: << parameters.install_node_modules >> steps: - install_node_modules - sonarcloud/scan: cache_version: 2 sync_branches: executor: build-executor parameters: check_commit_message: default: "" description: The SSH key with write permissions to the repository type: string checkout: default: false description: Checkout code type: boolean destination_branch_name: default: production description: Name of the production branch type: string source_branch_name: default: master description: Name of the source branch type: string ssh_key: description: The SSH key with write permissions to the repository type: string steps: - sync_branches: check_commit_message: << parameters.check_commit_message >> checkout: << parameters.checkout >> destination_branch_name: << parameters.destination_branch_name >> source_branch_name: << parameters.source_branch_name >> ssh_key: << parameters.ssh_key >> step_name: Sync << parameters.destination_branch_name >> branch with << parameters.source_branch_name >> branch update_database_track: executor: << parameters.executor >> parameters: component: description: The component type for development environment deployment type: string executor: default: build-executor description: Executor to use type: executor image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string node_version: description: Node version type: string platform: default: linux/amd64 description: Platform to build the image for type: string semantic_version: default: "" type: string steps: - update_database_track: component: << parameters.component >> image_repo: << parameters.image_repo >> image_tag: << parameters.image_tag >> node_version: << parameters.node_version >> semantic_version: << parameters.semantic_version >> update_track: executor: << parameters.executor >> parameters: bucket: default: com.voiceflow.ci.assets description: The container image repository type: string build_context: default: . description: Path to the context for the docker build type: string builder_name: default: "" description: named builder for use with DLC type: string check_track_exists: default: true description: checks if the track exists type: boolean checkout: default: true description: Determines if a checkout will be executed or not type: boolean component: description: The component type for development environment deployment type: string disable_provenance: default: false description: disable provenance for image. necessary for lambda images type: boolean dockerfile: default: Dockerfile description: Name of the Dockerfile to build type: string enable_cache_to: default: false description: use --cache-to flag to push cache artifact to remote registry type: boolean enable_dlc: default: false description: enable docker layer cache type: boolean enable_load: default: false description: Load image into local docker type: boolean enable_push: default: true description: push the image to the registry type: boolean executor: default: build-executor description: Executor to use type: executor extra_build_args: default: "" description: Arguments to pass while building the docker image type: string force_execute: default: false description: force to update the build, if there is a change or not. type: boolean image_repo: description: The container image repository type: string image_tag: default: "" description: The container image tag type: string inject_aws_credentials: default: false description: Inject AWS credentials into the build type: boolean kms_key: default: awskms:///2e64fa98-d1b0-491a-acf6-1f5fc6f94ecf description: KMS Key to sign the containers type: string local_registry: default: false description: Use a local proxy registry to publish alpha version of all libraries in monorepo (must have a /config/verdaccio/config.yaml file) type: boolean local_registry_container_image: default: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-node-build-image:v1 description: container image to run verdaccio type: string package: default: "" description: Monorepo package. type: string package_folder: default: packages description: Package folder to check type: string platform: default: linux/amd64 description: Platform to build the image for type: string remote_docker_version: default: default description: Linux/amd64 allows for specific versions to be set, while linux/arm64 only allows for either default and edge type: string request_remote_docker: default: true description: Add the option to request a new remote docker, set to false when you concat docker jobs type: boolean sem_ver_override: default: "" description: Semantic release version of the package type: string update_track_file: default: true description: Determines if the track file will be updated or not type: boolean steps: - update_track: bucket: << parameters.bucket >> build_context: << parameters.build_context >> builder_name: << parameters.builder_name >> check_track_exists: << parameters.check_track_exists >> checkout: << parameters.checkout >> component: << parameters.component >> disable_provenance: << parameters.disable_provenance >> dockerfile: << parameters.dockerfile >> enable_cache_to: << parameters.enable_cache_to >> enable_dlc: << parameters.enable_dlc >> enable_load: << parameters.enable_load >> enable_push: << parameters.enable_push >> extra_build_args: << parameters.extra_build_args >> force_execute: << parameters.force_execute >> image_repo: << parameters.image_repo >> image_tag: << parameters.image_tag >> inject_aws_credentials: << parameters.inject_aws_credentials >> kms_key: << parameters.kms_key >> local_registry: << parameters.local_registry >> local_registry_container_image: << parameters.local_registry_container_image >> package: << parameters.package >> package_folder: << parameters.package_folder >> remote_docker_version: << parameters.remote_docker_version >> request_remote_docker: << parameters.request_remote_docker >> sem_ver_override: << parameters.sem_ver_override >> update_track_file: << parameters.update_track_file >> validate-chart-version-bump: executor: build-executor parameters: chart_directory: default: ./ description: Directory containing charts type: string charts: default: "" description: List of charts to validate type: string steps: - checkout_clone - helm-add-repos - run: command: |- #!/bin/bash -e # Expected environment variables: echo "CHARTS: ${CHARTS?}" rc=0 # return code for CHART in ${CHARTS?}; do echo "Checking if chart ${CHART} has been modified" LOCAL_CHART="$(helm show chart "$CHART/$CHART")" CHANNEL="$(yq --raw-output '.annotations."release-repository"' \<<< "$LOCAL_CHART")" REPO="voiceflow-charts-s3-$CHANNEL" if [[ "$CHANNEL" == "public" ]]; then REPO="voiceflow-charts-s3" fi LOCAL_VERSION="$(yq --raw-output .version \<<< "$LOCAL_CHART")" REMOTE_VERSION="$(helm show chart "$REPO/$CHART" | yq --raw-output .version)" || true # ignore error if chart does not exist if [[ -z "$REMOTE_VERSION" ]]; then echo "Chart $CHART does not exist in $REPO. Asuming this is a new chart." continue fi # To ensure version bump, we check if the local version is greater than the remote version if echo -e "$LOCAL_VERSION\n$REMOTE_VERSION" | sort -c -V 2> /dev/null; then echo "ERROR: Chart version for $CHART has not been updated. Master is at $REMOTE_VERSION while this branch is at $LOCAL_VERSION" >&2 rc=1 fi done exit $rc environment: CHARTS: << parameters.charts >> name: Ensure chart versions have been bumped working_directory: << parameters.chart_directory >> waiter: description: Waiter job to be used as a dependency for the Release and Delete job docker: - image: circleci/node parameters: wait-duration: default: 15 description: Waiter Sleep time type: integer steps: - run: command: | # Global variable to store the status code check_jobs_status=0 ## Function to check if the API request was successful and process the response check_jobs() { echo "Fetching jobs from CircleCI API..." response=$(curl --silent --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CIRCLECI_API_TOKEN") if [[ $? -ne 0 ]]; then echo "Error: Failed to fetch jobs from CircleCI API" check_jobs_status=1 return fi echo "API response received:" >&2 echo "$response" >&2 if echo "$response" | jq -e . >/dev/null 2>&1; then statuses=$(echo "$response" | jq -r '.items[] | select(.name != "vfcommon/waiter") | .status') if [[ -z "$statuses" ]]; then echo "No job statuses found or unexpected response format" check_jobs_status=1 return fi echo "Job statuses extracted:" echo "$statuses" else echo "Error: Malformed JSON response" check_jobs_status=1 return fi ## Check if any job is still running if echo "$statuses" | grep -q "running"; then echo "There are still running jobs." check_jobs_status=0 # jobs are still running else echo "No jobs are running." check_jobs_status=2 # all jobs are completed successfully fi } ## The waiter job keeps looping through to check if all running jobs have been completed while true; do echo "Running check_jobs function..." check_jobs status=$check_jobs_status echo "Status returned from check_jobs: $status" if [[ $status -eq 1 ]]; then echo "Retrying in << parameters.wait-duration >> seconds due to error..." sleep << parameters.wait-duration >> continue elif [[ $status -eq 2 ]]; then echo "All jobs completed successfully." exit 0 # success else echo "Jobs are still running, checking again in << parameters.wait-duration >> seconds..." sleep << parameters.wait-duration >> fi done name: Check if all jobs have completed - run: echo "All required jobs have now completed"
Developer Updates
Get tips to optimize your builds
Or join our research panel and give feedback
By submitting this form, you are agreeing to ourTerms of UseandPrivacy Policy.