Skip to content
Snippets Groups Projects
Commit d9d4c16f authored by Ben Morrice's avatar Ben Morrice
Browse files

add gitlabci/nomad configuration

parent b341f72d
No related branches found
No related tags found
1 merge request!1initial release
---
include: 'https://gitlab.cern.ch/linuxsupport/cronjobs/base/raw/master/gitlab-ci.yml'
build_stream8_backups:
stage: build
tags:
- docker-image-build
script: "echo" # unused but this line is required by GitLab CI
variables:
CONTEXT_DIR: stream8_backups
TO: $CI_REGISTRY_IMAGE/stream8_backups:$CI_COMMIT_REF_NAME
deploy:
extends: .nomad
stage: deploy
script:
- for j in *.nomad; do echo -e "\n${j}:"; nomad job run <(envsubst < $j); done
only:
- tags
- master
deploy_dev:
extends: .nomad
stage: deploy
script:
- for j in *.nomad; do echo -e "\n${j}:"; nomad job run <(envsubst < $j); done
except:
- tags
- master
when: manual
SCHEDULE="15 9 * * 1"
DATA="/mnt/data1/dist"
PATH_SNAPSHOTS="tmp"
S3_REPOSITORY="s8-backups-testing"
PRUNE_SNAPSHOTS_OLDER_THAN="2d"
EMAIL_FROM="Linux.Support@cern.ch"
EMAIL_ADMIN="morrice@cern.ch"
SCHEDULE="15 9 * * *"
DATA="/mnt/data1/dist"
PATH_SNAPSHOTS="cern/centos"
S3_REPOSITORY="s8-backups-production"
PRUNE_SNAPSHOTS_OLDER_THAN="730d"
EMAIL_FROM="Linux.Support@cern.ch"
EMAIL_ADMIN="lxsoft-admins@cern.ch"
job "${PREFIX}_stream8_backups" {
datacenters = ["meyrin"]
type = "batch"
periodic {
cron = "${SCHEDULE}"
time_zone = "Europe/Zurich"
prohibit_overlap = false
}
reschedule {
attempts = 276
interval = "23h"
unlimited = false
delay = "5m"
delay_function = "constant"
}
task "${PREFIX}_stream8_backups" {
driver = "docker"
config {
image = "https://gitlab-registry.cern.ch/linuxsupport/cronjobs/stream8_backups/stream8_backups:${CI_COMMIT_REF_NAME}"
force_pull = ${FORCE_PULL}
logging {
config {
tag = "${PREFIX}_stream8_backups"
}
}
volumes = [
"$DATA:/data",
]
}
env {
RESTIC_PASSWORD = "$RESTIC_PASSWORD"
AWS_ACCESS_KEY_ID = "$AWS_ACCESS_KEY_ID"
AWS_SECRET_ACCESS_KEY = "$AWS_SECRET_ACCESS_KEY"
RESTIC_REPOSITORY = "s3:s3.cern.ch/$S3_REPOSITORY"
PRUNE_SNAPSHOTS_OLDER_THAN = "$PRUNE_SNAPSHOTS_OLDER_THAN"
PATH_SNAPSHOTS = "$PATH_SNAPSHOTS"
EMAIL_FROM = "$EMAIL_FROM"
EMAIL_ADMIN = "$EMAIL_ADMIN"
NOMAD_ADDR = "$NOMAD_ADDR"
}
resources {
cpu = 6000 # Mhz
memory = 1024 # MB
network {
mbits = 10
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment