adding ci/cd
Some checks reported errors
continuous-integration/drone/tag Build encountered an error

This commit is contained in:
Conner McCall 2020-08-06 08:31:04 -05:00
parent bef1ae3f92
commit 5a3ab579a9

38
.drone.yml Normal file
View 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