From e5b0e19053d7917ccbd6d2dc71034b09802428d6 Mon Sep 17 00:00:00 2001 From: "Maxence G. de Montauzan" Date: Sat, 16 Dec 2023 01:55:41 +0100 Subject: [PATCH] Makefile to download needed bin Permit to download easily just and pixi binary without custom software --- .gitignore | 1 + Makefile | 32 ++++++++++++++++++++++++++++++++ README.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index d93b612..3e48759 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # pixi environments .pixi mailpit +.bin diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2bd7582 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +ARCH ?= x86_64-unknown-linux-musl + +JUST_VERSION ?= 1.16.0 +JUST_TGZ ?= just-$(JUST_VERSION)-$(ARCH).tar.gz + +PIXI_VERSION ?= 0.10.0 +PIXI_TGZ ?= pixi-$(PIXI_VERSION)-$(ARCH).tar.gz + +all: just pixi + @echo "You can add .bin folder in your path to enjoy pixi and just:" 'export PATH=$$PATH:$$(pwd)/.bin' + PATH=$$PATH:$(pwd)/.bin just + +just: .bin/just + +.bin/just: init .bin/$(JUST_TGZ) + tar xf ./.bin/$(JUST_TGZ) -C ./.bin just + @echo "just downloaded. Run './.bin/just' command to exec" + +.bin/$(JUST_TGZ): + curl -L https://github.com/casey/just/releases/download/$(JUST_VERSION)/just-$(JUST_VERSION)-$(ARCH).tar.gz -o ./.bin/$(JUST_TGZ) + +pixi: .bin/pixi + +.bin/pixi: init .bin/$(PIXI_TGZ) + tar xf ./.bin/$(PIXI_TGZ) -C ./.bin ./pixi + @echo "pixi downloaded. Run './.bin/pixi' command to exec" + +.bin/$(PIXI_TGZ): + curl -L https://github.com/prefix-dev/pixi/releases/download/v$(PIXI_VERSION)/pixi-$(ARCH).tar.gz -o ./.bin/$(PIXI_TGZ) + +init: + mkdir -p .bin diff --git a/README.md b/README.md index eedd120..cfb3530 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,35 @@ Hey boy, what is the `pit.db` file? Oh, just for fun, and because I love this project, I use [pit by michaeldv](https://github.com/michaeldv/pit) to follow my task etc. It makes me think I should push my python version of this project on occasion when I will take the time to do... + +How to build it? +---------------- + +This project use two very cool projets to handle env & build: + +- [**just**](https://github.com/casey/just) as an alternative to [GNU Make](https://www.gnu.org/software/make/manual/make.html) +- [**pixi**](https://github.com/prefix-dev/pixi) to manage python & dependancies environnment without question + +You can install these two software by your way, or use the Makefile to do it: `$ make`. + +This command will download & untar `just` and `pixie` into a hidden `.bin` folder and launch just target to do the rest. + +> Don't forget to set a valid SMTP host/port in `config.ini`. Otherwise, notifier execution will fail. See below if you want to get a wrapper + +Just's targets permit to: + +- just run the script +- build a docker image +- create a release +- etc. + +Use `.bin/just --list` to list all available target. + +### Use mailpit to wrap mails + +If you don't want to really send and receive mail, e.g. to test... things! I recommand [**mailpit**](https://github.com/axllent/mailpit). + +You can quickly get it with just: `.bin/just get-mail-wrapper`. + +Then execute-it: `./mailpit`. +By default, SMTP port is `1025`, and HTTP port to access to interface is `8025`.