From c1c374767fcc139f1ba50cd606cd50e04e5131c1 Mon Sep 17 00:00:00 2001 From: Bruce Becker Date: Tue, 5 Jul 2022 17:14:40 +0200 Subject: [PATCH] feat(jenkins): add jenkins configuration as code and consul refactor(jenkins): add artifacts to data dir of allocation chore: remove unused job files fix(jenkins): set prometheus path for health check fix(jenkins): restart plugins job when plugins kv changes feat(jenkins): add prometheus configuration ci: add semantic release to main job Signed-off-by: Bruce Becker --- .github/workflows/main.yml | 6 +- jenkins.nomad | 169 --------------------------------- jenkins/jenkins.nomad | 187 +++++++++++++++++++++++++++++++++++++ jenkins/plugins.txt.tpl | 1 + 4 files changed, 193 insertions(+), 170 deletions(-) delete mode 100644 jenkins.nomad create mode 100644 jenkins/jenkins.nomad create mode 100644 jenkins/plugins.txt.tpl diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5e6d58..1cdfa31 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,13 @@ -name: Release +name: main on: push: branches: - main + pull_request: + branches: + - main jobs: + # start tailscale release: name: Release runs-on: ubuntu-latest diff --git a/jenkins.nomad b/jenkins.nomad deleted file mode 100644 index 20ad06d..0000000 --- a/jenkins.nomad +++ /dev/null @@ -1,169 +0,0 @@ -job "jenkins-java" { - datacenters = ["dc1"] - priority = 100 - type = "service" - - constraint { - attribute = "${attr.cpu.arch}" - value = "arm" - } - - update { - max_parallel = 1 - min_healthy_time = "20m" - healthy_deadline = "30m" - progress_deadline = "40m" - auto_revert = false - canary = 1 - } - - migrate { - max_parallel = 2 - } - - group "jenkins" { - count = 1 - - network { - port "server" { - static = 8080 - } - } - - ephemeral_disk { - sticky = true - migrate = true - size = 1000 - } - - task "prepare-plugin-ref" { - lifecycle { - hook = "prestart" - sidecar = false - } - - resources { - cores = 1 - memory = 1024 - } - - artifact { - source = "https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.9.0/jenkins-plugin-manager-2.9.0.jar" - destination = "local/jenkins-plugin-manager.jar" - mode = "file" - } - - artifact { - source = "https://get.jenkins.io/war-stable/2.289.1/jenkins.war" - destination = "local/jenkins.war" - mode = "file" - } - - driver = "raw_exec" - - config { - command = "java" - args = ["-jar", "local/jenkins-plugin-manager.jar", "--verbose", "--war", "local/jenkins.war", "-p", "blueocean blueocean-commons blueocean-config blueocean-core-js blueocean-dashboard blueocean-display-url blueocean-events blueocean-git-pipeline blueocean-github-pipeline blueocean-i18n blueocean-jwt blueocean-personalization blueocean-pipeline-api-impl blueocean-pipeline-editor blueocean-pipeline-scm-api blueocean-rest blueocean-rest-impl blueocean-web branch-api configuration-as-code credentials credentials-binding dashboard-view display-url-api durable-task github github-api github-autostatus github-branch-source greenballs hashicorp-vault-pipeline hashicorp-vault-plugin job-dsl metrics monitoring pipeline-build-step pipeline-github pipeline-github-lib pipeline-githubnotify-step pipeline-graph-analysis pipeline-milestone-step pipeline-model-api pipeline-model-definition pipeline-model-extensions pipeline-rest-api pipeline-stage-step pipeline-stage-tags-metadata pipeline-stage-view pipeline-utility-steps trilead-api workflow-api workflow-basic-steps workflow-cps workflow-cps-global-lib workflow-durable-task-step workflow-job workflow-multibranch workflow-scm-step workflow-step-api workflow-support", "-d", "local/plugins"] - } - } - - task "jenkins-controller" { - driver = "raw_exec" - - service { - name = "jenkins-java-controller" - tags = ["jenkins", "ci"] - port = "server" - - check { - path = "/login" - name = "alive" - type = "tcp" - interval = "60s" - timeout = "10s" - port = "server" - } - } - - config { - command = "java" - - args = [ - "-jar", - "local/jenkins.war", - "-Xmx2048m", - "-Xms256m", - "-Dhudson.footerURL=https://hashiatho.me", - "-Dhudson.model.WorkspaceCleanupThread.disabled=true", - "-Dhudson.slaves.ConnectionActivityMonitor.timeToPing=30000", - "-Djenkins.install.runSetupWizard=false", - "-Djenkins.security.SystemReadPermission=true", - "-Djenkins.ui.refresh=true", - ] - } - - artifact { - source = "https://get.jenkins.io/war-stable/2.289.1/jenkins.war" - destination = "local/jenkins.war" - } - - logs { - max_files = 10 - max_file_size = 15 - } - - // volume_mount { - // volume = "casc" - // destination = "/jenkins_casc" - // read_only = true - // } - template { - data = <