Refactored pipeline
This commit is contained in:
56
.drone.yml
56
.drone.yml
@@ -1,37 +1,4 @@
|
|||||||
---
|
x-docker-auth: &docker-auth
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: package
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: alpine/git
|
|
||||||
commands:
|
|
||||||
- git clone https://gitea.khongisa.co.za/MngomaLab/webapitest.git .
|
|
||||||
- git checkout ${DRONE_COMMIT}
|
|
||||||
|
|
||||||
- name: dotnet publish
|
|
||||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
||||||
commands:
|
|
||||||
- dotnet publish --configuration Release
|
|
||||||
- ls ./SampleApi/bin/Release/net8.0/publish/
|
|
||||||
|
|
||||||
- name: docker login
|
|
||||||
image: docker:20.10
|
|
||||||
environment:
|
|
||||||
DOCKER_USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
DOCKER_PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
|
||||||
|
|
||||||
- name: build-and-push
|
|
||||||
image: gcr.io/kaniko-project/executor:debug
|
|
||||||
environment:
|
|
||||||
DOCKER_AUTH_CONFIG: |
|
DOCKER_AUTH_CONFIG: |
|
||||||
{
|
{
|
||||||
"auths": {
|
"auths": {
|
||||||
@@ -40,6 +7,27 @@ steps:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: package
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: clone
|
||||||
|
image: alpine/git
|
||||||
|
commands:
|
||||||
|
- git clone https://gitea.khongisa.co.za/MngomaLab/webapitest.git .
|
||||||
|
- git checkout ${DRONE_COMMIT}
|
||||||
|
|
||||||
|
- name: dotnet-publish
|
||||||
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||||
|
commands:
|
||||||
|
- dotnet publish --configuration Release
|
||||||
|
|
||||||
|
- name: build-and-push
|
||||||
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
|
environment:
|
||||||
|
<<: *docker-auth
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p /kaniko/.docker
|
- mkdir -p /kaniko/.docker
|
||||||
- echo "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json
|
- echo "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json
|
||||||
|
|||||||
Reference in New Issue
Block a user