personal_api/.drone.yml
Conner McCall 892015e684
Some checks failed
continuous-integration/drone/push Build is failing
fixed duplicate step name
2020-08-06 08:40:03 -05:00

40 lines
1 KiB
YAML

---
kind: pipeline
type: docker
name: default
steps:
- name: build
image: atlassian/default-image:2
when:
branch:
- main
commands:
- mkdir -p ~/.aws/
- 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: tag
image: atlassian/default-image:2
when:
event:
- tag
commands:
- mkdir -p ~/.aws/
- 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