From d337f57adc10be79d46ab596a287a2832f22cae6 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Sun, 3 Jan 2021 13:37:02 +0100 Subject: [PATCH] Rename musala-push to musala --- Makefile | 16 ++++++++++------ README.md | 20 ++++++++++---------- cmd/{musala-push => musala}/config.go | 2 +- cmd/{musala-push => musala}/main.go | 0 cmd/{musala-push => musala}/trello.go | 0 docker/Dockerfile | 8 ++++---- 6 files changed, 25 insertions(+), 21 deletions(-) rename cmd/{musala-push => musala}/config.go (99%) rename cmd/{musala-push => musala}/main.go (100%) rename cmd/{musala-push => musala}/trello.go (100%) diff --git a/Makefile b/Makefile index 87da424..c45d4b8 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,20 @@ GOFILES=$(wildcard *.go) -NAME=musala-push +BINDIR=bin +NAME=musala MJML_TEMPLATES=$(wildcard templates/*.mjml) MJML_OUTPUT=$(patsubst %.mjml,%.mjml.html,$(MJML_TEMPLATES)) -all: build +all: help %.mjml.html: %.mjml npx mjml $< --config.minify > $@ - .PHONY: build build-binaries build-templates build: build-binaries build-templates ## build executable build-binaries: build-templates - go build ./... + cd $(BINDIR) && go build ../... build-templates: $(MJML_OUTPUT) @@ -27,7 +27,11 @@ shellcheck: ## run shellcheck validation .PHONY: help help: ## print this help - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) + @awk 'BEGIN {FS = ":.*?## "} \ + /^[a-zA-Z_-]+:.*?## / \ + {sub("\\\\n",sprintf("\n%22c"," "), \ + $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' \ + $(MAKEFILE_LIST) .PHONY: clean clean-templates clean-binaries clean: clean-templates clean-binaries ## remove build artifacts @@ -36,7 +40,7 @@ clean-templates: rm -f ./templates/*.mjml.html clean-binaries: - rm -rf ./_build/* + rm -rf $(BINDIR)/* test: build ./test.sh diff --git a/README.md b/README.md index 391b652..2cbf6cd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Musala -![Build](https://github.com/glenux/musala-push/workflows/build/badge.svg?branch=master) - -[![GitHub license](https://img.shields.io/github/license/glenux/musala-push.svg)](https://github.com/glenux/musala-push/blob/master/LICENSE.txt) +![Build](https://github.com/glenux/musala/workflows/build/badge.svg?branch=master) + +[![GitHub license](https://img.shields.io/github/license/glenux/musala.svg)](https://github.com/glenux/musala/blob/master/LICENSE.txt) [![Donate on patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://patreon.com/glenux) Every morning, get the content of your favorite kanban board by email, WhatsApp or SMS. @@ -39,7 +39,7 @@ Delivery via: Make sure you have Go installed, then type: - $ go install github.com/glenux/musala-push/... + $ go install github.com/glenux/musala/... It will install Musala Mail binary in `$GOPATH/bin` @@ -48,7 +48,7 @@ It will install Musala Mail binary in `$GOPATH/bin` Make sure you have Docker installed, then type: - $ docker build -t musala-push -f docker/Dockerfile . + $ docker build -t musala -f docker/Dockerfile . ## Usage @@ -90,11 +90,11 @@ SMTP_SECURITY_TYPE: tls Then run the program: - $ $GOPATH/bin/musala-push + $ $GOPATH/bin/musala ### Using with docker - $ docker build -f docker/Dockerfile -t musala-push . + $ docker build -f docker/Dockerfile -t musala . $ docker run \ -e EMAIL_FROM= -e EMAIL_TO= @@ -102,12 +102,12 @@ Then run the program: -e EMAIL_FROM= -e EMAIL_TO= -e EMAIL_SUBJECT= - -v /var/lib/musala-push/musala-push.cron:/app/musala-push.cron \ - -it musala-push:latest + -v /var/lib/musala/musala.cron:/app/musala.cron \ + -it musala:latest ## Contributing -1. Fork it ( http://github.com/glenux/musala-push/fork ) +1. Fork it ( http://github.com/glenux/musala/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) diff --git a/cmd/musala-push/config.go b/cmd/musala/config.go similarity index 99% rename from cmd/musala-push/config.go rename to cmd/musala/config.go index 7f3cb8c..9864cfe 100644 --- a/cmd/musala-push/config.go +++ b/cmd/musala/config.go @@ -11,7 +11,7 @@ import ( ) const ( - programBinary string = "musala-push" + programBinary string = "musala" ) var ( diff --git a/cmd/musala-push/main.go b/cmd/musala/main.go similarity index 100% rename from cmd/musala-push/main.go rename to cmd/musala/main.go diff --git a/cmd/musala-push/trello.go b/cmd/musala/trello.go similarity index 100% rename from cmd/musala-push/trello.go rename to cmd/musala/trello.go diff --git a/docker/Dockerfile b/docker/Dockerfile index 1c8f018..9adccd0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ FROM golang:1.12 AS build RUN git clone \ --single-branch \ --branch develop \ - https://github.com/glenux/musala-push \ + https://github.com/glenux/musala \ /app \ && rm -f /app/contrib-trello \ && git clone \ @@ -30,9 +30,9 @@ RUN apk update \ && rm -rf /var/cache/apk/* RUN mkdir /app -COPY --from=build /app/musala-push /app/ -COPY docker/musala-push.cron /app/ +COPY --from=build /app/musala /app/ +COPY docker/musala.cron /app/ COPY templates/ /app/templates -CMD ["/bin/sh", "-c", "/usr/bin/crontab /app/musala-push.cron && /usr/sbin/crond -f"] +CMD ["/bin/sh", "-c", "/usr/bin/crontab /app/musala.cron && /usr/sbin/crond -f"]