forked from nelsonmarcos/newrelic-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c4870c
commit 8137746
Showing
5 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
on: [push] | ||
jobs: | ||
ecr: | ||
runs-on: ubuntu-latest | ||
name: Docker build and push to ECR | ||
env: | ||
## Repository must be in the format '<BU>/<SQUAD>/<PROJECT NAME | MY NAME>' | ||
ECR_REPOSITORY: 'cross/observability/newrelic-migration-exporter' | ||
VERSION: '1.0.0-rc' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# Exemple of build using docker | ||
- name: Docker Build | ||
run: | | ||
docker build --pull -t ${{ secrets.CONTAINER_REGISTRY_HOST }}/$ECR_REPOSITORY:latest . | ||
docker tag ${{ secrets.CONTAINER_REGISTRY_HOST }}/$ECR_REPOSITORY:latest ${{ secrets.CONTAINER_REGISTRY_HOST }}/$ECR_REPOSITORY:$VERSION | ||
- name: Push to ECR | ||
uses: olxbr/aws-ecr-push-action@v1 | ||
id: ecr | ||
with: | ||
# The complete repository name from ECR {BU}/{TEAM}/{PROJECT} (ex. cross/devtools/devtools-scripts). | ||
ecr_repository: 'cross/observability/newrelic-migration-exporter' | ||
# Comma-separated string of ECR image tags (ex. latest, 1.0.0) | ||
tags: 'latest,${{env.VERSION}}' | ||
keep_images: 10 | ||
# Warning! Don't change this env values! | ||
# Just copy and paste this whole block as is in your repo | ||
env: | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_CROSS_ACCOUNT_ID }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CROSS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CROSS_SECRET_ACCESS_KEY }} | ||
AWS_PRINCIPAL_RULES: ${{ secrets.AWS_PRINCIPAL_RULES }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM python | ||
RUN apt update && apt upgrade | ||
COPY . /app | ||
WORKDIR /app | ||
RUN pip install -r requirements.txt | ||
ENTRYPOINT ["python", "query_nr.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
build: | ||
docker build -t cross/observability/newrelic-migration-exporter:$(version) . | ||
|
||
tag-image: | ||
docker tag newrelic-migration-exporter:$(version) 073521391622.dkr.ecr.us-east-1.amazonaws.com/cross/observability/newrelic-migration-exporter:$(version) | ||
|
||
push-image: | ||
docker push 073521391622.dkr.ecr.us-east-1.amazonaws.com/cross/observability/newrelic-migration-exporter:$(version) | ||
|
||
release: build tag-image push-image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters