kind: pipeline type: docker name: default steps: - name: build image: mcr.microsoft.com/dotnet/sdk:7.0 commands: - apt-get update - apt-get install --yes openjdk-11-jre - dotnet tool install --global dotnet-sonarscanner - export PATH="$PATH:$HOME/.dotnet/tools" - dotnet sonarscanner begin /k:"my-weather-app" /d:sonar.login="$SONAR_TOKEN" /d:"sonar.host.url=$SONAR_HOST_URL" - dotnet build - dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN" - dotnet publish -c Release -o ./publish - name: image image: plugins/docker settings: registry: registry.devops.cargostart.tech repo: registry.devops.cargostart.tech/my-weather-api tags: latest username: from_secret: registry_username password: from_secret: registry_password - name: deploy image: appleboy/drone-ssh settings: host: devops.cargostart.tech port: 2222 username: swarm key: from_secret: swarm_ssh_key script: - docker service update --image registry.devops.cargostart.tech/my-weather-api:latest weather_app --with-registry-auth trigger: event: - push - pull_request