2023-07-25 01:59:02 +00:00
|
|
|
version: "3"
|
2022-05-11 22:47:31 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
default:
|
|
|
|
cmds:
|
|
|
|
- task: run
|
|
|
|
|
|
|
|
run:
|
|
|
|
desc: Build and run
|
|
|
|
sources:
|
|
|
|
- internal/**/*.go
|
|
|
|
- cmd/**/*.go
|
|
|
|
- ../frontend/src/locale/src/*.json
|
|
|
|
cmds:
|
|
|
|
- task: locale
|
|
|
|
- task: build
|
2023-02-19 05:11:22 +00:00
|
|
|
force: true
|
2022-05-11 22:47:31 +00:00
|
|
|
- cmd: echo -e "==> Running..."
|
|
|
|
silent: true
|
|
|
|
- cmd: ../dist/bin/server
|
|
|
|
ignore_error: true
|
|
|
|
silent: true
|
|
|
|
env:
|
|
|
|
LOG_LEVEL: debug
|
|
|
|
|
|
|
|
build:
|
|
|
|
desc: Build the server
|
|
|
|
cmds:
|
|
|
|
- cmd: echo -e "==> Building..."
|
|
|
|
silent: true
|
|
|
|
- cmd: rm -f dist/bin/*
|
|
|
|
silent: true
|
2023-05-26 01:04:43 +00:00
|
|
|
- cmd: go build -tags 'json1' -buildvcs=false -ldflags="-X main.commit={{.GIT_COMMIT}} -X main.version={{.VERSION}}" -o ../dist/bin/server ./cmd/server/main.go
|
2022-05-11 22:47:31 +00:00
|
|
|
silent: true
|
2023-05-11 23:40:45 +00:00
|
|
|
- cmd: go build -buildvcs=false -ldflags="-X main.commit={{.GIT_COMMIT}} -X main.version={{.VERSION}}" -o ../dist/bin/ipranges ./cmd/ipranges/main.go
|
|
|
|
silent: true
|
|
|
|
- cmd: rm -f /etc/nginx/conf.d/include/ipranges.conf && /app/dist/bin/ipranges > /etc/nginx/conf.d/include/ipranges.conf
|
2022-05-11 22:47:31 +00:00
|
|
|
- task: lint
|
|
|
|
vars:
|
|
|
|
GIT_COMMIT:
|
|
|
|
sh: git log -n 1 --format=%h
|
|
|
|
VERSION:
|
|
|
|
sh: cat ../.version
|
|
|
|
|
|
|
|
lint:
|
|
|
|
desc: Linting
|
|
|
|
cmds:
|
|
|
|
- cmd: echo -e "==> Linting..."
|
|
|
|
silent: true
|
|
|
|
- cmd: bash scripts/lint.sh
|
|
|
|
silent: true
|
|
|
|
|
|
|
|
test:
|
|
|
|
desc: Testing
|
|
|
|
cmds:
|
|
|
|
- cmd: echo -e "==> Testing..."
|
|
|
|
silent: true
|
|
|
|
- cmd: bash scripts/test.sh
|
|
|
|
silent: true
|
|
|
|
|
|
|
|
locale:
|
|
|
|
desc: Locale
|
|
|
|
dir: /app/frontend
|
|
|
|
cmds:
|
|
|
|
- cmd: yarn locale-compile
|
|
|
|
silent: true
|
|
|
|
ignore_error: true
|
|
|
|
- cmd: chown -R "$PUID:$PGID" src/locale/lang
|
|
|
|
silent: true
|
|
|
|
ignore_error: true
|