Merge pull request 'migrated to crond' (#26) from dev-migrate-to-crond into main
All checks were successful
ci / docker (push) Successful in 39s
All checks were successful
ci / docker (push) Successful in 39s
Reviewed-on: #26
This commit was merged in pull request #26.
This commit is contained in:
77
.drone.yml
77
.drone.yml
@@ -1,77 +0,0 @@
|
||||
kind: pipeline
|
||||
name: default
|
||||
steps:
|
||||
- name: docker
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: git.jonb.io
|
||||
dry_run: false
|
||||
username: jblu
|
||||
password:
|
||||
from_secret: gittea_drone
|
||||
repo: git.jonb.io/jblu/crane
|
||||
tags:
|
||||
- latest
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
- name: docker-test
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: git.jonb.io
|
||||
dry_run: false
|
||||
username: jblu
|
||||
password:
|
||||
from_secret: gittea_drone
|
||||
repo: git.jonb.io/jblu/crane
|
||||
tags:
|
||||
- dev
|
||||
when:
|
||||
branch:
|
||||
- dev*
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
- name: test-main
|
||||
image: git.jonb.io/jblu/crane:latest
|
||||
environment:
|
||||
CRANE_HOST:
|
||||
from_secret: CRANE_HOST
|
||||
CRANE_PORT:
|
||||
from_secret: CRANE_PORT
|
||||
CRANE_ENDPOINT:
|
||||
from_secret: CRANE_ENDPOINT
|
||||
commands:
|
||||
- echo $CRANE_HOST
|
||||
- echo $CRANE_PORT
|
||||
- echo $CRANE_ENDPOINT
|
||||
- python test_crane.py
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
- name: test-dev
|
||||
image: git.jonb.io/jblu/crane:dev
|
||||
environment:
|
||||
CRANE_HOST:
|
||||
from_secret: CRANE_HOST
|
||||
CRANE_PORT:
|
||||
from_secret: CRANE_PORT
|
||||
CRANE_ENDPOINT:
|
||||
from_secret: CRANE_ENDPOINT
|
||||
commands:
|
||||
- echo $CRANE_HOST
|
||||
- echo $CRANE_PORT
|
||||
- echo $CRANE_ENDPOINT
|
||||
- python test_crane.py
|
||||
when:
|
||||
branch:
|
||||
- dev*
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
30
.gitea/workflows/docker-dev.yml
Normal file
30
.gitea/workflows/docker-dev.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev*
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.jonb.io
|
||||
username: '${{ gitea.actor }}'
|
||||
password: '${{ secrets.JONBIO_CI }}'
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
push: true
|
||||
tags: git.jonb.io/jblu/crane:dev
|
||||
30
.gitea/workflows/docker.yml
Normal file
30
.gitea/workflows/docker.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.jonb.io
|
||||
username: '${{ gitea.actor }}'
|
||||
password: '${{ secrets.JONBIO_CI }}'
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
push: true
|
||||
tags: git.jonb.io/jblu/crane:latest
|
||||
@@ -1,7 +1,6 @@
|
||||
FROM python:alpine3.18
|
||||
FROM python:alpine3.23
|
||||
WORKDIR /
|
||||
COPY . opt
|
||||
RUN apk add --no-cache supercronic
|
||||
COPY *.py entrypoint.sh /opt/
|
||||
RUN pip install requests
|
||||
RUN chmod +x /opt/entrypoint.sh
|
||||
CMD ["/opt/entrypoint.sh"]
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
CRON_CONFIG_FILE="/opt/crontab"
|
||||
CRON_CONFIG_FILE="/etc/crontabs/root"
|
||||
|
||||
echo "${CRON} python /opt/crane.py" > $CRON_CONFIG_FILE
|
||||
echo "${CRON} python /opt/crane.py" >> $CRON_CONFIG_FILE
|
||||
echo "@reboot python /opt/crane.py" >> $CRON_CONFIG_FILE
|
||||
|
||||
exec supercronic -passthrough-logs -quiet $CRON_CONFIG_FILE
|
||||
exec crond -f
|
||||
Reference in New Issue
Block a user