personal_api/.drone.yml
Conner McCall 5a3ab579a9
Some checks reported errors
continuous-integration/drone/tag Build encountered an error
adding ci/cd
2020-08-06 08:31:04 -05:00

38 lines
996 B
YAML

---
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