-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
121 additions
and
5 deletions.
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
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,19 @@ | ||
# Makefile provides an API for CI related tasks | ||
# Using the makefile is not required however CI | ||
# uses the specific targets within the file. | ||
# Therefore may be useful in ensuring a change | ||
# is ready to pass CI checks. | ||
|
||
# ECS environment to deploy image to | ||
DEPLOY_ENV ?= dev | ||
|
||
# Docker image tag to deploy | ||
DEPLOY_TAG ?= latest | ||
|
||
.PHONY: schedule-k8s-deployment | ||
schedule-k8s-deployment: | ||
./ci-scripts/schedule_k8s_deploy.sh "${DEPLOY_ENV}" "${DEPLOY_TAG}" | ||
|
||
.PHONY: schedule-tests | ||
schedule-tests: | ||
./ci-scripts/schedule_tests.sh "${DEPLOY_ENV}" "${TEST_SELECTOR}" |
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,41 @@ | ||
#!/bin/bash | ||
|
||
id=$(uuidgen) | ||
job_id=$(uuidgen) | ||
now=$(date +%s%N) | ||
ttl=$(date +%s -d "14 days") | ||
image=ceramicnetwork/js-ceramic:${2-dev} | ||
network=${1-dev} | ||
environment=ceramic-v4-${network} | ||
|
||
docker run --rm -i \ | ||
-e "AWS_REGION=$AWS_REGION" \ | ||
-e "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" \ | ||
-e "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" \ | ||
-v ~/.aws:/root/.aws \ | ||
-v "$PWD":/aws \ | ||
amazon/aws-cli dynamodb put-item --table-name "ceramic-$network-ops" --item \ | ||
"{ \ | ||
\"id\": {\"S\": \"$id\"}, \ | ||
\"job\": {\"S\": \"$job_id\"}, \ | ||
\"ts\": {\"N\": \"$now\"}, \ | ||
\"ttl\": {\"N\": \"$ttl\"}, \ | ||
\"stage\": {\"S\": \"queued\"}, \ | ||
\"type\": {\"S\": \"workflow\"}, \ | ||
\"params\": { \ | ||
\"M\": { \ | ||
\"name\": {\"S\": \"Deploy k8s $network JS-CERAMIC\"}, \ | ||
\"org\": {\"S\": \"3box\"}, \ | ||
\"repo\": {\"S\": \"ceramic-infra\"}, \ | ||
\"ref\": {\"S\": \"main\"}, \ | ||
\"workflow\": {\"S\": \"update_image.yml\"}, \ | ||
\"labels\": {\"L\": [{\"S\": \"deploy\"}]}, \ | ||
\"inputs\": { \ | ||
\"M\": { \ | ||
\"ceramic_image\": {\"S\": \"$image\"}, \ | ||
\"environment\": {\"S\": \"$environment\"} \ | ||
} \ | ||
} \ | ||
} \ | ||
} \ | ||
}" |
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,43 @@ | ||
#!/bin/bash | ||
|
||
id=$(uuidgen) | ||
job_id=$(uuidgen) | ||
# Schedule tests for 15 minutes in the future to allow the network to stabilize. This assumes that the deployment is | ||
# successful with the right image being deployed, which might not always be the case if the deployment fails for some | ||
# reason. In the future, this can be done better via the CD manager, which will check for the network being ready with | ||
# the right image before scheduling tests. | ||
now=$(date +%s%N -d "15 minutes") | ||
ttl=$(date +%s -d "14 days") | ||
network=${1-dev} | ||
test_selector=${2-.} | ||
|
||
docker run --rm -i \ | ||
-e "AWS_REGION=$AWS_REGION" \ | ||
-e "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" \ | ||
-e "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" \ | ||
-v ~/.aws:/root/.aws \ | ||
-v "$PWD":/aws \ | ||
amazon/aws-cli dynamodb put-item --table-name "ceramic-$network-ops" --item \ | ||
"{ \ | ||
\"id\": {\"S\": \"$id\"}, \ | ||
\"job\": {\"S\": \"$job_id\"}, \ | ||
\"ts\": {\"N\": \"$now\"}, \ | ||
\"ttl\": {\"N\": \"$ttl\"}, \ | ||
\"stage\": {\"S\": \"queued\"}, \ | ||
\"type\": {\"S\": \"workflow\"}, \ | ||
\"params\": { \ | ||
\"M\": { \ | ||
\"name\": {\"S\": \"Post-Deployment Tests\"}, \ | ||
\"org\": {\"S\": \"3box\"}, \ | ||
\"repo\": {\"S\": \"ceramic-tests\"}, \ | ||
\"ref\": {\"S\": \"main\"}, \ | ||
\"workflow\": {\"S\": \"run-durable.yml\"}, \ | ||
\"labels\": {\"L\": [{\"S\": \"test\"}]}, \ | ||
\"inputs\": { \ | ||
\"M\": { \ | ||
\"test_selector\": {\"S\": \"$test_selector\"} \ | ||
} \ | ||
} \ | ||
} \ | ||
} \ | ||
}" |