From d75cc119c24c70bb5cadbb23e1822e6b6d5eae48 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 15:26:43 +0100 Subject: [PATCH 01/10] Starts adding auto deploy --- .dockerignore | 17 +++++++++++++++++ .github/workflows/fly.yml | 15 +++++++++++++++ Dockerfile | 11 +++++++++++ fly.toml | 38 ++++++++++++++++++++++++++++++++++++++ requirements.txt | 3 ++- 5 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/fly.yml create mode 100644 Dockerfile create mode 100644 fly.toml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2eb8df5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +# flyctl launch added from .gitignore +**/.idea +**/.DS_Store + +**/config.ini + +**/venv + +**/.git +**/*.pyc +**/__pycache__ +**/*.egg-info +**/dist +**/build +**/.vscode + +**/.env diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml new file mode 100644 index 0000000..d2e8b2e --- /dev/null +++ b/.github/workflows/fly.yml @@ -0,0 +1,15 @@ +name: Fly Deploy +on: + push: + branches: + - main +env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} +jobs: + deploy: + name: Deploy app + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9e3a15a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.9-slim + +COPY app/ /app +COPY requirements.txt /app/requirements.txt + +EXPOSE 5000 + +WORKDIR /app +RUN pip install -r requirements.txt + +CMD [ "python", "./app.py" ] \ No newline at end of file diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..a27360e --- /dev/null +++ b/fly.toml @@ -0,0 +1,38 @@ +# fly.toml file generated for checkout-create on 2022-11-07T15:12:40+01:00 + +app = "checkout-create" +kill_signal = "SIGINT" +kill_timeout = 5 +processes = [] + +[env] + +[experimental] + allowed_public_ports = [] + auto_rollback = true + +[[services]] + http_checks = [] + internal_port = 8080 + processes = ["app"] + protocol = "tcp" + script_checks = [] + [services.concurrency] + hard_limit = 25 + soft_limit = 20 + type = "connections" + + [[services.ports]] + force_https = true + handlers = ["http"] + port = 80 + + [[services.ports]] + handlers = ["tls", "http"] + port = 443 + + [[services.tcp_checks]] + grace_period = "1s" + interval = "15s" + restart_limit = 0 + timeout = "2s" diff --git a/requirements.txt b/requirements.txt index a44b9fe..9fec26f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -flask +Flask==2.2.2 Adyen == 6.0.0 python-dotenv===0.19.2 requests == 2.27.1 +gunicorn==20.1.0 From e484d0719c55682a57dac1a206d110136c7d2140 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 15:27:42 +0100 Subject: [PATCH 02/10] On PR for the time being --- .github/workflows/fly.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml index d2e8b2e..31af810 100644 --- a/.github/workflows/fly.yml +++ b/.github/workflows/fly.yml @@ -3,6 +3,9 @@ on: push: branches: - main + pull_request: + branches: [ master ] + env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} jobs: From 114e69638e55e0acb01ddd5b5850ea70ea0baced Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 15:38:53 +0100 Subject: [PATCH 03/10] Adds env --- .github/workflows/fly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml index 31af810..4e08e06 100644 --- a/.github/workflows/fly.yml +++ b/.github/workflows/fly.yml @@ -10,6 +10,7 @@ env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} jobs: deploy: + environment: zeOne name: Deploy app runs-on: ubuntu-latest steps: From 852f3d046948f99cd415218b3b9a597333480253 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 15:47:38 +0100 Subject: [PATCH 04/10] Adds Adyen ENV Variables --- .github/workflows/fly.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml index 4e08e06..837d391 100644 --- a/.github/workflows/fly.yml +++ b/.github/workflows/fly.yml @@ -8,6 +8,10 @@ on: env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + ADYEN_API_KEY: ${{ secrets.ADYEN_API_KEY }} + ADYEN_CLIENT_KEY: ${{ secrets.ADYEN_CLIENT_KEY }} + ADYEN_HMAC_KEY: ${{ secrets.ADYEN_HMAC_KEY }} + ADYEN_MERCHANT_ACCOUNT: ${{ secrets.ADYEN_MERCHANT_ACCOUNT }} jobs: deploy: environment: zeOne @@ -16,4 +20,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl secrets set ADYEN_API_KEY="$ADYEN_API_KEY" + - run: flyctl secrets set ADYEN_CLIENT_KEY="$ADYEN_CLIENT_KEY" + - run: flyctl secrets set ADYEN_HMAC_KEY="$ADYEN_HMAC_KEY" + - run: flyctl secrets set ADYEN_MERCHANT_ACCOUNT="$ADYEN_MERCHANT_ACCOUNT" - run: flyctl deploy --remote-only \ No newline at end of file From 31c8dd7caeea6c01cafa5734729ac8dd9f99f6c7 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 15:56:22 +0100 Subject: [PATCH 05/10] Adding external port... --- fly.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fly.toml b/fly.toml index a27360e..db063b6 100644 --- a/fly.toml +++ b/fly.toml @@ -8,7 +8,7 @@ processes = [] [env] [experimental] - allowed_public_ports = [] + allowed_public_ports = [8080] auto_rollback = true [[services]] From bf9fe63bf6898fde6fbea52471c5ec7c569a4e0e Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 16:00:04 +0100 Subject: [PATCH 06/10] Adding external port in Dockerfile instead :D --- Dockerfile | 2 +- fly.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e3a15a..727a58d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM python:3.9-slim COPY app/ /app COPY requirements.txt /app/requirements.txt -EXPOSE 5000 +EXPOSE 8080:8080 WORKDIR /app RUN pip install -r requirements.txt diff --git a/fly.toml b/fly.toml index db063b6..a27360e 100644 --- a/fly.toml +++ b/fly.toml @@ -8,7 +8,7 @@ processes = [] [env] [experimental] - allowed_public_ports = [8080] + allowed_public_ports = [] auto_rollback = true [[services]] From 8f85569dc796f340f6426de323f02e8325ef48be Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 16:13:42 +0100 Subject: [PATCH 07/10] WTH is wrong with fly --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5aa2b7..3ebc4b6 100644 --- a/README.md +++ b/README.md @@ -78,4 +78,4 @@ MIT license. For more information, see the **LICENSE** file in the root director --- -*v1.1.0-alpha* \ No newline at end of file +*v1.1.0-alpha* From 4bc5d9bad0ff3d9a05886b2f32143fbf4ab0fa67 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 16:43:00 +0100 Subject: [PATCH 08/10] Whatever... --- fly.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fly.toml b/fly.toml index a27360e..85354ab 100644 --- a/fly.toml +++ b/fly.toml @@ -1,6 +1,6 @@ -# fly.toml file generated for checkout-create on 2022-11-07T15:12:40+01:00 +# fly.toml file generated for adyencheckout on 2022-11-07T16:40:06+01:00 -app = "checkout-create" +app = "adyencheckout" kill_signal = "SIGINT" kill_timeout = 5 processes = [] From 9fd6a903e28cf770e58fa2d3c00d92427676c854 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 17:04:43 +0100 Subject: [PATCH 09/10] Only for pushes to main --- .github/workflows/fly.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml index 837d391..a5abf07 100644 --- a/.github/workflows/fly.yml +++ b/.github/workflows/fly.yml @@ -3,8 +3,6 @@ on: push: branches: - main - pull_request: - branches: [ master ] env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} From 2456e9ee2abbafbc660a246348e97eb246c0ef2b Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Mon, 7 Nov 2022 17:10:29 +0100 Subject: [PATCH 10/10] Adds link to the README --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 3ebc4b6..b9f44f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # Checkout Create ## Interactive Drop-in creation and styling tool + +[Try the tool online here!](https://adyencheckout.fly.dev/). + +_⚠️WARNING⚠️: Do not use real payment information online! There are test cards available at the bottom of the page_ + > :warning: **This tool is being worked on and is in Alpha stage** An external tool which allows you to build a drop-in integration and make customizations as outlined in our style sheet. Enables you to experiment and see what your checkout could potentially look like. You can then retrive the final result alongside the changes so it can be exported for your team to fully implement your vision.