mirror of
https://github.com/KevinMidboe/planetposen-mail.git
synced 2025-10-29 01:30:32 +00:00
Makefile and readme
This commit is contained in:
26
Makefile
Normal file
26
Makefile
Normal file
@@ -0,0 +1,26 @@
|
||||
.PHONY: build install server
|
||||
|
||||
PROJECT_NAME=$(shell basename $(CURDIR))
|
||||
|
||||
## build: build the application
|
||||
build:
|
||||
export GO111MODULE="on"; \
|
||||
go mod download; \
|
||||
go mod vendor; \
|
||||
CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o main cmd/server/main.go
|
||||
|
||||
## install: fetches go modules
|
||||
install:
|
||||
export GO111MODULE="on"; \
|
||||
go mod tidy; \
|
||||
go mod download \
|
||||
|
||||
## server: runs the server with -race
|
||||
server:
|
||||
export GO111MODULE="on"; \
|
||||
go run -race cmd/server/main.go
|
||||
|
||||
## modd: Monitors the directory, and recompiles your app every time a file changes. Also runs tests.
|
||||
## (To install modd, run: go get github.com/cortesi/modd/cmd/modd)
|
||||
modd:
|
||||
modd
|
||||
29
README.md
Normal file
29
README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Planetposen email sender
|
||||
|
||||
App for sending emails related to planetposen webshop. Currently only supports sending order confirmations emails after purchase.
|
||||
|
||||
## Setup
|
||||
From source:
|
||||
1. `git clone https://github.com/kevinmidboe/planetposen-mail`
|
||||
2. `cp .env.example .env`
|
||||
3. Update variables in `.env` file
|
||||
4. `make install`
|
||||
|
||||
## Run
|
||||
Run api from command line with:
|
||||
```bash
|
||||
make server
|
||||
```
|
||||
|
||||
Run as docker container using:
|
||||
|
||||
```bash
|
||||
(sudo) docker run -d --name planetposen-mail -p 8000:8000 \
|
||||
-e PORT=8000
|
||||
-e SEND_GRID_API_ENDPOINT="https://api.sendgrid.com"
|
||||
-e SEND_GRID_API_KEY="sg.nE3..."
|
||||
```
|
||||
or
|
||||
```bash
|
||||
(sudo) docker run -d --name planetposen-mail -p 8000:8000 --env-file .env planetposen-mail
|
||||
```
|
||||
Reference in New Issue
Block a user