Skip to content

Commit 23c127a

Browse files
authored
Merge pull request #491 from reactioncommerce/release-v2.0.0-rc.9
Release v2.0.0 rc.9
2 parents c0365c2 + 44f9a49 commit 23c127a

File tree

224 files changed

+9229
-4629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+9229
-4629
lines changed

.babelrc

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"presets": [
3-
["next/babel", {
3+
[ "next/babel", {
44
"preset-env": {
5-
"modules": "commonjs",
65
"targets": {
76
"node": "current",
87
"browsers": [
@@ -11,31 +10,22 @@
1110
]
1211
}
1312
}
14-
}]
13+
} ]
14+
],
15+
"plugins": [
16+
"babel-plugin-styled-components",
17+
[ "module-resolver", { "root": [ "./src" ] } ],
18+
[ "@babel/plugin-proposal-decorators", { "legacy": true } ],
19+
[ "@babel/plugin-proposal-class-properties", { "loose": true } ]
1520
],
1621
"env": {
17-
"development": {
18-
"plugins": [
19-
"babel-plugin-styled-components",
20-
["module-resolver", {"root": ["./src", "./config"]}],
21-
"transform-decorators-legacy",
22-
"transform-class-properties"
23-
]
24-
},
25-
"production": {
26-
"plugins": [
27-
"babel-plugin-styled-components",
28-
["module-resolver", {"root": ["./src", "./config"]}],
29-
["@babel/plugin-proposal-decorators", { "legacy": true }],
30-
["@babel/plugin-proposal-class-properties", { "loose": true }]
31-
]
32-
},
3322
"jesttest": {
3423
"plugins": [
3524
"babel-plugin-styled-components",
36-
["module-resolver", {"root": ["./src", "./config"]}],
37-
["@babel/plugin-proposal-decorators", { "legacy": true }],
38-
["@babel/plugin-proposal-class-properties", { "loose": true }]
25+
[ "module-resolver", { "root": [ "./src" ] } ],
26+
[ "@babel/plugin-proposal-decorators", { "legacy": true } ],
27+
[ "@babel/plugin-proposal-class-properties", { "loose": true } ],
28+
"dynamic-import-node"
3929
]
4030
}
4131
}

.circleci/bin/ecs-deploy.sh

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,67 @@
11
#!/bin/bash
22

3-
sudo apt-get -y install python3-pip wget
3+
sudo apt-get -y install python3-pip wget jq
44
sudo pip3 install awscli
55
wget https://github.com/mikefarah/yq/releases/download/2.0.1/yq_linux_amd64 -O /tmp/yq
66
sudo mv /tmp/yq /usr/local/bin/yq
77
sudo chmod +x /usr/local/bin/yq
88

99
if [ -z "${AWS_REGION}" ]; then
10-
AWS_REGION=us-west-2
10+
AWS_REGION=us-west-2
1111
fi
1212

13-
if [ "${CLOUDFORMATION_AWS_ACCESS_KEY_ID}" ]; then
14-
AWS_ACCESS_KEY_ID=${CLOUDFORMATION_AWS_ACCESS_KEY_ID}
15-
fi
13+
ENVIRONMENT=staging
14+
SERVICE_DIR_NAME=.reaction/devops/aws/services
15+
export storefront_CIRCLE_SHA1=$CIRCLE_SHA1
1616

17-
if [ "${CLOUDFORMATION_AWS_SECRET_ACCESS_KEY}" ]; then
18-
AWS_SECRET_ACCESS_KEY=${CLOUDFORMATION_AWS_SECRET_ACCESS_KEY}
19-
fi
17+
SERVICES=$(ls ${SERVICE_DIR_NAME})
18+
19+
for SERVICE in $SERVICES; do
20+
DISABLED=$(echo $SERVICE | grep disabled)
21+
if [ "${DISABLED}" == "${SERVICE}" ]; then
22+
continue
23+
fi
24+
echo "START PROCESSING SERVICE ${SERVICE}"
25+
26+
cd ${SERVICE_DIR_NAME}/${SERVICE}
27+
28+
PROPEL_CONFIG_FILE="propel-${ENVIRONMENT}.yaml"
29+
if [ ! -f ${PROPEL_CONFIG_FILE} ]; then
30+
echo "Propel configuration file not found!"
31+
exit 1
32+
fi
33+
34+
ENV_NAME_UPPERCASE=$(echo $ENVIRONMENT | awk '{print toupper($0)}')
35+
AWS_ACCESS_KEY_ID_VAR_NAME=CLOUDFORMATION_${ENV_NAME_UPPERCASE}_AWS_ACCESS_KEY_ID
36+
AWS_SECRET_ACCESS_KEY_VAR_NAME=CLOUDFORMATION_${ENV_NAME_UPPERCASE}_AWS_SECRET_ACCESS_KEY
37+
38+
if [ "${!AWS_ACCESS_KEY_ID_VAR_NAME}" ]; then
39+
AWS_ACCESS_KEY_ID=${!AWS_ACCESS_KEY_ID_VAR_NAME}
40+
fi
41+
42+
if [ "${!AWS_SECRET_ACCESS_KEY_VAR_NAME}" ]; then
43+
AWS_SECRET_ACCESS_KEY=${!AWS_SECRET_ACCESS_KEY_VAR_NAME}
44+
fi
2045

46+
mkdir -p ~/.aws
47+
echo "[default]" > ~/.aws/credentials
48+
echo "aws_access_key_id = ${AWS_ACCESS_KEY_ID}" >> ~/.aws/credentials
49+
echo "aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" >> ~/.aws/credentials
2150

22-
mkdir ~/.aws
23-
echo "[default]" > ~/.aws/credentials
24-
echo "aws_access_key_id = ${AWS_ACCESS_KEY_ID}" >> ~/.aws/credentials
25-
echo "aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" >> ~/.aws/credentials
51+
echo "[default]" > ~/.aws/config
52+
echo "region = ${AWS_REGION}" >> ~/.aws/config
2653

27-
echo "[default]" > ~/.aws/config
28-
echo "region = ${AWS_REGION}" >> ~/.aws/config
54+
echo Running aws s3 cp s3://${S3_PROPEL_ARTIFACTS_BUCKET}/propel-linux-amd64 ./propel
55+
aws s3 cp s3://${S3_PROPEL_ARTIFACTS_BUCKET}/propel-linux-amd64 ./propel
2956

30-
aws s3 cp --recursive s3://${S3_ECS_DEPLOY_BUCKET}/staging/devops .
57+
sudo mv propel /usr/local/bin/propel
58+
sudo chmod +x /usr/local/bin/propel
3159

32-
find aws -name \*sh | xargs chmod +x
33-
cd aws/app-starterkit
34-
./update-app-stack.sh sk-service
60+
RELEASE_DESCRIPTION="CircleCI build URL: ${CIRCLE_BUILD_URL}"
61+
echo storefront_CIRCLE_SHA1=$storefront_CIRCLE_SHA1
62+
propel release create --deploy --descr "${RELEASE_DESCRIPTION}" -f ${PROPEL_CONFIG_FILE}
63+
64+
echo "END PROCESSING SERVICE ${SERVICE}"
65+
66+
cd -
67+
done

.circleci/config.yml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,6 @@ jobs:
197197
--name reactionapp_next_starterkit \
198198
"$DOCKER_REPOSITORY:$CIRCLE_SHA1" \
199199
yarn run test:ci
200-
- run:
201-
name: Integration Test
202-
command: |
203-
docker run \
204-
--env-file docker-cache/.env \
205-
--name reactionapp_next_starterkit_int \
206-
"$DOCKER_REPOSITORY:$CIRCLE_SHA1" \
207-
yarn run test:integration
208-
# - run:
209-
# name: Install Broken Link Checker
210-
# command: |
211-
# yarn add broken-link-checker
212-
# - run:
213-
# name: Broken Link Test
214-
# command: |
215-
# ./node_modules/.bin/blc ${STAGING_URL} -ro -filter=3 -e
216200
- run:
217201
name: Copy test artifacts from Remote Docker
218202
command: |
@@ -224,6 +208,29 @@ jobs:
224208
- store_artifacts:
225209
path: reports
226210

211+
e2e-test:
212+
<<: *defaults
213+
steps:
214+
- setup_remote_docker
215+
- attach_workspace:
216+
at: docker-cache
217+
- run:
218+
name: Load Docker Image
219+
command: |
220+
docker load < docker-cache/docker-image.tar
221+
- run:
222+
name: Integration Test
223+
command: |
224+
docker run -e URL=${STAGING_URL} --env-file docker-cache/.env --name reaction_app_next_starterkit "$DOCKER_REPOSITORY:$CIRCLE_SHA1" yarn run test:integration
225+
- run:
226+
name: Install Broken Link Checker
227+
command: |
228+
yarn add broken-link-checker
229+
- run:
230+
name: Broken Link Test
231+
command: |
232+
./node_modules/.bin/blc ${STAGING_URL} -ro -filter=3 -e
233+
227234
snyk-security:
228235
<<: *defaults
229236
steps:
@@ -278,4 +285,8 @@ workflows:
278285
- docker-push
279286
filters:
280287
branches:
281-
only: /^master$/
288+
only: /^develop$/
289+
- e2e-test:
290+
requires:
291+
- deploy-to-ecs
292+

.env.example

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
NODE_ENV=development
2-
INTERNAL_GRAPHQL_URL=http://reaction.api.reaction.localhost:3000/graphql-alpha
1+
CANONICAL_URL=http://localhost:4000
2+
ENABLE_SPA_ROUTING=true
33
EXTERNAL_GRAPHQL_URL=http://localhost:3000/graphql-alpha
4-
FAVICON_URL=https://assets.reactioncommerce.com/favicon
5-
PLACEHOLDER_IMAGE_URL_GALLERY=/resources/placeholder.gif
6-
PLACEHOLDER_IMAGE_URL_GRID=/resources/placeholder.gif
7-
SEGMENT_ANALYTICS_SKIP_MINIMIZE=true
8-
SEGMENT_ANALYTICS_WRITE_KEY=ENTER_KEY_HERE
9-
KEYCLOAK_REALM=default
10-
KEYCLOAK_CLIENT_ID=reaction-next-starterkit
11-
KEYCLOAK_URL=http://localhost:8080/auth
12-
KEYCLOAK_REDIRECT_URI=http://localhost:4000/auth
13-
STRIPE_PUBLIC_API_KEY=ENTER_STRIPE_PUBLIC_KEY_HERE
4+
INTERNAL_GRAPHQL_URL=http://reaction.api.reaction.localhost:3000/graphql-alpha
5+
NODE_ENV=development
6+
OAUTH2_ADMIN_PORT=4445
147
OAUTH2_AUTH_URL=http://localhost:4444/oauth2/auth
15-
OAUTH2_TOKEN_URL=http://hydra:4444/oauth2/token
168
OAUTH2_CLIENT_ID=reaction-next-starterkit
179
OAUTH2_CLIENT_SECRET=CHANGEME
10+
OAUTH2_HOST=hydra.auth.reaction.localhost
11+
OAUTH2_IDP_HOST_URL=http://reaction.api.reaction.localhost:3000/
1812
OAUTH2_REDIRECT_URL=http://localhost:4000/callback
19-
PASSPORT_SESSION_SECRET=CHANGEME
20-
CANONICAL_URL=http://example.com
13+
OAUTH2_TOKEN_URL=http://hydra.auth.reaction.localhost:4444/oauth2/token
14+
PORT=4000
15+
SEGMENT_ANALYTICS_SKIP_MINIMIZE=true
16+
SEGMENT_ANALYTICS_WRITE_KEY=ENTER_KEY_HERE
17+
SESSION_MAX_AGE_MS=2592000000
18+
SESSION_SECRET=CHANGEME
19+
STRIPE_PUBLIC_API_KEY=ENTER_STRIPE_PUBLIC_KEY_HERE

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
build/*
2+
node_modules/*
13
reports/*

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
.vscode
44
.idea
55
.c9
6-
.env
6+
.env*
7+
!.env.example*
78
*.csv
89
*.dat
910
*.gz

.graphqlrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"request": {
3-
"url": "http://localhost:3030/graphql-alpha"
3+
"url": "http://localhost:3000/graphql-alpha"
44
}
55
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
environment:
2+
name: staging
3+
service:
4+
name: sk-storefront
5+
cluster: core
6+
certificate_arn: arn:aws:acm:us-west-2:773713188930:certificate/c2979a7a-7b84-43ed-b3a7-24b0256a1b9f
7+
root_domain: staging.reactioncommerce.com
8+
dns_name: storefront
9+
desired_task_count: 1
10+
min_task_count: 0
11+
max_task_count: 8
12+
min_healthy_percent: 100
13+
max_percent: 200
14+
alb_listener_port: 80
15+
alb_listener_path: /
16+
alb_health_check_path: /
17+
task-definition:
18+
name: staging-storefront
19+
containers:
20+
- name: storefront
21+
cpu: 500
22+
memory: 1800
23+
port_mappings:
24+
- container_port: 4000
25+
host_port: 4000
26+
image: reactioncommerce/reaction-next-starterkit
27+
image_tag: develop
28+
env_params:
29+
- name: INTERNAL_GRAPHQL_URL
30+
- name: EXTERNAL_GRAPHQL_URL
31+
- name: FAVICON_URL
32+
- name: PLACEHOLDER_IMAGE_URL_GALLERY
33+
- name: PLACEHOLDER_IMAGE_URL_GRID
34+
- name: SEGMENT_ANALYTICS_SKIP_MINIMIZE
35+
- name: SEGMENT_ANALYTICS_WRITE_KEY
36+
- name: STRIPE_PUBLIC_API_KEY
37+
- name: OAUTH2_AUTH_URL
38+
- name: OAUTH2_TOKEN_URL
39+
- name: OAUTH2_CLIENT_ID
40+
- name: OAUTH2_CLIENT_SECRET
41+
- name: OAUTH2_REDIRECT_URL
42+
- name: PASSPORT_SESSION_SECRET
43+
- name: CANONICAL_URL

.snyk

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,8 @@
22
version: v1.12.0
33
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
44
ignore:
5-
'npm:braces:20180219':
6-
- '*':
7-
reason: Waiting for Next.js 6 to update to Babel 7 beta.47 (https://github.com/babel/babel/issues/8034)
8-
expires: 2018-09-30T00:00:00.000Z
95
'npm:chownr:20180731':
106
- '*':
11-
reason: Waiting on next-routes(https://github.com/fridays/next-routes) to fix this vulnerability
12-
expires: 2018-09-30T00:00:00.000Z
13-
'npm:mem:20180117':
14-
- '*':
15-
reason: Waiting on next-routes(https://github.com/fridays/next-routes) to fix this vulnerability
16-
expires: 2018-09-30T00:00:00.000Z
7+
reason: This vulnerability only affects packages used in development, such as webpack, more details at https://github.com/isaacs/chownr/issues/14#issuecomment-421662375
8+
expires: 2019-01-31T00:00:00.000Z
179
patch: {}

0 commit comments

Comments
 (0)