Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions scripts/deploy/deploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ describe('deploy', () => {
'aws s3 cp --cache-control max-age=14400, s-maxage=60 packages/rum-slim/bundle/datadog-rum-slim.js s3://browser-agent-artifacts-prod/datadog-rum-slim-v6.js',
env,
},
{
command:
'aws s3 cp --cache-control max-age=14400, s-maxage=60 packages/debugger/bundle/datadog-debugger.js s3://browser-agent-artifacts-prod/datadog-debugger-v6.js',
env,
},
])

assert.deepEqual(getCloudfrontCommands(), [
{
command: `aws cloudfront create-invalidation --distribution-id EGB08BYCT1DD9 --paths /datadog-logs-v6.js,/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/datadog-rum-v6.js,/datadog-rum-slim-v6.js`,
command: `aws cloudfront create-invalidation --distribution-id EGB08BYCT1DD9 --paths /datadog-logs-v6.js,/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/datadog-rum-v6.js,/datadog-rum-slim-v6.js,/datadog-debugger-v6.js`,
env,
},
])
Expand Down Expand Up @@ -115,10 +120,15 @@ describe('deploy', () => {
'aws s3 cp --cache-control max-age=14400, s-maxage=60 packages/rum-slim/bundle/datadog-rum-slim.js s3://browser-agent-artifacts-prod/us1/v6/datadog-rum-slim.js',
env,
},
{
command:
'aws s3 cp --cache-control max-age=14400, s-maxage=60 packages/debugger/bundle/datadog-debugger.js s3://browser-agent-artifacts-prod/us1/v6/datadog-debugger.js',
env,
},
])
assert.deepEqual(getCloudfrontCommands(), [
{
command: `aws cloudfront create-invalidation --distribution-id EGB08BYCT1DD9 --paths /us1/v6/datadog-logs.js,/us1/v6/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/us1/v6/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/us1/v6/datadog-rum.js,/us1/v6/datadog-rum-slim.js`,
command: `aws cloudfront create-invalidation --distribution-id EGB08BYCT1DD9 --paths /us1/v6/datadog-logs.js,/us1/v6/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/us1/v6/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/us1/v6/datadog-rum.js,/us1/v6/datadog-rum-slim.js,/us1/v6/datadog-debugger.js`,
env,
},
])
Expand Down Expand Up @@ -152,11 +162,16 @@ describe('deploy', () => {
'aws s3 cp --cache-control max-age=900, s-maxage=60 packages/rum-slim/bundle/datadog-rum-slim.js s3://browser-agent-artifacts-staging/datadog-rum-slim-staging.js',
env,
},
{
command:
'aws s3 cp --cache-control max-age=900, s-maxage=60 packages/debugger/bundle/datadog-debugger.js s3://browser-agent-artifacts-staging/datadog-debugger-staging.js',
env,
},
])

assert.deepEqual(getCloudfrontCommands(), [
{
command: `aws cloudfront create-invalidation --distribution-id E2FP11ZSCFD3EU --paths /datadog-logs-staging.js,/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/datadog-rum-staging.js,/datadog-rum-slim-staging.js`,
command: `aws cloudfront create-invalidation --distribution-id E2FP11ZSCFD3EU --paths /datadog-logs-staging.js,/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/datadog-rum-staging.js,/datadog-rum-slim-staging.js,/datadog-debugger-staging.js`,
env,
},
])
Expand Down Expand Up @@ -189,11 +204,16 @@ describe('deploy', () => {
'aws s3 cp --cache-control max-age=900, s-maxage=60 packages/rum-slim/bundle/datadog-rum-slim.js s3://browser-agent-artifacts-prod/datadog-rum-slim-canary.js',
env,
},
{
command:
'aws s3 cp --cache-control max-age=900, s-maxage=60 packages/debugger/bundle/datadog-debugger.js s3://browser-agent-artifacts-prod/datadog-debugger-canary.js',
env,
},
])

assert.deepEqual(getCloudfrontCommands(), [
{
command: `aws cloudfront create-invalidation --distribution-id EGB08BYCT1DD9 --paths /datadog-logs-canary.js,/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/datadog-rum-canary.js,/datadog-rum-slim-canary.js`,
command: `aws cloudfront create-invalidation --distribution-id EGB08BYCT1DD9 --paths /datadog-logs-canary.js,/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/datadog-rum-canary.js,/datadog-rum-slim-canary.js,/datadog-debugger-canary.js`,
env,
},
])
Expand Down Expand Up @@ -226,11 +246,16 @@ describe('deploy', () => {
'aws s3 cp --cache-control max-age=900, s-maxage=60 packages/rum-slim/bundle/datadog-rum-slim.js s3://browser-agent-artifacts-prod/datadog-rum-slim-v7-canary.js',
env,
},
{
command:
'aws s3 cp --cache-control max-age=900, s-maxage=60 packages/debugger/bundle/datadog-debugger.js s3://browser-agent-artifacts-prod/datadog-debugger-v7-canary.js',
env,
},
])

assert.deepEqual(getCloudfrontCommands(), [
{
command: `aws cloudfront create-invalidation --distribution-id EGB08BYCT1DD9 --paths /datadog-logs-v7-canary.js,/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/datadog-rum-v7-canary.js,/datadog-rum-slim-v7-canary.js`,
command: `aws cloudfront create-invalidation --distribution-id EGB08BYCT1DD9 --paths /datadog-logs-v7-canary.js,/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/datadog-rum-v7-canary.js,/datadog-rum-slim-v7-canary.js,/datadog-debugger-v7-canary.js`,
env,
},
])
Expand Down Expand Up @@ -267,11 +292,16 @@ describe('deploy', () => {
'aws s3 cp --cache-control max-age=900, s-maxage=60 packages/rum-slim/bundle/datadog-rum-slim.js s3://browser-agent-artifacts-staging/pull-request/123/datadog-rum-slim.js',
env,
},
{
command:
'aws s3 cp --cache-control max-age=900, s-maxage=60 packages/debugger/bundle/datadog-debugger.js s3://browser-agent-artifacts-staging/pull-request/123/datadog-debugger.js',
env,
},
])

assert.deepEqual(getCloudfrontCommands(), [
{
command: `aws cloudfront create-invalidation --distribution-id E2FP11ZSCFD3EU --paths /pull-request/123/datadog-logs.js,/pull-request/123/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/pull-request/123/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/pull-request/123/datadog-rum.js,/pull-request/123/datadog-rum-slim.js`,
command: `aws cloudfront create-invalidation --distribution-id E2FP11ZSCFD3EU --paths /pull-request/123/datadog-logs.js,/pull-request/123/chunks/datadogProfiler-${FAKE_CHUNK_HASH}-datadog-rum.js,/pull-request/123/chunks/datadogRecorder-${FAKE_CHUNK_HASH}-datadog-rum.js,/pull-request/123/datadog-rum.js,/pull-request/123/datadog-rum-slim.js,/pull-request/123/datadog-debugger.js`,
env,
},
])
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy/lib/deploymentUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const packages: Package[] = [
{ packageName: 'logs', service: 'browser-logs-sdk' },
{ packageName: 'rum', service: 'browser-rum-sdk' },
{ packageName: 'rum-slim', service: 'browser-rum-sdk' },
{ packageName: 'debugger', service: 'browser-debugger-sdk' },
]

// ex: datadog-rum-v4.js, chunks/datadogRecorder-8d8a8dfab6958424038f-datadog-rum.js
Expand Down
84 changes: 84 additions & 0 deletions scripts/deploy/upload-source-maps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ describe('upload-source-maps', () => {
command:
'mv packages/rum-slim/bundle/datadog-rum-slim.js.map packages/rum-slim/bundle/datadog-rum-slim-v6.js.map',
},
{
command: 'mv packages/debugger/bundle/datadog-debugger.js packages/debugger/bundle/datadog-debugger-v6.js',
},
{
command:
'mv packages/debugger/bundle/datadog-debugger.js.map packages/debugger/bundle/datadog-debugger-v6.js.map',
},
])

// upload the source maps
Expand All @@ -131,6 +138,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env,
},
])
})

Expand All @@ -151,6 +163,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
])
})

Expand All @@ -173,6 +190,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix /us1/v6 --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix /us1/v6 --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_PROD,
},
])

assert.deepEqual(getOrg2SourceMapCommands(), [
Expand All @@ -191,6 +213,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net/us1/v6 --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net/us1/v6 --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
])
})

Expand Down Expand Up @@ -218,6 +245,13 @@ describe('upload-source-maps', () => {
command:
'mv packages/rum-slim/bundle/datadog-rum-slim.js.map packages/rum-slim/bundle/datadog-rum-slim-staging.js.map',
},
{
command: 'mv packages/debugger/bundle/datadog-debugger.js packages/debugger/bundle/datadog-debugger-staging.js',
},
{
command:
'mv packages/debugger/bundle/datadog-debugger.js.map packages/debugger/bundle/datadog-debugger-staging.js.map',
},
])

// upload the source maps
Expand Down Expand Up @@ -252,6 +286,16 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_STAGING,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_PROD,
},
])

assert.deepEqual(getOrg2SourceMapCommands(), [
Expand All @@ -270,6 +314,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
])
})

Expand Down Expand Up @@ -297,6 +346,13 @@ describe('upload-source-maps', () => {
command:
'mv packages/rum-slim/bundle/datadog-rum-slim.js.map packages/rum-slim/bundle/datadog-rum-slim-canary.js.map',
},
{
command: 'mv packages/debugger/bundle/datadog-debugger.js packages/debugger/bundle/datadog-debugger-canary.js',
},
{
command:
'mv packages/debugger/bundle/datadog-debugger.js.map packages/debugger/bundle/datadog-debugger-canary.js.map',
},
])

// upload the source maps only to datadoghq.com
Expand All @@ -316,6 +372,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_PROD,
},
])

assert.deepEqual(getOrg2SourceMapCommands(), [
Expand All @@ -334,6 +395,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
])
})

Expand Down Expand Up @@ -362,6 +428,14 @@ describe('upload-source-maps', () => {
command:
'mv packages/rum-slim/bundle/datadog-rum-slim.js.map packages/rum-slim/bundle/datadog-rum-slim-v7-canary.js.map',
},
{
command:
'mv packages/debugger/bundle/datadog-debugger.js packages/debugger/bundle/datadog-debugger-v7-canary.js',
},
{
command:
'mv packages/debugger/bundle/datadog-debugger.js.map packages/debugger/bundle/datadog-debugger-v7-canary.js.map',
},
])

// upload the source maps only to datadoghq.com (same as plain 'canary')
Expand All @@ -381,6 +455,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix / --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_PROD,
},
])

assert.deepEqual(getOrg2SourceMapCommands(), [
Expand All @@ -399,6 +478,11 @@ describe('upload-source-maps', () => {
'datadog-ci sourcemaps upload packages/rum-slim/bundle --service browser-rum-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net --project-path @datadog/browser-rum-slim/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
{
command:
'datadog-ci sourcemaps upload packages/debugger/bundle --service browser-debugger-sdk --release-version dev --minified-path-prefix https://d20xtzwzcl0ceb.cloudfront.net --project-path @datadog/browser-debugger/ --repository-url https://www.github.com/datadog/browser-sdk',
env: ENV_ORG2_PROD,
},
])
})
})
Loading