make a jenkinsfile
This commit is contained in:
parent
0a2d7314b6
commit
e79ea8040e
|
@ -1,33 +1,40 @@
|
|||
pipeline {
|
||||
agent any
|
||||
agent {
|
||||
label 'agent1-pi501'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
stage("verify tooling") {
|
||||
steps {
|
||||
echo 'Building from Docker Compose...'
|
||||
step(
|
||||
[
|
||||
$class: 'DockerBuilderPublisher',
|
||||
cleanImages: false,
|
||||
cleanupWithJenkinsJobDelete: false,
|
||||
cloud: '',
|
||||
dockerFileDirectory: '',
|
||||
fromRegistry: [url: 'docker-registry1.in.thelinuxpro.net:5000'],
|
||||
pushCredentialsId: '',
|
||||
pushOnSuccess: false,
|
||||
tagsString: ''
|
||||
]
|
||||
)
|
||||
sh '''
|
||||
docker version
|
||||
docker info
|
||||
docker compose version
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Push to Registry') {
|
||||
|
||||
stage("Build Containers and push to registry") {
|
||||
sh 'docker compose build --push'
|
||||
}
|
||||
|
||||
stage('Start primary container') {
|
||||
steps {
|
||||
echo('docker push [disabled]')
|
||||
sh '''
|
||||
if [[ $(docker compose ps | wc -l) -eq 1 ]]; then
|
||||
docker compose up -d --no-color primary
|
||||
else
|
||||
docker compose down primary
|
||||
docker compose up -d --no-color primary
|
||||
fi
|
||||
'''
|
||||
sh 'docker compose ps'
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
|
||||
stage('Run tests against the container') {
|
||||
steps {
|
||||
echo 'Deploying....'
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue