Merge pull request 'feat: add pomme-pipeline' (#63) from pipeline into master

Reviewed-on: https://git.freecumextremist.com/grumbulon/pomme/pulls/63
This commit is contained in:
grumbulon 2023-03-09 14:22:10 +00:00
commit 5c8e4eb7ba
8 changed files with 74 additions and 7 deletions

51
.drone.yaml Normal file
View file

@ -0,0 +1,51 @@
kind: 'pipeline'
type: 'docker'
name: pomme-pipeline
steps:
- name: cache-frontend
image: node:18
commands:
- corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm -F frontend i
- name: cache-backend
image: golang:1.20
commands:
- go mod tidy && go mod vendor
volumes:
- name: 'cache'
- path: '/go'
- name: lint-frontend
image: node:18
commands:
- corepack enable && pnpm config set store-dir .cache/pnpm
- make lint-frontend
depends_on:
- 'cache-frontend'
- name: lint-backend
image: golangci/golangci-lint
commands:
- make lint-backend
depends_on:
- 'cache-backend'
- name: test-frontend
image: node:18
commands:
- corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm -F frontend test:unit
depends_on:
- 'lint-frontend'
- name: test-backend
image: golang:1.20
commands:
- cp config.sample.yaml ./internal/api/config.yaml
- make test-backend
depends_on:
- 'lint-backend'
volumes:
- name: 'cache'
- path: '/go'

View file

@ -30,7 +30,7 @@ format-backend:
gofmt -w -s .
swagger:
swag init -d cmd/pomme/,internal/
swag init -d cmd/pomme/,internal/
.PHONY: lint lint-frontend lint-backend
lint: lint-frontend lint-backend
@ -40,3 +40,12 @@ lint-frontend:
lint-backend:
golangci-lint run --timeout=5m --out-format colored-line-number:stdout
.PHONY: test test-frontend test-backend
test: test-frontend test-backend
test-frontend:
pnpm -F frontend "test:unit"
test-backend:
go test -v -cover ./internal/api

View file

@ -1,6 +1,6 @@
This will be a website that, to oversimplify things, allows users to submit zonefiles to use [froth.zone nameservers](https://dns.froth.zone/nameservers).
[![Build Status](https://ci.freecumextremist.finance/api/badges/grumbulon/pomme/status.svg)](https://ci.freecumextremist.finance/grumbulon/pomme)
Working project title is pomme.
This will be a website that, to oversimplify things, allows users to submit zonefiles to use [froth.zone nameservers](https://dns.froth.zone/nameservers).
More information to come soon.
@ -15,3 +15,10 @@ to generate and build:
go generate ./...
go build ./cmd/pomme
```
## Testing
To test pomme you can run
```bash
make test-backend
```

View file

@ -2,5 +2,4 @@ server: example.com # does nothing yet
hashingsecret: PasswordHashingSecret
port: 3008 # port the server runs on
db: pomme.sqlite
testdb: test.sqlite
zonedir: zones
zonedir: zones

3
frontend/.gitignore vendored
View file

@ -1,6 +1,7 @@
.DS_Store
node_modules
/build
build/*
!build/.gitkeep
/.svelte-kit
/package
.env

0
frontend/build/.gitkeep Normal file
View file

View file

@ -9,7 +9,7 @@
"test": "playwright test",
"check": "svelte-kit sync && svelte-check",
"check:watch": "svelte-kit sync && svelte-check --watch",
"test:unit": "vitest",
"test:unit": "vitest run",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},

0
frontend/static/.gitkeep Normal file
View file