Skip to content

Commit 2cfbc90

Browse files
kaihendrynbiton
authored andcommitted
Helper to set developers using https://dashboard.dev.unee-t.com/ as their backend (#638)
1 parent 6a539e3 commit 2cfbc90

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

env-setup.bash

+28-3
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,43 @@ ssm() {
1010
echo $(aws --profile uneet-dev ssm get-parameters --names $1 --with-decryption --query Parameters[0].Value --output text)
1111
}
1212

13+
setuplocal() {
14+
cat << EOF >> .env
15+
APIENROLL_LAMBDA_URL=http://localhost:4000
16+
INVITE_LAMBDA_URL=http://localhost:9000
17+
UNIT_CREATE_LAMBDA_URL=http://localhost:4001/create
18+
EOF
19+
}
20+
1321
cat << EOF > .env
1422
BUGZILLA_ADMIN_KEY=$(ssm BUGZILLA_ADMIN_KEY)
1523
MAIL_URL=smtps://$(ssm SES_SMTP_USERNAME):$(ssm SES_SMTP_PASSWORD)@email-smtp.us-west-2.amazonaws.com:465
1624
CLOUDINARY_URL=https://api.cloudinary.com/v1_1/unee-t-staging/image/upload
1725
CLOUDINARY_PRESET=$(ssm CLOUDINARY_PRESET)
1826
API_ACCESS_TOKEN=$(ssm API_ACCESS_TOKEN)
1927
FROM_EMAIL="Local Unee-T Case <[email protected]>"
20-
APIENROLL_LAMBDA_URL=http://localhost:4000
21-
INVITE_LAMBDA_URL=http://localhost:9000
22-
UNIT_CREATE_LAMBDA_URL=http://localhost:4001/create
2328
STAGE=dev
2429
DOMAIN=unee-t.com
2530
PDFGEN_LAMBDA_URL=https://pdfgen.dev.unee-t.com
2631
PDFCONVERT_LAMBDA_URL=https://prince.dev.unee-t.com
2732
EOF
33+
34+
if ! curl -s localhost:8081
35+
then
36+
read -p "https://github.com/unee-t/bugzilla-customisation not running, use https://dashboard.dev.unee-t.com/ ?" -n 1 -r
37+
echo # (optional) move to a new line
38+
if [[ $REPLY =~ ^[Yy]$ ]]
39+
then
40+
cat << EOF >> .env
41+
APIENROLL_LAMBDA_URL=https://apienroll.dev.unee-t.com
42+
INVITE_LAMBDA_URL=https://invite.dev.unee-t.com
43+
UNIT_CREATE_LAMBDA_URL=https://unit.dev.unee-t.com/create
44+
BUGZILLA_URL=https://dashboard.dev.unee-t.com/
45+
EOF
46+
else
47+
echo Setting up for local https://github.com/unee-t/bugzilla-customisation
48+
setuplocal
49+
fi
50+
else
51+
setuplocal
52+
fi

0 commit comments

Comments
 (0)