Added docker login step
This commit is contained in:
14
.drone.yml
14
.drone.yml
@@ -7,7 +7,7 @@ clone:
|
|||||||
disable: true
|
disable: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: manual-clone
|
- name: clone
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
- git clone https://gitea.khongisa.co.za/MngomaLab/webapitest.git .
|
- git clone https://gitea.khongisa.co.za/MngomaLab/webapitest.git .
|
||||||
@@ -19,6 +19,17 @@ steps:
|
|||||||
- dotnet publish --configuration Release
|
- dotnet publish --configuration Release
|
||||||
- ls ./SampleApi/bin/Release/net8.0/publish/
|
- 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
|
||||||
|
- docker info | grep "Registry"
|
||||||
|
|
||||||
- name: docker build and push
|
- name: docker build and push
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
@@ -30,6 +41,7 @@ steps:
|
|||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
context: .
|
context: .
|
||||||
|
force_tag: true
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- ${DRONE_BUILD_NUMBER}
|
- ${DRONE_BUILD_NUMBER}
|
||||||
Reference in New Issue
Block a user