From 5a49364c17d5d8739522382287f9652b9b431618 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:11:07 -0500 Subject: [PATCH 01/17] github actions --- .github/{actions.yml => workflows/main.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{actions.yml => workflows/main.yml} (100%) diff --git a/.github/actions.yml b/.github/workflows/main.yml similarity index 100% rename from .github/actions.yml rename to .github/workflows/main.yml From 7bc75602e180d8fbecc43f4c6f466ace8f65561f Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:12:11 -0500 Subject: [PATCH 02/17] install yaml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86dc05a..d1298b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,5 +13,5 @@ jobs: image: python:3.11 steps: - uses: actions/checkout@v3 - - run: pip install invoke + - run: pip install invoke yaml - run: invoke test From 455de2d3c7752eccededbbd7cd5b659cdba1e3ee Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:14:10 -0500 Subject: [PATCH 03/17] typo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1298b6..1cf7737 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,5 +13,5 @@ jobs: image: python:3.11 steps: - uses: actions/checkout@v3 - - run: pip install invoke yaml + - run: pip install invoke pyyaml - run: invoke test From 8effce80643801913ab6e30b1ab940e6334aa0c8 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:23:05 -0500 Subject: [PATCH 04/17] testing --- .github/workflows/main.yml | 9 ++++----- makefile | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1cf7737..1e0675d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,4 @@ -name: Docker Image CI - +name: Github Actions on: push: branches: ["main"] @@ -8,10 +7,10 @@ on: jobs: test: + using: docker + image: Dockerfile runs-on: ubuntu-latest - container: - image: python:3.11 steps: - uses: actions/checkout@v3 - - run: pip install invoke pyyaml + - run: make install - run: invoke test diff --git a/makefile b/makefile index 8ffd944..2b9dff7 100644 --- a/makefile +++ b/makefile @@ -12,6 +12,7 @@ endif install: ## install python, and python packages $(MAKE) python pyenv install --skip-existing + pip install invoke pyyaml python -m venv venv ./venv/bin/pip install --upgrade pip pipenv ./venv/bin/pip install -r src/requirements-dev.txt From 84e71dc51cff8c2d2615b83abfa4ac06d02b778b Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:26:51 -0500 Subject: [PATCH 05/17] testing --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e0675d..920c841 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,5 @@ -name: Github Actions +name: CI/CD + on: push: branches: ["main"] @@ -7,8 +8,6 @@ on: jobs: test: - using: docker - image: Dockerfile runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 58e8ba42112b81520b7bfc79c63fbee5bd43afaa Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:28:06 -0500 Subject: [PATCH 06/17] take 2 --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 2b9dff7..ea34eb6 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ help: ## Show this help. @egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' -ifdef CI +ifdef GITHUB_ACTION python: # python should already be installed in CI python --version else From f653a9f21e4892c595ed75d458670de5ef15e292 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:29:01 -0500 Subject: [PATCH 07/17] take 3 --- makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makefile b/makefile index ea34eb6..00ceff5 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ help: ## Show this help. @egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' -ifdef GITHUB_ACTION +ifdef CI python: # python should already be installed in CI python --version else @@ -11,7 +11,6 @@ endif install: ## install python, and python packages $(MAKE) python - pyenv install --skip-existing pip install invoke pyyaml python -m venv venv ./venv/bin/pip install --upgrade pip pipenv From 04536c43df576dadd3a7760fdc98cc478f89f2db Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:32:28 -0500 Subject: [PATCH 08/17] checkpoint-kai-1700371948 --- .github/workflows/action.yml | 3 +++ .github/workflows/main.yml | 1 + makefile | 16 ++++++++-------- 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/action.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 0000000..80f4382 --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,3 @@ +runs: + using: docker + image: Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 920c841..865cfbd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,5 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - run: make pyenv-ubuntu - run: make install - run: invoke test diff --git a/makefile b/makefile index 00ceff5..b5ca595 100644 --- a/makefile +++ b/makefile @@ -1,16 +1,16 @@ help: ## Show this help. @egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' -ifdef CI -python: # python should already be installed in CI - python --version -else -python: # install python - pyenv install --skip-existing -endif +pyenv-ubuntu: ## install pyenv on ubuntu + sudo apt-get update + sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \ + libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ + libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \ + liblzma-dev python-openssl git + curl https://pyenv.run | bash install: ## install python, and python packages - $(MAKE) python + pyenv install --skip-existing pip install invoke pyyaml python -m venv venv ./venv/bin/pip install --upgrade pip pipenv From fa74dc3c41b809ff121006c965834a98296c7ec5 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:34:14 -0500 Subject: [PATCH 09/17] checkpoint-kai-1700372054 --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index b5ca595..4b6aad0 100644 --- a/makefile +++ b/makefile @@ -6,7 +6,7 @@ pyenv-ubuntu: ## install pyenv on ubuntu sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \ libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \ - liblzma-dev python-openssl git + liblzma-dev curl https://pyenv.run | bash install: ## install python, and python packages From 4b2fd22e3b590401a91176c6c60e27cc37288643 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:37:11 -0500 Subject: [PATCH 10/17] pyenv testing --- makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makefile b/makefile index 4b6aad0..589ff24 100644 --- a/makefile +++ b/makefile @@ -8,6 +8,9 @@ pyenv-ubuntu: ## install pyenv on ubuntu libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \ liblzma-dev curl https://pyenv.run | bash + echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc + source ~/.bashrc + pyenv --version install: ## install python, and python packages pyenv install --skip-existing From 0e3583de816308745641a8ef3ec04d065300ef6a Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:38:06 -0500 Subject: [PATCH 11/17] pyenv testing --- makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/makefile b/makefile index 589ff24..39fd1c7 100644 --- a/makefile +++ b/makefile @@ -9,8 +9,6 @@ pyenv-ubuntu: ## install pyenv on ubuntu liblzma-dev curl https://pyenv.run | bash echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc - source ~/.bashrc - pyenv --version install: ## install python, and python packages pyenv install --skip-existing From 60b91c52268eccfd2d4c5fdf4f2401146916ece3 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:39:00 -0500 Subject: [PATCH 12/17] checkpoint-kai-1700372340 --- makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefile b/makefile index 39fd1c7..3c4286c 100644 --- a/makefile +++ b/makefile @@ -9,8 +9,10 @@ pyenv-ubuntu: ## install pyenv on ubuntu liblzma-dev curl https://pyenv.run | bash echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc + echo $(PATH) install: ## install python, and python packages + echo $(PATH) pyenv install --skip-existing pip install invoke pyyaml python -m venv venv From 6cfb0ab16a7ac1b89db7d87bb239d417b992edf5 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:39:59 -0500 Subject: [PATCH 13/17] checkpoint-kai-1700372399 --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 3c4286c..0cc655a 100644 --- a/makefile +++ b/makefile @@ -8,7 +8,7 @@ pyenv-ubuntu: ## install pyenv on ubuntu libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \ liblzma-dev curl https://pyenv.run | bash - echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc + echo 'export PATH="$$HOME/.pyenv/bin:$$PATH"' >> ~/.bashrc echo $(PATH) install: ## install python, and python packages From 4a8448e25d8cb2a23473d31d662f699099c08bda Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:45:25 -0500 Subject: [PATCH 14/17] checkpoint-kai-1700372725 --- .github/workflows/main.yml | 7 +++++-- makefile | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 865cfbd..61a18ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,9 +2,11 @@ name: CI/CD on: push: - branches: ["main"] + branches: + - main pull_request: - branches: ["main"] + branches: + - main jobs: test: @@ -12,5 +14,6 @@ jobs: steps: - uses: actions/checkout@v3 - run: make pyenv-ubuntu + - run: echo "$GITHUB_WORKSPACE/.pyenv/bin:$PATH" >> $GITHUB_PATH - run: make install - run: invoke test diff --git a/makefile b/makefile index 0cc655a..f5826be 100644 --- a/makefile +++ b/makefile @@ -8,8 +8,6 @@ pyenv-ubuntu: ## install pyenv on ubuntu libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \ liblzma-dev curl https://pyenv.run | bash - echo 'export PATH="$$HOME/.pyenv/bin:$$PATH"' >> ~/.bashrc - echo $(PATH) install: ## install python, and python packages echo $(PATH) From e3bcace173040be26c1a3cd8a2a2fc8ae30feeff Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:46:36 -0500 Subject: [PATCH 15/17] checkpoint-kai-1700372796 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61a18ac..4b59359 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,6 @@ jobs: steps: - uses: actions/checkout@v3 - run: make pyenv-ubuntu - - run: echo "$GITHUB_WORKSPACE/.pyenv/bin:$PATH" >> $GITHUB_PATH + - run: echo "$HOME/.pyenv/bin:$PATH" >> $GITHUB_PATH - run: make install - run: invoke test From 3b0df4c25be3249226b45446b908fcaba8ea1a9f Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Sun, 19 Nov 2023 00:54:36 -0500 Subject: [PATCH 16/17] cleaner --- tasks.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tasks.py b/tasks.py index 060c97d..129be74 100644 --- a/tasks.py +++ b/tasks.py @@ -93,11 +93,8 @@ def build(ctx: [invoke.Context, Context]): # get local configurations ctx = Context(ctx) - # generate requirements.txt - ctx.run("pipenv requirements > requirements.txt") - # build docker image - ctx.run(f"docker build --tag {ctx.name}:{ctx.version} . --target base", pty=True) + ctx.run(f"BUILDKIT_PROGRESS=plain docker build --tag {ctx.name}:{ctx.version} . --target base", pty=True) @invoke.task @@ -141,28 +138,28 @@ def deploy(ctx: [invoke.Context, Context]): @invoke.task def serve(ctx: [invoke.Context, Context]): """serve up the application, so that it can be accessed locally""" - ctx.run("docker compose up --build flask", pty=True) + ctx.run("BUILDKIT_PROGRESS=plain docker compose up --build flask", pty=True) @invoke.task def test(ctx: [invoke.Context, Context]): """run tests""" - ctx.run("docker compose run --build pytest", pty=True) + ctx.run("BUILDKIT_PROGRESS=plain docker compose run --build pytest", pty=True) @invoke.task def test_watch(ctx: [invoke.Context, Context]): """run tests in watch mode""" - ctx.run("docker compose run --build ptw", pty=True) + ctx.run("BUILDKIT_PROGRESS=plain docker compose run --build ptw", pty=True) @invoke.task def migration_create(ctx: [invoke.Context, Context]): """create a new database migration""" - ctx.run("docker compose run --build create-migration", pty=True) + ctx.run("BUILDKIT_PROGRESS=plain docker compose run --build create-migration", pty=True) @invoke.task def migration_run_locally(ctx: [invoke.Context, Context]): """run a local database migration""" - ctx.run("docker compose run --build run-local-migration", pty=True) + ctx.run("BUILDKIT_PROGRESS=plain docker compose run --build run-local-migration", pty=True) From d2b6b0a7ae89b16aa0f9eae7cdcf30b778a83a37 Mon Sep 17 00:00:00 2001 From: "kai [they]" Date: Sun, 19 Nov 2023 00:58:24 -0500 Subject: [PATCH 17/17] Delete .github/workflows/action.yml --- .github/workflows/action.yml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .github/workflows/action.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml deleted file mode 100644 index 80f4382..0000000 --- a/.github/workflows/action.yml +++ /dev/null @@ -1,3 +0,0 @@ -runs: - using: docker - image: Dockerfile