Add ci
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
2025-06-21 23:37:35 -04:00
parent 6042440085
commit ce63ae1d26
4 changed files with 84 additions and 1 deletions

55
.drone.yml Normal file
View File

@@ -0,0 +1,55 @@
---
kind: pipeline
type: docker
platform:
os: linux
arch: amd64
steps:
- name: build-ui
image: node:24
commands:
- make web
- name: test
image: golang:1.24.0
commands:
- make test
- name: build-backend
image: golang:1.24.0
commands:
- make binary
- name: image
image: plugins/docker
settings:
registry: registry.itzana.me
repo: registry.itzana.me/strafesnet/dev-service
tags:
- ${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
- ${DRONE_BRANCH}
username:
from_secret: REGISTRY_USER
password:
from_secret: REGISTRY_PASS
when:
branch:
- master
- staging
- name: deploy
image: argoproj/argocd:latest
commands:
- argocd login --grpc-web cd.stricity.com --username $USERNAME --password $PASSWORD
- argocd app --grpc-web set ${DRONE_BRANCH}-dev-service --kustomize-image registry.itzana.me/strafesnet/dev-service:${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
environment:
USERNAME:
from_secret: ARGO_USER
PASSWORD:
from_secret: ARGO_PASS
when:
branch:
- master
- staging

1
.gitignore vendored
View File

@@ -1 +1,2 @@
.idea
build

3
Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM alpine
COPY build/server /
ENTRYPOINT ["/server"]

24
Makefile Normal file
View File

@@ -0,0 +1,24 @@
clean:
rm -rf build
rm -rf web/dist
test:
go fmt ./...
go vet ./...
go test -race ./...
web:
cd web && npm install && npm run build
binary:
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o build/server cmd/dev-service/service.go
build: web binary
docker:
docker build . -t git.itzana.me/strafesnet/dev-service:latest
docker push git.itzana.me/strafesnet/dev-service:latest
all: clean build docker
.PHONY: clen test web binary build docker all