Compare commits
5 Commits
128a1d6854
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d6ef9079b6 | |||
| 5a7aec64ca | |||
| 3354b186c1 | |||
| 1a0e854c75 | |||
| 26f6a6c3a6 |
@@ -3,3 +3,4 @@ include/
|
||||
lib/
|
||||
lib64/
|
||||
pyvenv.cfg
|
||||
.github/
|
||||
40
.github/workflows/ci.yml
vendored
Normal file
40
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
||||
name: Publish Docker Container
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Docker Metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: liamsgit.dev/LiamPietralla/s3-recent-file-cleaner
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: liamsgit.dev
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and Push Docker Image to Registry
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
file: Dockerfile
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM python:3.12-slim AS base
|
||||
FROM python:3.13-slim AS base
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
Simple python script to loop through all files in an S3 Endpoint and delete excess files based on a retention amount.
|
||||
|
||||
Retention ammount: 5
|
||||
Retention amount: 5
|
||||
|
||||
## Development
|
||||
|
||||
Python 3.12 should be used for development and ideally a virtual environment should be used. With the source checked out run the following command to create a virtual environment.
|
||||
|
||||
```bash
|
||||
python3 -m venv ./
|
||||
python3 -m venv .venv
|
||||
```
|
||||
|
||||
The required packages can be installed by running the following command after activating the virtual environment.
|
||||
@@ -29,5 +29,5 @@ pip freeze > requirements.txt
|
||||
The S3 Recent File Cleaner is best run as a once off docker image. The image is already built so can be run with the following command.
|
||||
|
||||
```bash
|
||||
docker run --rm -e S3_ACCESS_KEY=your_access_key -e S3_SECRET_KEY=your_secret_key -e S3_ENDPOINT=your_endpoint s3-recent-file-cleaner
|
||||
docker run --rm -e S3_ACCESS_KEY=your_access_key -e S3_SECRET_KEY=your_secret_key -e S3_ENDPOINT=your_endpoint liamsgit.dev/liampietralla/s3-recent-file-cleaner:latest
|
||||
```
|
||||
@@ -1,7 +1,8 @@
|
||||
boto3==1.35.90
|
||||
botocore==1.35.90
|
||||
boto3==1.41.5
|
||||
botocore==1.41.5
|
||||
jmespath==1.0.1
|
||||
pi==0.1.2
|
||||
python-dateutil==2.9.0.post0
|
||||
s3transfer==0.10.4
|
||||
s3transfer==0.15.0
|
||||
six==1.17.0
|
||||
urllib3==2.3.0
|
||||
urllib3==2.5.0
|
||||
|
||||
Reference in New Issue
Block a user