Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build_Push

on:
push:
branches:
- main

permissions:
contents: read
packages: write

jobs:
docker_build_test:
runs-on: ubuntu-24.04
name: Docker_build
steps:
- uses: actions/checkout@v4

- name: Build the Docker image
run: docker build -t ghcr.io/gabrielpalmar/hivebox:$(cat version.txt) .

- name: Push Docker image to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/gabrielpalmar/hivebox:$(cat version.txt)
4 changes: 2 additions & 2 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file docker/Dockerfile --tag pommed3rre/hivebox:$(cat version.txt)
run: docker build -t gabrielpalmar/hivebox:$(cat version.txt) .

- name: Run Docker container
run: docker run -d -p 5000:5000 pommed3rre/hivebox:$(cat version.txt)
run: docker run -d -p 5000:5000 gabrielpalmar/hivebox:$(cat version.txt)

- name: Set up Python for testing
uses: actions/setup-python@v5
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ permissions:
contents: read

jobs:
hadolint:
hadolint-linting:
runs-on: ubuntu-24.04
name: Hadolint
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: docker/Dockerfile
dockerfile: Dockerfile
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/env
/__pycache__
/out.txt
/tests/__pycache__
2 changes: 1 addition & 1 deletion docker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN addgroup -S appgroup && adduser -S -G appgroup appuser

WORKDIR /app

COPY app/ /app/app/
COPY /app/ /app/app/
COPY version.txt requirements.txt /app/

RUN pip install --no-cache-dir -r /app/requirements.txt --require-hashes && \
Expand Down
31 changes: 31 additions & 0 deletions k8s/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: hivebox
labels:
app: hivebox
spec:
replicas: 2
selector:
matchLabels:
app: hivebox
template:
metadata:
labels:
app: hivebox
spec:
containers:
- name: hivebox
image: ghcr.io/gabrielpalmar/hivebox:latest
ports:
- containerPort: 5000
env:
- name: FLASK_ENV
value: "production"
resources:
limits:
memory: "512Mi"
cpu: "500m"
requests:
memory: "256Mi"
cpu: "250m"
14 changes: 14 additions & 0 deletions k8s/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: hivebox-service
labels:
app: hivebox
spec:
selector:
app: hivebox
ports:
- port: 80
targetPort: 5000
protocol: TCP
type: LoadBalancer
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'''This module contains the test cases for the main module.'''
'''This module contains the test cases for the main module with VCR cassettes.'''
import sys
import re
import os
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.4.0