Compare commits

..

3 Commits

Author SHA1 Message Date
30026b4e17 update readme [CI SKIP] 2023-05-27 13:42:38 +00:00
580845afe0 add goreleaser [CI SKIP] 2023-05-27 13:40:53 +00:00
d4aa8ff410 update drone behaviour [CI SKIP] 2023-05-27 13:40:44 +00:00
3 changed files with 109 additions and 21 deletions

View File

@ -1,22 +1,86 @@
kind: pipeline
type: docker
name: build-multiarch-images
name: build-release-images
trigger:
event:
exclude:
- pull_request
ref:
- refs/tags/**
platform:
os: linux
arch: amd64
steps:
- name: make-tags
# Set tags for main branch - release tag and 'latest'
- name: make-tags-main
image: node
commands:
- echo -n "${DRONE_COMMIT_SHA:0:10}, latest" > .tags
- echo -n "${DRONE_TAG}, latest" > .tags
- name: build
# Build containers from main branch when released
- name: build-main
image: thegeeklab/drone-docker-buildx
privileged: true
settings:
provenance: false
registry: git.mrmeeb.stream
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: git.mrmeeb.stream/mrmeeb/cronicle
platforms:
- linux/arm64
- linux/amd64
- name: release
image: goreleaser/goreleaser
environment:
GITEA_TOKEN:
from_secret: gitea_token
commands:
- goreleaser release
- name: notify
image: plugins/slack
when:
status:
- success
- failure
settings:
webhook:
from_secret: slack_webhook
---
kind: pipeline
type: docker
name: build-develop-images
trigger:
event:
exclude:
- pull_request
branch:
- develop
platform:
os: linux
arch: amd64
steps:
# Set tags for develop branch - git commit SHA and 'develop'
- name: make-tags-develop
image: node
commands:
- echo -n "${DRONE_COMMIT_SHA:0:8}, develop" > .tags
# Build containers from develop branch
- name: build-develop
image: thegeeklab/drone-docker-buildx
privileged: true
settings:
provenance: false
registry: git.mrmeeb.stream
username:
from_secret: docker_username
@ -35,11 +99,4 @@ steps:
- failure
settings:
webhook:
from_secret: slack_webhook
trigger:
branch:
- main
event:
exclude:
- pull_request
from_secret: slack_webhook

25
.goreleaser.yaml Normal file
View File

@ -0,0 +1,25 @@
build:
skip: true
archives:
- format: binary
release:
draft: true
gitea:
owner: MrMeeb
name: cronicle-docker
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
# .goreleaser.yaml
gitea_urls:
api: https://git.mrmeeb.stream/api/v1
download: https://git.mrmeeb.stream
# set to true if you use a self-signed certificate
skip_tls_verify: false

View File

@ -1,19 +1,16 @@
# Cronicle Docker
[![Build Status](https://drone.mrmeeb.stream/api/badges/MrMeeb/cronicle-docker/status.svg)](https://drone.mrmeeb.stream/MrMeeb/cronicle-docker) - _Every new commit triggers a build. I'm lazy._
Dockerised Cronicle, based on the [Cronicle-Edge](https://github.com/cronicle-edge/cronicle-edge) fork.
Can function in both the **manager** and **worker** role.
## Running
`config.json`, located in `/config/config.json`, is automatically generated on the first run of Cronicle in 'manager' mode. This file must be kept identical between the manager and any workers it controls.
`config.json`, located in `/config/cronicle/conf/config.json`, is automatically generated on the first run of Cronicle in 'manager' mode. This file must be kept identical between the manager and any workers it controls.
If you want to configure Cronicle before first run, download `config_sample.json` and adjust accordingly before placing in `/config/config.json`.
If you want to configure Cronicle before first run (e.g to use a different storage engine), download `config_sample.json` and adjust accordingly before placing in `/config/cronicle/conf/config.json`.
NOTE: You must define the hostname of the container. Cronicle expects the hostname to remain the same, so the randomly-generated container hostname can cause problems if it changes.
:exclamation: NOTE: You must define the hostname of the container. Cronicle expects the hostname to remain the same, so the randomly-generated container hostname can cause problems if it changes. :exclamation:
### Docker CLI
```
@ -21,6 +18,9 @@ docker run -d --name cronicle \
--hostname cronicle-manager \
-p 3012:3012 \
-e MODE=manager \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Europe/London \
-v {path on host}:/config
git.mrmeeb.stream/mrmeeb/cronicle:latest
```
@ -41,11 +41,14 @@ services:
- {path on host}:/config
environment:
- MODE=manager
- PUID=1000
- PGID=1000
- TZ=Europe/London
```
## Custom Scripts
This container automatically checks for scripts in `/config/init` and runs them at startup of the container. This could be useful if you need to install additional applications into a worker container so it can execute any jobs.
This container automatically checks for scripts in `/config/init` and runs them at startup. This could be useful if you need to install additional applications into a worker container so it can execute jobs.
## Ports
@ -62,4 +65,7 @@ This container automatically checks for scripts in `/config/init` and runs them
## Environment Variables
|Variable|Options|Default|Description|
|--------|-------|-------|-------|
|MODE |manager, worker|manager|Determines what mode Cronicle runs in
|MODE |manager, worker|manager|Determines what mode Cronicle runs in
|PUID |int |1000 |Sets the UID of the user Cronicle runs under
|PGID |int |1000 |Sets the GID of the user Cronicle runs under
|TZ |[List of valid TZs](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |UTC |Sets the timezone of the container and by extension Cronicle