Skip to content

Commit

Permalink
added venv builder
Browse files Browse the repository at this point in the history
  • Loading branch information
tysoekong committed Sep 6, 2024
1 parent b32149a commit 69bc1c9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ luacov.stats.out
luacov.report.out
# exclude Pongo containerid file
.containerid

.venv/
build/
.DS_Store
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
MDIR = ./
PONGO_VERSION := 2.12.0
KONG_VERSION := 3.4.3.12
# DOCKER_DEFAULT_PLATFORM := linux/amd64

.PHONY: build-venv
build-venv:
@mkdir -p .venv/bin
@echo "DOWNLOADING PONGO..."
@git clone https://github.com/Kong/kong-pongo.git --depth 1 --branch $(PONGO_VERSION) .venv/pongo || true
@ln -sf $$(pwd)/.venv/pongo/pongo.sh $$(pwd)/.venv/bin/pongo
@echo "export PATH=$$PATH:$$(pwd)/.venv/bin" > .venv/env
@echo "export KONG_VERSION=$(KONG_VERSION)" >> .venv/env
# @echo "export DOCKER_DEFAULT_PLATFORM=$(DOCKER_DEFAULT_PLATFORM)" >> .venv/env
@echo "BUILDING PONGO IMAGE"
@. .venv/env && pongo build

.PHONY: package
package: build-venv
@echo "PACKAGING PLUGINS AND LIBRARIES"
@. .venv/env && pongo pack
@mkdir -p build/out/
@mv ./*.all.rock build/out

.PHONY: expunge
expunge:
@echo "! DELETING VIRTUAL ENV"
@.venv/bin/pongo down || true
@rm -rf ./.venv
@echo "! DELETING BUILT PACKAGES"
@rm -rf ./build
@echo "! DELETING PONGO IMAGE"
@docker image rm -f kong-pongo-$(PONGO_VERSION):$(KONG_VERSION) > /dev/null 2>&1 || true

.PHONY: test
test: build-venv
@. .venv/env && pongo run

# Clone repository first, then run 'make install'
.PHONY: install
install:
Expand Down

0 comments on commit 69bc1c9

Please sign in to comment.