add jenkinsfile and update docker compose with ip
This commit is contained in:
parent
b5811c1270
commit
0e3af57e5e
|
@ -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'
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
networks:
|
||||||
|
infra_dev_net:
|
||||||
|
external: true
|
||||||
|
|
||||||
services:
|
services:
|
||||||
pihole-exporter:
|
pihole-exporter:
|
||||||
container_name: pihole-exporter
|
container_name: pihole-exporter
|
||||||
|
@ -16,4 +20,7 @@ services:
|
||||||
interval: 300s
|
interval: 300s
|
||||||
retries: 5
|
retries: 5
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
restart: always
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
infra_dev_net:
|
||||||
|
ipv4_address: 10.99.23.34
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PIHOLE_HOSTNAME=pihole # Chage to PiHole's IP address or FQDN
|
PIHOLE_HOSTNAME=dns01.in.thelinuxpro.net,dns02.in.thelinuxpro.net
|
||||||
PIHOLE_PASSWORD=MyStrongPassword # Change to your PiHole's password
|
PIHOLE_PASSWORD=forty6and2
|
||||||
INTERVAL=90s
|
INTERVAL=15s
|
||||||
PORT=9617
|
PORT=9617
|
||||||
|
|
Loading…
Reference in New Issue