-
Notifications
You must be signed in to change notification settings - Fork 5
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
17 changed files
with
318 additions
and
225 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,5 +2,4 @@ __pycache__/ | |
*.py[cod] | ||
.idea/ | ||
db.sqlite3 | ||
.pytest_cache/ | ||
.env | ||
.pytest_cache/ |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
language: python | ||
python: | ||
- "3.6" | ||
install: | ||
- pip install pipenv | ||
- pipenv install --dev | ||
services: | ||
- docker | ||
script: | ||
- pipenv run pytest | ||
- BACKEND_IMAGE=backend docker-compose -f docker-compose-ci.yml run backend /app/scripts/dev/run_tests.sh |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,35 @@ | ||
version: '3' | ||
|
||
services: | ||
db: | ||
image: postgres:9.6.8 | ||
ports: | ||
- "5432:5432" | ||
env_file: test.env | ||
|
||
localstack: | ||
image: localstack/localstack:0.10.2 | ||
ports: | ||
- "4567-4584:4567-4584" | ||
environment: | ||
- SERVICES=secretsmanager | ||
- DEBUG=${DEBUG- } | ||
- DATA_DIR=${DATA_DIR- } | ||
- PORT_WEB_UI=${PORT_WEB_UI- } | ||
- LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR- } | ||
- LAMBDA_REMOTE_DOCKER=false | ||
- KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY- } | ||
- DOCKER_HOST=unix:///var/run/docker.sock | ||
- AWS_EXECUTION_ENV=True | ||
- AWS_DEFAULT_REGION=us-east-1 | ||
- AWS_ACCESS_KEY_ID=foo | ||
- AWS_SECRET_ACCESS_KEY=bar | ||
|
||
backend: | ||
image: ${BACKEND_IMAGE} | ||
depends_on: | ||
- db | ||
- localstack | ||
restart: on-failure | ||
env_file: test.env | ||
command: ./scripts/dev/run_tests.sh |
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,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
function wait_for_secretsmanager { | ||
until aws --no-sign-request --endpoint-url="$SECRET_MANAGER_ENDPOINT_URL" secretsmanager list-secrets; do | ||
>&2 echo "Secretsmanager is unavailable - sleeping" | ||
sleep 1 | ||
done | ||
} | ||
|
||
function install_db_secret { | ||
SECRET_STRING="{\"host\": \"db\", \"username\": \"$POSTGRES_USER\", \"password\": \"$POSTGRES_PASSWORD\", \"port\": $POSTGRES_PORT}" | ||
|
||
aws --endpoint-url="$SECRET_MANAGER_ENDPOINT_URL" secretsmanager create-secret \ | ||
--name "$DB_SECRET_ARN" \ | ||
--secret-string "$SECRET_STRING" | ||
} |
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,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
. $(dirname "$0")/install_localstack_fixtures.sh | ||
|
||
# wait untill secretsmanager become ready | ||
wait_for_secretsmanager | ||
echo "Secrets manager is up" | ||
|
||
# install all localstack fixtures | ||
{ | ||
install_db_secret && | ||
echo "DB secrets set" | ||
} || { | ||
echo "DB secrets NOT set" | ||
} | ||
|
||
python ./scripts/dev/wait_for_postgres.py && | ||
./manage.py migrate && | ||
./manage.py runserver 0.0.0.0:8000 |
Oops, something went wrong.