36 lines
619 B
YAML
36 lines
619 B
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
workspace:
|
|
base: /drone/src
|
|
path: link-shortener
|
|
|
|
steps:
|
|
- name: go test
|
|
image: golang:1.25-alpine3.21
|
|
environment:
|
|
REDIS_URL: redis://redis:6379
|
|
commands:
|
|
- apk add --no-cache git curl
|
|
- go mod tidy
|
|
- go test ./...
|
|
|
|
- name: build and push
|
|
image: plugins/docker
|
|
settings:
|
|
repo: registry:5000/link-shortener
|
|
dockerfile: dockerfile
|
|
tags:
|
|
- latest
|
|
- ${DRONE_BRANCH}
|
|
build_args:
|
|
- GO_ENV=production
|
|
|
|
services:
|
|
- name: redis
|
|
image: redis:latest
|
|
|
|
trigger:
|
|
branch:
|
|
- main |