Skip to content

Commit

Permalink
enable docker image release
Browse files Browse the repository at this point in the history
  • Loading branch information
gluckzhang committed Jul 13, 2023
1 parent 160377b commit 7ca6f0f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 21 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
branches: [ "main" ]

Expand Down Expand Up @@ -37,3 +35,24 @@ jobs:
# - name: Test with pytest
# run: |
# pytest

docker-release:

runs-on: ubuntu-latest

needs: [build]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: opensourceelectrolux/aws-cost-exporter:${{ github.ref_name }}

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM python:3.10.11-alpine
ENV APP_HOME /app
WORKDIR /

COPY ./build /
COPY ./app *.py package.json requirements.txt /
RUN pip install -r requirements.txt

ENV PYTHONUNBUFFERED 1
Expand Down
13 changes: 0 additions & 13 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Modify the `exporter_config.yaml` file first, then use one of the following meth
### Docker

```
docker run --rm -v ./exporter_config.yaml:/app/exporter_config.yaml -p 9090:9090 -e AWS_ACCESS_KEY=${AWS_ACCESS_KEY} -e AWS_ACCESS_SECRET=${AWS_ACCESS_SECRET} opensourceelectrolux/finops-aws-cost-exporter:1.0.0
docker run --rm -v ./exporter_config.yaml:/app/exporter_config.yaml -p 9090:9090 -e AWS_ACCESS_KEY=${AWS_ACCESS_KEY} -e AWS_ACCESS_SECRET=${AWS_ACCESS_SECRET} opensourceelectrolux/finops-aws-cost-exporter:v1.0.0
```

### Kubernetes
Expand Down
4 changes: 2 additions & 2 deletions deployment/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
app.kubernetes.io/name: aws-cost-exporter
app.kubernetes.io/part-of: finops
app.kubernetes.io/component: backend
app.kubernetes.io/version: "1.0.0"
app.kubernetes.io/version: "v1.0.0"
app.kubernetes.io/language: python
spec:
replicas: 1
Expand All @@ -24,7 +24,7 @@ spec:
spec:
containers:
- name: aws-cost-exporter
image: "opensourceelectrolux/finops-aws-cost-exporter:1.0.0"
image: "opensourceelectrolux/finops-aws-cost-exporter:v1.0.0"
command: [ "python", "main.py", "-c", "/exporter_config.yaml" ]
imagePullPolicy: Always
env:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "aws-cost-exporter",
"version": "1.0.0"
"version": "v1.0.0"
}

0 comments on commit 7ca6f0f

Please sign in to comment.