-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy release branches to staging ECS environment #4758
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5496912
use container list instead of a single container in propel service ma…
griggheo 7431800
use container list instead of a single container in propel service ma…
griggheo 63be5cd
deploy to ECS on any branch starting with *release* (still commented …
griggheo 8c503a0
use a single propel.yaml file
griggheo e06279f
Merge branch 'release-2.0.0-rc.6' into propel-ecs-multiple-containers
griggheo 0a4182d
use proper CIRCLE_SHA1 variable
griggheo 6bf6460
put back filter for only deploying to ECS for release branches
griggheo 9d719e6
different ECS deployment scripts and propel manifests for release bra…
griggheo 2c8fb02
example ENV variables
griggheo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
sudo apt-get -y install python3-pip wget | ||
sudo pip3 install awscli | ||
|
||
export ENVIRONMENT=feat | ||
export CLUSTER=core | ||
export SERVICE_SUFFIX=$CIRCLE_BRANCH | ||
export SERVICE1=reaction-core | ||
export CONTAINER1=core | ||
export core_CIRCLE_SHA1=$CIRCLE_SHA1 | ||
|
||
PROPEL_CONFIG_FILE="propel-feat.yaml" | ||
if [ ! -f ${PROPEL_CONFIG_FILE} ]; then | ||
echo "Propel configuration file not found!" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${AWS_REGION}" ]; then | ||
export AWS_REGION=us-west-2 | ||
fi | ||
|
||
ENV_NAME_UPPERCASE=$(echo $ENVIRONMENT | awk '{print toupper($0)}') | ||
AWS_ACCESS_KEY_ID_VAR_NAME=CLOUDFORMATION_${ENV_NAME_UPPERCASE}_AWS_ACCESS_KEY_ID | ||
AWS_SECRET_ACCESS_KEY_VAR_NAME=CLOUDFORMATION_${ENV_NAME_UPPERCASE}_AWS_SECRET_ACCESS_KEY | ||
|
||
if [ "${!AWS_ACCESS_KEY_ID_VAR_NAME}" ]; then | ||
export AWS_ACCESS_KEY_ID=${!AWS_ACCESS_KEY_ID_VAR_NAME} | ||
fi | ||
|
||
if [ "${!AWS_SECRET_ACCESS_KEY_VAR_NAME}" ]; then | ||
export AWS_SECRET_ACCESS_KEY=${!AWS_SECRET_ACCESS_KEY_VAR_NAME} | ||
fi | ||
|
||
echo Running aws s3 cp s3://${S3_PROPEL_ARTIFACTS_BUCKET}/propel-linux-amd64 ./propel | ||
aws s3 cp s3://${S3_PROPEL_ARTIFACTS_BUCKET}/propel-linux-amd64 ./propel | ||
|
||
sudo mv propel /usr/local/bin/propel | ||
sudo chmod +x /usr/local/bin/propel | ||
|
||
RELEASE_DESCRIPTION="CircleCI build URL: ${CIRCLE_BUILD_URL}" | ||
propel param copy -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --service $SERVICE1 --container $CONTAINER1 --suffix $SERVICE_SUFFIX --overwrite | ||
propel param set ROOT_URL=https://${SERVICE1}-${SERVICE_SUFFIX}.$ENVIRONMENT.reactioncommerce.com/ -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --service $SERVICE1 --container $CONTAINER1 --suffix $SERVICE_SUFFIX --overwrite | ||
propel release create --deploy -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --descr "${RELEASE_DESCRIPTION}" --service $SERVICE1 --suffix $SERVICE_SUFFIX | ||
|
||
export SERVICE2=storefront | ||
export CONTAINER2=storefront | ||
propel param copy -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --service $SERVICE2 --container $CONTAINER2 --suffix $SERVICE_SUFFIX --overwrite | ||
propel param set CANONICAL_URL=https://${SERVICE1}-${SERVICE_SUFFIX}.$ENVIRONMENT.reactioncommerce.com -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --service $SERVICE2 --container $CONTAINER2 --suffix $SERVICE_SUFFIX --overwrite | ||
propel param set OAUTH2_REDIRECT_URL=https://${SERVICE2}-${SERVICE_SUFFIX}.$ENVIRONMENT.reactioncommerce.com/callback -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --service $SERVICE2 --container $CONTAINER2 --suffix $SERVICE_SUFFIX --overwrite | ||
propel param set OAUTH2_IDP_HOST_URL=https://${SERVICE1}-${SERVICE_SUFFIX}.$ENVIRONMENT.reactioncommerce.com -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --service $SERVICE2 --container $CONTAINER2 --suffix $SERVICE_SUFFIX --overwrite | ||
propel param set EXTERNAL_GRAPHQL_URL=https://${SERVICE1}-${SERVICE_SUFFIX}.$ENVIRONMENT.reactioncommerce.com/graphql-alpha -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --service $SERVICE2 --container $CONTAINER2 --suffix $SERVICE_SUFFIX --overwrite | ||
propel param set INTERNAL_GRAPHQL_URL=https://${SERVICE1}-${SERVICE_SUFFIX}.$ENVIRONMENT.reactioncommerce.com/graphql-alpha -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --service $SERVICE2 --container $CONTAINER2 --suffix $SERVICE_SUFFIX --overwrite | ||
propel release create --deploy -f ${PROPEL_CONFIG_FILE} --env $ENVIRONMENT --cluster $CLUSTER --descr "${RELEASE_DESCRIPTION}" --service $SERVICE2 --suffix $SERVICE_SUFFIX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
sudo apt-get -y install python3-pip wget | ||
sudo pip3 install awscli | ||
|
||
export ENVIRONMENT=staging | ||
export CLUSTER=core | ||
export core_CIRCLE_SHA1=$CIRCLE_SHA1 | ||
|
||
PROPEL_CONFIG_FILE="propel.yaml" | ||
if [ ! -f ${PROPEL_CONFIG_FILE} ]; then | ||
echo "Propel configuration file not found!" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${AWS_REGION}" ]; then | ||
export AWS_REGION=us-west-2 | ||
fi | ||
|
||
ENV_NAME_UPPERCASE=$(echo $ENVIRONMENT | awk '{print toupper($0)}') | ||
AWS_ACCESS_KEY_ID_VAR_NAME=CLOUDFORMATION_${ENV_NAME_UPPERCASE}_AWS_ACCESS_KEY_ID | ||
AWS_SECRET_ACCESS_KEY_VAR_NAME=CLOUDFORMATION_${ENV_NAME_UPPERCASE}_AWS_SECRET_ACCESS_KEY | ||
|
||
if [ "${!AWS_ACCESS_KEY_ID_VAR_NAME}" ]; then | ||
export AWS_ACCESS_KEY_ID=${!AWS_ACCESS_KEY_ID_VAR_NAME} | ||
fi | ||
|
||
if [ "${!AWS_SECRET_ACCESS_KEY_VAR_NAME}" ]; then | ||
export AWS_SECRET_ACCESS_KEY=${!AWS_SECRET_ACCESS_KEY_VAR_NAME} | ||
fi | ||
|
||
echo Running aws s3 cp s3://${S3_PROPEL_ARTIFACTS_BUCKET}/propel-linux-amd64 ./propel | ||
aws s3 cp s3://${S3_PROPEL_ARTIFACTS_BUCKET}/propel-linux-amd64 ./propel | ||
|
||
sudo mv propel /usr/local/bin/propel | ||
sudo chmod +x /usr/local/bin/propel | ||
|
||
RELEASE_DESCRIPTION="CircleCI build URL: ${CIRCLE_BUILD_URL}" | ||
propel release create --deploy --env $ENVIRONMENT --cluster $CLUSTER --descr "${RELEASE_DESCRIPTION}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
REACTION_EMAIL=me@example.com | ||
REACTION_AUTH=somepassword | ||
REACTION_USER=ReactionAdmin | ||
MONGO_URL=mongodb://mongo:27017/reaction | ||
MONGO_OPLOG_URL=mongodb://mongo:27017/local | ||
ROOT_URL=http://localhost:3000 | ||
HYDRA_ADMIN_URL=http://hydra:4445 | ||
HYDRA_TOKEN_URL=http://hydra:4444/oauth2/token | ||
HYDRA_OAUTH2_INTROSPECT_URL=http://hydra:4445/oauth2/introspect | ||
OAUTH2_CLIENT_DOMAINS=http://localhost:4000 | ||
SKIP_FIXTURES=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
.fileStorage/ | ||
.vscode | ||
.idea | ||
.env | ||
.env* | ||
!.env.example | ||
.c9 | ||
*.csv | ||
*.dat | ||
|
33 changes: 0 additions & 33 deletions
33
.reaction/devops/aws/services/service-reaction/propel-staging.yaml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
.reaction/devops/aws/services/service-starterkit/propel-staging.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
services: | ||
- name: reaction-core | ||
certificate_arn: arn:aws:acm:us-west-2:773713188930:certificate/c2979a7a-7b84-43ed-b3a7-24b0256a1b9f | ||
root_domain: staging.reactioncommerce.com | ||
dns_name: reaction-core | ||
desired_task_count: 2 | ||
min_task_count: 0 | ||
max_task_count: 2 | ||
min_healthy_percent: 100 | ||
max_percent: 200 | ||
alb_listener_port: 80 | ||
alb_listener_path: / | ||
alb_health_check_path: /health | ||
task-definition: | ||
name: staging-core | ||
containers: | ||
- name: core | ||
cpu: 500 | ||
memory: 1800 | ||
port_mappings: | ||
- container_port: 3000 | ||
host_port: 3000 | ||
image: reactioncommerce/reaction | ||
image_tag: release-2.0.0-rc.5 | ||
env_params: | ||
- name: REACTION_AUTH | ||
- name: REACTION_EMAIL | ||
- name: REACTION_USER | ||
- name: MONGO_URL | ||
- name: ROOT_URL | ||
- name: HYDRA_ADMIN_URL | ||
- name: HYDRA_OAUTH2_INTROSPECT_URL | ||
- name: SKIP_FIXTURES | ||
- name: storefront | ||
certificate_arn: arn:aws:acm:us-west-2:773713188930:certificate/c2979a7a-7b84-43ed-b3a7-24b0256a1b9f | ||
root_domain: staging.reactioncommerce.com | ||
dns_name: storefront | ||
desired_task_count: 1 | ||
min_task_count: 0 | ||
max_task_count: 8 | ||
min_healthy_percent: 100 | ||
max_percent: 200 | ||
alb_listener_port: 80 | ||
alb_listener_path: / | ||
alb_health_check_path: / | ||
task-definition: | ||
name: staging-storefront | ||
containers: | ||
- name: storefront | ||
cpu: 500 | ||
memory: 1800 | ||
port_mappings: | ||
- container_port: 4000 | ||
host_port: 4000 | ||
image: reactioncommerce/reaction-next-starterkit | ||
image_tag: develop | ||
env_params: | ||
- name: INTERNAL_GRAPHQL_URL | ||
- name: EXTERNAL_GRAPHQL_URL | ||
- name: FAVICON_URL | ||
- name: PLACEHOLDER_IMAGE_URL_GALLERY | ||
- name: PLACEHOLDER_IMAGE_URL_GRID | ||
- name: SEGMENT_ANALYTICS_SKIP_MINIMIZE | ||
- name: SEGMENT_ANALYTICS_WRITE_KEY | ||
- name: KEYCLOAK_REALM | ||
- name: KEYCLOAK_CLIENT_ID | ||
- name: KEYCLOAK_URL | ||
- name: KEYCLOAK_REDIRECT_URI | ||
- name: STRIPE_PUBLIC_API_KEY | ||
- name: OAUTH2_AUTH_URL | ||
- name: OAUTH2_TOKEN_URL | ||
- name: OAUTH2_CLIENT_ID | ||
- name: OAUTH2_CLIENT_SECRET | ||
- name: OAUTH2_REDIRECT_URL | ||
- name: PASSPORT_SESSION_SECRET | ||
- name: CANONICAL_URL |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an open issue to add a
.env
file for this repo for local development, and that will involve creating a file named.env.example
which will need to be committed (same pattern as in other repos). Can you change this ignore rule so that.env.example
will be committed when we add that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.