-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit e380094 Author: Raphael Stäbler <raphael.staebler@productionbuild.de> Date: Sat Aug 26 09:19:22 2023 +0200 Enable all cronjobs commit ff6957e Author: Raphael Stäbler <raphael.staebler@productionbuild.de> Date: Fri Aug 25 20:08:04 2023 +0200 Fix crontab commit 6e705d3 Author: Raphael Stäbler <raphael.staebler@productionbuild.de> Date: Fri Aug 25 18:01:15 2023 +0200 Add support for env variables commit 779f300 Author: Raphael Stäbler <raphael.staebler@productionbuild.de> Date: Fri Aug 25 17:39:29 2023 +0200 Update crontab commit 86480d2 Author: Raphael Stäbler <raphael.staebler@productionbuild.de> Date: Wed Aug 23 18:21:43 2023 +0200 Fix new relic and update docker image commit 1cf8e4c Author: Raphael Stäbler <raphael.staebler@productionbuild.de> Date: Wed Aug 23 10:29:50 2023 +0200 Update for digitalocean deployment commit 4bcadaf Author: Raphael Stäbler <raphael.staebler@productionbuild.de> Date: Fri Aug 25 14:01:34 2023 +0200 Add cleanup tootstats command
- Loading branch information
Showing
20 changed files
with
113 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ARG NEWRELIC_LICENSE_KEY | ||
|
||
WORKDIR /analytodon-cli | ||
|
||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -y cron curl ca-certificates | ||
|
||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs | ||
|
||
# Remove package lists for smaller image sizes | ||
RUN rm -rf /var/lib/apt/lists/* \ | ||
&& which cron \ | ||
&& rm -rf /etc/cron.*/* | ||
|
||
COPY crontab hello-cron | ||
COPY entrypoint.sh entrypoint.sh | ||
COPY package.json package.json | ||
COPY newrelic.js newrelic.js | ||
COPY tsconfig.json tsconfig.json | ||
COPY README.md README.md | ||
COPY bin bin | ||
COPY src src | ||
|
||
RUN npm i typescript | ||
RUN npm run build | ||
|
||
RUN ./bin/run hello analytodon -f "the build process" | ||
|
||
RUN crontab hello-cron | ||
RUN chmod +x entrypoint.sh | ||
|
||
ENTRYPOINT ["/analytodon-cli/entrypoint.sh"] | ||
|
||
# https://manpages.ubuntu.com/manpages/trusty/man8/cron.8.html | ||
# -f | Stay in foreground mode, don't daemonize. | ||
# -L loglevel | Tell cron what to log about jobs (errors are logged regardless of this value) as the sum of the following values: | ||
CMD ["cron","-f", "-L", "2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Analytodon cron jobs | ||
|
||
#*/15 * * * * /analytodon-cli/bin/run hello analytodon -f "the cron tab" | ||
|
||
# analytodon initial stats | ||
* * * * * /analytodon-cli/bin/run fetch initialstats | ||
|
||
# analytodon fetch | ||
35 * * * * /analytodon-cli/bin/run fetch accountstats | ||
35 * * * * /analytodon-cli/bin/run fetch tootstats -a | ||
|
||
# analytodon aggregate | ||
5 * * * * /analytodon-cli/bin/run aggregate dailyaccountstats | ||
5 * * * * /analytodon-cli/bin/run aggregate dailytootstats | ||
|
||
# analytodon weekly mail | ||
0 19,20,21,22,23 * * 0 /analytodon-cli/bin/run mail weeklystats | ||
0 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 * * 1 /analytodon-cli/bin/run mail weeklystats | ||
|
||
# analytodon cleanup | ||
45 11 * * * /analytodon-cli/bin/run cleanup users | ||
46 11 * * * /analytodon-cli/bin/run cleanup usercredentials | ||
47 11 * * * /analytodon-cli/bin/run cleanup accounts | ||
48 11 * * * /analytodon-cli/bin/run cleanup accountdata | ||
40 2 * * * /analytodon-cli/bin/run cleanup tootstats | ||
|
||
# An empty line is required at the end of this file for a valid cron file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
env >> /etc/environment | ||
|
||
# execute CMD | ||
echo "$@" | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
/* eslint-disable */ | ||
const logger = require('pino')(); | ||
const nrPino = require('@newrelic/pino-enricher'); | ||
const pino = require('pino'); | ||
|
||
const logger = pino(nrPino()); | ||
|
||
export {logger}; | ||
/* eslint-enable */ |