Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 41a0758

Browse files
committed
Add staging environment support
1 parent db61e07 commit 41a0758

File tree

9 files changed

+122
-24
lines changed

9 files changed

+122
-24
lines changed

api_server/docs/pubnub.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
We currently have a demo subscription
1+
# Pubnub Integration
22

3-
https://admin.pubnub.com
3+
CodeStream uses the [Pubnub](https://pubnub.com) service for real-time broadcast
4+
message.
45

5-
6-
password: CS!R0cks
6+
Ideally, each CodeStream environment should use its own set of pubnub keys to
7+
guard against any cross-contamination but this is not absolutely required.
78

8-
publish key: pub-c-8603fed4-39da-4feb-a82e-cf5311ddb4d6
9-
subscribe key: sub-c-e830d7da-fb14-11e6-9f57-02ee2ddab7fe
10-
secret: sec-c-MmU3MmNlOGQtNjNhYS00NTk1LWI3NDItZDZlMjk3NmJkMDVh
9+
When generating a new keyset, apply the following Configuration settings to it.
10+
11+
* Presence: On
12+
- Announce Max: 100
13+
- Interval: 10
14+
- Presence Deltas: yes
15+
- Generate Leave on TCP FIN or RST: no
16+
- Stream Filtering: yes
17+
- Debounce: 2
18+
- leave all other fields blank
19+
20+
* Storage & Playback: On
21+
- Retention: 30 day
22+
- leave all other fields blank
23+
24+
* Access Manager: On
25+
26+
Leave all other configuration sections Off.

api_server/sandbox/stg.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
# production
3+
[ -z "$CS_API_ASSET_ENV" ] && export CS_API_ASSET_ENV=dev
4+
export CSSVC_ENV=stg
5+
export CSSVC_CONFIGURATION=codestream-cloud
6+
. $CS_API_TOP/sandbox/defaults.sh
7+
unset CS_API_SETUP_MONGO && echo "mongo setup is disabled"
8+
export CS_API_INIT_FAIL_MSG="sigkill did not stop the api service"
9+
export CS_API_INIT_STOP_OPTS=useForce

inbound_email/sandbox/prod.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ export CSSVC_ENV=prod
55
export CSSVC_CONFIGURATION=codestream-cloud
66
. $CS_MAILIN_TOP/sandbox/defaults.sh || return 1
77

8-
# involve the system mailer in mailin service init actions
98
# involve the system mailer in mailin service init actions
109
export CS_MAILIN_MAIL_SERVICE_INIT=1

inbound_email/sandbox/stg.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
# Staging
3+
[ -z "$CS_MAILIN_ASSET_ENV" ] && export CS_MAILIN_ASSET_ENV=dev
4+
export CSSVC_ENV=stg
5+
export CSSVC_CONFIGURATION=codestream-cloud
6+
. $CS_MAILIN_TOP/sandbox/defaults.sh || return 1
7+
8+
# involve the system mailer in mailin service init actions
9+
export CS_MAILIN_MAIL_SERVICE_INIT=1

outbound_email/sandbox/lambda-configs/lambda-defaults.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ fi
2525

2626
[ -z "$CS_OUTBOUND_EMAIL_LAMBDA_TEMPLATE" ] && export CS_OUTBOUND_EMAIL_LAMBDA_TEMPLATE=lambda-func.generic.template.json
2727
[ -z "$CS_OUTBOUND_EMAIL_LAMBDA_RUNTIME" ] && export CS_OUTBOUND_EMAIL_LAMBDA_RUNTIME="nodejs12.x"
28-
[ -z "$CS_OUTBOUND_EMAIL_AWS_ACCOUNT" ] && export CS_OUTBOUND_EMAIL_AWS_ACCOUNT=564564469595
28+
[ -z "$CS_OUTBOUND_EMAIL_AWS_ACCOUNT" ] && export CS_OUTBOUND_EMAIL_AWS_ACCOUNT=$(dt-rm --property accountNumber --no-session-log)
2929
[ -z "$CS_OUTBOUND_EMAIL_LAMBDA_IAM_ROLE" ] && export CS_OUTBOUND_EMAIL_LAMBDA_IAM_ROLE=cs_LambdaDevelopment
3030
[ -z "$CS_OUTBOUND_EMAIL_LAMBDA_DESCRIPTION" ] && export CS_OUTBOUND_EMAIL_LAMBDA_DESCRIPTION="outbound email gateway for $CS_OUTBOUND_EMAIL_ENV"
3131
#export CS_OUTBOUND_EMAIL_LAMBDA_SUBNETS=
3232
#export CS_OUTBOUND_EMAIL_LAMBDA_SECURITY_GROUPS=
3333

34-
[ -z "$CS_OUTBOUND_EMAIL_SNS_TOPIC_ARN" ] && export CS_OUTBOUND_EMAIL_SNS_TOPIC_ARN="arn:aws:sns:us-east-1:$CS_OUTBOUND_EMAIL_AWS_ACCOUNT:dev_UnprocessedOutboundEmailEvents"
35-
[ -z "$CS_OUTBOUND_EMAIL_SQS_ARN" ] && export CS_OUTBOUND_EMAIL_SQS_ARN="arn:aws:sqs:us-east-1:$CS_OUTBOUND_EMAIL_AWS_ACCOUNT:$CS_OUTBOUND_EMAIL_SQS"
34+
CS_OUTBOUND_EMAIL_LAMBDA_REGION=$(dt-rm --network default --property region)
35+
[ -z "$CS_OUTBOUND_EMAIL_SNS_TOPIC_ARN" ] && export CS_OUTBOUND_EMAIL_SNS_TOPIC_ARN="arn:aws:sns:$CS_OUTBOUND_EMAIL_LAMBDA_REGION:$CS_OUTBOUND_EMAIL_AWS_ACCOUNT:dev_UnprocessedOutboundEmailEvents"
36+
[ -z "$CS_OUTBOUND_EMAIL_SQS_ARN" ] && export CS_OUTBOUND_EMAIL_SQS_ARN="arn:aws:sqs:$CS_OUTBOUND_EMAIL_LAMBDA_REGION:$CS_OUTBOUND_EMAIL_AWS_ACCOUNT:$CS_OUTBOUND_EMAIL_SQS"
3637

3738
if [ -z "$CS_OUTBOUND_EMAIL_LAMBDA_ENV_FILE" ]; then
3839
[ ! -f $CS_OUTBOUND_EMAIL_TOP/sandbox/lambda-configs/$CS_OUTBOUND_EMAIL_ENV.sh ] && CS_OUTBOUND_EMAIL_LAMBDA_ENV_FILE=dev.sh || CS_OUTBOUND_EMAIL_LAMBDA_ENV_FILE=$CS_OUTBOUND_EMAIL_ENV.sh
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
export CS_OUTBOUND_EMAIL_LAMBDA_IAM_ROLE=cs_${CSSVC_ENV}_mailout_lambda
3+
export CS_OUTBOUND_EMAIL_LAMBDA_SUBNETS=$(dt-aws-vpc --subnet-names csdev_${CSSVC_ENV}_priv1b,csdev_${CSSVC_ENV}_priv1c,csdev_${CSSVC_ENV}_priv1d --to-id --format csv)
4+
export CS_OUTBOUND_EMAIL_LAMBDA_SECURITY_GROUPS=$(dt-aws-sg --sg-names csdev_${CSSVC_ENV}_mailout --to-id --format csv)

outbound_email/sandbox/stg.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# use for the staging environment env
3+
[ -z "$CS_OUTBOUND_EMAIL_ASSET_ENV" ] && export CS_OUTBOUND_EMAIL_ASSET_ENV=dev
4+
export CSSVC_ENV=stg
5+
export CSSVC_CONFIGURATION=codestream-cloud
6+
. $CS_OUTBOUND_EMAIL_TOP/sandbox/defaults.sh

shared/codestream_configs/bin/update-all-configs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ function usage {
66
echo -e "usage: $0 [-fyv] [-e <env-list>]
77
88
use -f to force execution with default settings
9-
default environment list: local ci pi pd qa prod dev nr
9+
default environment list: $environmentList
1010
"
1111
exit 1
1212
}
1313

1414
[ -z "$KM_SECRETS" ] && echo "Set KM_SECRETS to the location of the PKI database (use -y to bypass prompts)" && exit 1
15+
16+
environmentList="local ci pi pd qa prod dev nr stg"
1517
[ -z "$1" ] && usage
1618
yes=""
1719
verbose=""
1820
force=0
19-
environmentList="local ci pi pd qa prod dev nr"
2021
#onpremInstallDir=""
2122
while getopts "yvfe:" arg
2223
do

shared/codestream_configs/profiles/cloud.json

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@
5555
"phoneHomeUrl": null,
5656
"port": 8443,
5757
"publicApiUrl": "https://qa-api.codestream.us"
58+
},
59+
"stg": {
60+
"authOrigin": null,
61+
"helpIsAvailable": true,
62+
"logger": {
63+
"consoleOk": false
64+
},
65+
"marketingSiteUrl": "https://www.codestream.com",
66+
"phoneHomeUrl": null,
67+
"port": 8443,
68+
"publicApiUrl": "https://stg-api.codestream.us",
69+
"requireTLS12": true
5870
}
5971
},
6072
"broadcastEngine": {
@@ -76,6 +88,9 @@
7688
},
7789
"qa": {
7890
"_loadSecretsFile": "pubnub/qa.cfg"
91+
},
92+
"stg": {
93+
"_loadSecretsFile": "pubnub/stg.cfg"
7994
}
8095
}
8196
},
@@ -106,6 +121,9 @@
106121
},
107122
"qa": {
108123
"_loadSecretsFile": "sendgrid/qa.cfg"
124+
},
125+
"stg": {
126+
"_loadSecretsFile": "sendgrid/stg.cfg"
109127
}
110128
}
111129
},
@@ -121,6 +139,12 @@
121139
},
122140
"qa": {
123141
"inboundEmailDirectory": "${HOME}/codestream-mail/inbound/web/new"
142+
},
143+
"stg": {
144+
"inboundEmailDirectory": "${HOME}/codestream-mail/inbound/web/new",
145+
"logger": {
146+
"consoleOk": false
147+
}
124148
}
125149
},
126150
"integrations": {
@@ -131,7 +155,8 @@
131155
},
132156
"prod": {
133157
"_loadSecretsFile": "asana/prod.cfg"
134-
}
158+
},
159+
"stg": {}
135160
}
136161
},
137162
"bitbucket": {
@@ -141,7 +166,8 @@
141166
},
142167
"prod": {
143168
"_loadSecretsFile": "bitbucket/prod.cfg"
144-
}
169+
},
170+
"stg": {}
145171
}
146172
},
147173
"devops": {
@@ -154,7 +180,8 @@
154180
},
155181
"qa": {
156182
"_loadSecretsFile": "microsoft/devops-qa.cfg"
157-
}
183+
},
184+
"stg": {}
158185
}
159186
},
160187
"github": {
@@ -164,7 +191,8 @@
164191
},
165192
"prod": {
166193
"_loadSecretsFile": "github/prod.cfg"
167-
}
194+
},
195+
"stg": {}
168196
}
169197
},
170198
"gitlab": {
@@ -174,7 +202,8 @@
174202
},
175203
"prod": {
176204
"_loadSecretsFile": "gitlab/prod.cfg"
177-
}
205+
},
206+
"stg": {}
178207
}
179208
},
180209
"jira": {
@@ -184,7 +213,8 @@
184213
},
185214
"prod": {
186215
"_loadSecretsFile": "atlassian/prod.cfg"
187-
}
216+
},
217+
"stg": {}
188218
}
189219
},
190220
"linear": {
@@ -197,7 +227,8 @@
197227
},
198228
"qa": {
199229
"_loadSecretsFile": "linear/qa.cfg"
200-
}
230+
},
231+
"stg": {}
201232
}
202233
},
203234
"msteams": {
@@ -213,7 +244,8 @@
213244
},
214245
"qa": {
215246
"_loadSecretsFile": "microsoft/teams-qa.cfg"
216-
}
247+
},
248+
"stg": {}
217249
}
218250
},
219251
"okta": {
@@ -244,7 +276,8 @@
244276
"qa": {
245277
"_loadSecretsFile": "slack/qa-combined.cfg",
246278
"interactiveComponentsEnabled": true
247-
}
279+
},
280+
"stg": {}
248281
}
249282
},
250283
"trello": {
@@ -284,7 +317,8 @@
284317
},
285318
"pi": {},
286319
"prod": {},
287-
"qa": {}
320+
"qa": {},
321+
"stg": {}
288322
},
289323
"payments": {
290324
"stripe": {
@@ -293,7 +327,8 @@
293327
},
294328
"prod": {
295329
"_loadSecretsFile": "stripe/prod.cfg"
296-
}
330+
},
331+
"stg": {}
297332
}
298333
},
299334
"queuingEngine": {
@@ -316,6 +351,9 @@
316351
},
317352
"qa": {
318353
"outboundEmailQueueName": "qa_outboundEmail"
354+
},
355+
"stg": {
356+
"outboundEmailQueueName": "stg_outboundEmail"
319357
}
320358
}
321359
},
@@ -335,6 +373,9 @@
335373
},
336374
"qa": {
337375
"runTimeEnvironment": "qa"
376+
},
377+
"stg": {
378+
"runTimeEnvironment": "stg"
338379
}
339380
},
340381
"sharedSecrets": {
@@ -352,6 +393,9 @@
352393
},
353394
"qa": {
354395
"_loadSecretsFile": "codestream/qa-secrets.cfg"
396+
},
397+
"stg": {
398+
"_loadSecretsFile": "codestream/stg-secrets.cfg"
355399
}
356400
},
357401
"ssl": {
@@ -381,6 +425,9 @@
381425
},
382426
"qa": {
383427
"_loadSecretsFile": "mongo/qa.cfg"
428+
},
429+
"stg": {
430+
"_loadSecretsFile": "mongo/stg.cfg"
384431
}
385432
}
386433
},
@@ -413,6 +460,12 @@
413460
"keyPrefix": "usercontent",
414461
"publicUrl": "https://usercontent.codestream.com",
415462
"stripKeyPrefixFromUrl": true
463+
},
464+
"stg": {
465+
"bucket": "codestream-stg-usercontent",
466+
"keyPrefix": "usercontent",
467+
"publicUrl": "https://stg-usercontent.codestream.us",
468+
"stripKeyPrefixFromUrl": true
416469
}
417470
}
418471
}

0 commit comments

Comments
 (0)