From 4f083ea166882cc2dc0dfefa7ae0ea0abe0fc6b1 Mon Sep 17 00:00:00 2001 From: Robert Oleynik Date: Wed, 4 Jun 2025 15:05:46 +0200 Subject: [PATCH] remove cronut --- .github/workflows/main.yml | 1 - cronut/Dockerfile | 31 ------------------------------- cronut/README.md | 33 --------------------------------- cronut/database.yml | 23 ----------------------- cronut/entrypoint.sh | 20 -------------------- 5 files changed, 108 deletions(-) delete mode 100644 cronut/Dockerfile delete mode 100644 cronut/README.md delete mode 100644 cronut/database.yml delete mode 100755 cronut/entrypoint.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a75edf7..8bb674e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,6 @@ jobs: strategy: matrix: app: - - cronut - duply - events-relay - ansible diff --git a/cronut/Dockerfile b/cronut/Dockerfile deleted file mode 100644 index 3c781f4..0000000 --- a/cronut/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM alpine:3.7 as clone-cronut - -WORKDIR / -RUN apk --no-cache add git -RUN git clone https://github.com/harrystech/cronut.git - -FROM ruby:2.5.7-alpine3.10 - -RUN mkdir /cronut -WORKDIR /cronut -COPY --from=clone-cronut /cronut . - -RUN apk --no-cache add build-base nodejs postgresql-dev sqlite-dev -RUN bundle install - -ENV CRONUT_BASE_TIME_ZONE Europe/Berlin -RUN apk --no-cache add tzdata \ - && cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime \ - && echo "Europe/Berlin" > /etc/timezone - -COPY database.yml config/database.yml - -ENV RAILS_ENV production -RUN bundle exec rake db:create -RUN bundle exec rake db:migrate - -ENV PORT 80 -ENV TOKEN token -EXPOSE 80 -COPY entrypoint.sh entrypoint.sh -CMD ./entrypoint.sh diff --git a/cronut/README.md b/cronut/README.md deleted file mode 100644 index b1eaa29..0000000 --- a/cronut/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# cronut - -Docker image for [cronut](https://github.com/harrystech/cronut). - -![Docker Hub Badge](http://dockeri.co/image/scalableminds/cronut) - -This currently uses sqlite to simplify the setup. - -## Usage: -``` -docker run -ti --rm -p 3000:80 -e SECRET_KEY_BASE= cronut -``` - -Go to [localhost:3000](http://localhost:3000), add a job. -Note the `Ping ID` of the job. - -To ping cronut for this job, send a post request: -``` -curl --header "X-CRONUT-API-TOKEN: token" -X POST -F "public_id=$(date +%s)-" localhost:3000/ping -``` - -## API: -You can set those environment variables: - -|env var |default | -|--- |--- | -|`SECRET_KEY_BASE` |:warning: | -|`TOKEN` |token | -|`PORT` |80 | -|`RAILS_ENV` |production | -|`CRONUT_BASE_TIME_ZONE`|Europe/Berlin| - -To change the system timezone, check the commands used in the Dockerfile. diff --git a/cronut/database.yml b/cronut/database.yml deleted file mode 100644 index 370d75e..0000000 --- a/cronut/database.yml +++ /dev/null @@ -1,23 +0,0 @@ -development: - adapter: sqlite3 - database: db/development.sqlite3 - pool: 5 - timeout: 5000 - -staging: - adapter: sqlite3 - database: db/staging.sqlite3 - pool: 5 - timeout: 5000 - -test: - adapter: sqlite3 - database: db/test<%= ENV['TEST_ENV_NUMBER'] %>.sqlite3 - pool: 5 - timeout: 5000 - -production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 diff --git a/cronut/entrypoint.sh b/cronut/entrypoint.sh deleted file mode 100755 index 2a27115..0000000 --- a/cronut/entrypoint.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh -set -euo pipefail - -ruby <<'EOF' -require "./config/environment.rb" - -token_name = "default" -token_string = ENV["TOKEN"] -token = ApiToken.find_by_name(token_name) - -if token.nil? - ApiToken.create!({name: token_name, token: token_string}) -else - token.update_attribute(:token, token_string) -end -puts ApiToken.find_by_name(token_name).token -EOF - -bundle exec clockwork lib/clock.rb & -exec bundle exec rails server -p $PORT --binding 0.0.0.0