Skip to content

Commit

Permalink
Jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmod committed Dec 16, 2024
1 parent e2b7c19 commit b996589
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
deno 2.1.4
awscli 2.10.0
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM debian:latest

COPY --from=denoland/deno:bin-2.1.4 /deno /usr/local/bin/deno

COPY --from=amazon/aws-cli:2.10.0 /usr/local/aws-cli/ /usr/local/aws-cli/
ENV PATH="/usr/local/aws-cli/v2/current/bin:${PATH}"

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
curl \
&& \
rm -rf /var/lib/apt/lists/* && \
rm -f /var/cache/apt/*.bin
40 changes: 40 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
pipeline {
agent none

options {
disableConcurrentBuilds()
timeout(unit: 'MINUTES', time: 10)
}

triggers {
cron('0,30 * * * *')
}

stages {
stage('deploy') {
agent {
dockerfile {
label 'docker'
filename 'Dockerfile'
}
}
environment {
// AWS = credentials('adblocker-filters-updater')
// SLACK_API_KEY = credentials('c2bd0cc1-529c-4c00-8aa3-c42327175376')
// BUNNY_API_KEY = credentials('b3af5886-714c-4ccf-8a5c-db120d60cf18')
AWS_REGION = 'us-east-1'
}
steps {
// sh 'deno run config:generate'
sh '''deno run --allow-net --allow-write ./src/config/generate.ts'''
// sh 'curl -X POST -H "AccessKey: $BUNNY_API_KEY" "https://api.bunny.net/purge?async=false&url=https%3A%2F%2Fcdn.ghostery.com%2Fadblocker%2Fconfigs%2F%2A"'
// sh 'curl -X POST -H "AccessKey: $BUNNY_API_KEY" "https://api.bunny.net/purge?async=false&url=https%3A%2F%2Fcdn.ghostery.com%2Fadblocker%2F%2A%2Fmetadata.json"'
}
post{
failure{
sh 'curl -H "Authorization: Bearer $SLACK_API_KEY" https://slack.com/api/chat.postMessage -d "channel=C03M3895D71" -d "text=JOB FAILED: $JOB_NAME $BUILD_URL"'
}
}
}
}
}
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"tasks": {
"config:generate": "deno run --allow-net ./src/config/generate.ts",
"config:generate": "deno run --allow-net --allow-write ./src/config/generate.ts",
"build": "deno run -R -W ./src/build.js",
"lint": "deno fmt --check ./src ./test",
"tests": "deno test --allow-read"
},
"imports": {
"@std/path": "jsr:@std/path@^1.0.8",
"octokit": "npm:octokit@^4.0.2",
"tldts": "npm:tldts@^6.1.68"
}
Expand Down
2 changes: 2 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b996589

Please sign in to comment.