add jenkinsfile and update docker compose with ip

This commit is contained in:
Kameron Kenny 2024-06-06 11:02:25 -04:00
parent b5811c1270
commit 0e3af57e5e
No known key found for this signature in database
GPG Key ID: E5006629839D2276
3 changed files with 52 additions and 5 deletions

40
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,40 @@
pipeline {
agent {
label 'pi501.in.thelinuxpro.net'
}
stages {
stage("verify tooling") {
steps {
sh '''
docker version
docker info
docker compose version
'''
}
}
stage('Create contexts') {
steps {
sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"'
}
}
stage('Start container') {
steps {
script {
def status_s = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml')
//if (status_s != 0) {
sh 'docker --context pi502 compose up -d'
sh 'docker --context pi502 compose ps'
//} else {
// echo 'skip'
//}
}
}
}
}
}

View File

@ -1,3 +1,7 @@
networks:
infra_dev_net:
external: true
services:
pihole-exporter:
container_name: pihole-exporter
@ -16,4 +20,7 @@ services:
interval: 300s
retries: 5
timeout: 10s
restart: always
restart: unless-stopped
networks:
infra_dev_net:
ipv4_address: 10.99.23.34

View File

@ -1,4 +1,4 @@
PIHOLE_HOSTNAME=pihole # Chage to PiHole's IP address or FQDN
PIHOLE_PASSWORD=MyStrongPassword # Change to your PiHole's password
INTERVAL=90s
PORT=9617
PIHOLE_HOSTNAME=dns01.in.thelinuxpro.net,dns02.in.thelinuxpro.net
PIHOLE_PASSWORD=forty6and2
INTERVAL=15s
PORT=9617