Files
vegasco/.drone.yml
ThompsonNye 5e083aeaf6
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Echo docker image with tag in pipeline
2025-10-16 17:36:15 +02:00

100 lines
2.1 KiB
YAML

kind: pipeline
type: docker
name: Build and test
trigger:
event:
include:
- push
- pull_request
- custom
steps:
- name: compile (.NET)
image: mcr.microsoft.com/dotnet/sdk:9.0-alpine
environment:
CI_WORKSPACE: "/drone/src"
commands:
- dotnet build ./vegasco-server.slnx
- name: compile (Angular)
image: node:lts
commands:
- npm install -g pnpm
- cd src/Vegasco-Web
- pnpm install
- pnpm build
- name: test
image: quay.io/testcontainers/dind-drone-plugin
environment:
CI_WORKSPACE: "/drone/src"
settings:
build_image: mcr.microsoft.com/dotnet/sdk:9.0-alpine
cmd:
- dotnet test --no-build
volumes:
- name: dockersock
path: /var/run
depends_on:
- compile (.NET)
- name: docker build and push
image: docker:24.0.7
commands:
- $dockerImageWithTag = "$docker_registry$docker_repo:$DRONE_BRANCH"
- docker build . -t $dockerImageWithTag
- echo $docker_password | docker login --username $docker_username --password-stdin $docker_registry
- docker push $dockerImageWithTag
- echo "Built and pushed $dockerImageWithTag"
environment:
docker_username:
from_secret: docker_username
docker_password:
from_secret: docker_password
docker_repo:
from_secret: docker_repo
docker_registry:
from_secret: docker_registry
volumes:
- name: dockersock
path: /var/run
when:
branch:
- main
- production
event:
exclude:
- pull_request
depends_on:
- compile (.NET)
- test
- name: Telegram notification
image: appleboy/drone-telegram
settings:
token:
from_secret: telegram_token
to:
from_secret: telegram_user_id
when:
status:
- failure
depends_on:
- compile (.NET)
- compile (Angular)
- test
- docker build and push
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: { }