adding ci/cd
Some checks reported errors
continuous-integration/drone/tag Build encountered an error
Some checks reported errors
continuous-integration/drone/tag Build encountered an error
This commit is contained in:
parent
bef1ae3f92
commit
5a3ab579a9
1 changed files with 38 additions and 0 deletions
38
.drone.yml
Normal file
38
.drone.yml
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: atlassian/default-image:2
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
commands:
|
||||||
|
- echo $AWS_CREDS | base64 -d > ~/.aws/credentials
|
||||||
|
- aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_URL
|
||||||
|
- docker build . -t $ECR_URL/home_api:latest
|
||||||
|
- docker push $ECR_URL/home_api:latest
|
||||||
|
environment:
|
||||||
|
AWS_CREDS:
|
||||||
|
from_secret: AWS_CREDS
|
||||||
|
ECR_URL:
|
||||||
|
from_secret: ECR_URL
|
||||||
|
- name: build
|
||||||
|
image: atlassian/default-image:2
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
commands:
|
||||||
|
- echo $AWS_CREDS | base64 -d > ~/.aws/credentials
|
||||||
|
- aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_URL
|
||||||
|
- docker build . -t $ECR_URL/home_api:$DRONE_TAG
|
||||||
|
- docker build . -t $ECR_URL/home_api:latest
|
||||||
|
- docker push $ECR_URL/home_api:$DRONE_TAG
|
||||||
|
- docker build . -t $ECR_URL/home_api:latest
|
||||||
|
environment:
|
||||||
|
AWS_CREDS:
|
||||||
|
from_secret: AWS_CREDS
|
||||||
|
ECR_URL:
|
||||||
|
from_secret: ECR_URL
|
||||||
Loading…
Add table
Reference in a new issue