This repository has been archived by the owner on Oct 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
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
1 parent
d8aa220
commit c916711
Showing
14 changed files
with
200 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Dynalite | ||
*.out | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
# doit | ||
.doit.db | ||
|
||
# Virtual Environment | ||
venv | ||
|
||
# Eggs | ||
.eggs | ||
subhub.egg-info | ||
|
||
# Node | ||
node_modules | ||
|
||
# Visual Studio Code | ||
.vscode | ||
|
||
# PyCharm | ||
.idea | ||
|
||
.vscode/ | ||
.tox | ||
venv | ||
.doit.db |
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,60 @@ | ||
FROM python:3.7-alpine | ||
MAINTAINER Stewart Henderson <shenderson@mozilla.com> | ||
|
||
ARG STRIPE_API_KEY | ||
ARG AWS_ACCESS_KEY_ID | ||
ARG AWS_SECRET_ACCESS_KEY | ||
ARG STRIPE_LOG | ||
ARG STRIPE_API_MOCK | ||
ARG LOCAL_FLASK_PORT | ||
ARG SUPPORT_API_KEY | ||
|
||
ENV STRIPE_API_KEY=$STRIPE_API_KEY | ||
ENV AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID | ||
ENV AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY | ||
ENV STRIPE_LOG=$STRIPE_LOG | ||
ENV STRIPE_API_MOCK=$STRIPE_API_MOCK | ||
ENV LOCAL_FLASK_PORT=$LOCAL_FLASK_PORT | ||
ENV SUPPORT_API_KEY=$SUPPORT_API_KEY | ||
|
||
# Enable Flask debug mode | ||
ENV FLASK_ENV=development | ||
|
||
EXPOSE $LOCAL_FLASK_PORT | ||
|
||
# Alpine Registry for package versions, https://pkgs.alpinelinux.org/packages | ||
RUN apk update | ||
RUN apk add build-base | ||
RUN apk add libgit2-dev | ||
RUN apk add bash==5.0.0-r0 | ||
RUN apk add libc-dev | ||
RUN apk add python3-dev | ||
RUN apk add libffi-dev | ||
RUN apk add openssl-dev | ||
RUN apk add zeromq-dev | ||
RUN apk add linux-headers | ||
RUN apk add nodejs | ||
RUN apk add curl | ||
RUN apk add yarn | ||
RUN apk add gcc==8.3.0-r0 | ||
RUN apk add g++ | ||
RUN apk add musl-dev | ||
RUN apk add pkgconfig | ||
RUN apk add git | ||
RUN apk add sudo | ||
|
||
RUN pip install awscli | ||
|
||
COPY ./automation_requirements.txt automation_requirements.txt | ||
RUN pip install -r automation_requirements.txt | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
COPY . /app | ||
RUN yarn install | ||
|
||
RUN addgroup -g 10001 app && \ | ||
adduser -D -G app -h /app -u 10001 app | ||
|
||
USER app | ||
ENTRYPOINT ["doit", "local"] |
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
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# NOTE: This script is used to provision both TravisCI and Jenkins, AWS credentials and configuration | ||
# Reference AWS Environment Variables | ||
# https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html | ||
|
||
mkdir -p ~/.aws | ||
|
||
cat > ~/.aws/credentials << EOL | ||
[default] | ||
aws_access_key_id = ${AWS_ACCESS_KEY_ID:-fake-id} | ||
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY:-fake-key} | ||
EOL | ||
|
||
cat >~/.aws/config <<-EOF | ||
[default] | ||
output=json | ||
region=${AWS_DEFAULT_REGION:-us-west-2} | ||
EOF |
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# NOTE: This bash script is used as an entry point from this application's docker image. | ||
|
||
sudo su | ||
|
||
printenv | ||
doit venv | ||
#/app/venv/bin/python -m setup develop | ||
doit local |
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 @@ | ||
version: "3.7" | ||
|
||
services: | ||
subhub: | ||
container_name: subhub | ||
build: | ||
context: . | ||
args: | ||
AWS_ACCESS_KEY_ID: "AKIAIOSFODNN7EXAMPLE" | ||
AWS_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | ||
STRIPE_API_KEY: "sk_test_123" | ||
SUPPORT_API_KEY: "support_test" | ||
# NOTE: This enables debug logging of the Stripe API when running in docker-compose. | ||
STRIPE_LOG: "debug" | ||
STRIPE_API_MOCK: "https://stripe:12112" | ||
LOCAL_FLASK_PORT: 5000 | ||
ports: | ||
- "5000:5000" | ||
links: | ||
- dynamodb | ||
- stripe | ||
depends_on: | ||
- stripe | ||
dynamodb: | ||
container_name: dynamodb | ||
image: dwmkerr/dynamodb | ||
command: "-sharedDb" | ||
hostname: dynamo | ||
restart: always | ||
environment: | ||
- reschedule=on-node-failure | ||
stripe: | ||
container_name: stripe | ||
build: | ||
# NOTE: There are interesting rules around docker builds from git repos: https://docs.docker.com/engine/reference/commandline/build/#git-repositories | ||
context: https://github.com/stripe/stripe-mock.git#pull/174/head | ||
ports: | ||
- "12111:12111" | ||
- "12112:12112" |
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
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
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