Add a jenkinsfile
This commit is contained in:
parent
9caf5c0cf1
commit
12336868b7
1 changed files with 91 additions and 0 deletions
91
Jenkinsfile
vendored
Normal file
91
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,91 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
buildDiscarder(
|
||||
logRotator(
|
||||
numToKeep: '5'
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build on Linux') {
|
||||
agent {
|
||||
label 'linux'
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
sh '''
|
||||
#!/bin/bash
|
||||
|
||||
flutter pub get
|
||||
flutter build linux
|
||||
dart compile exe -o server bin/server.dart
|
||||
|
||||
cd build/linux/x64/release/bundle; tar -cvf ../../../../../client.tgz .
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: 'server'
|
||||
archiveArtifacts artifacts: '*.tgz'
|
||||
|
||||
deleteDir()
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Docker Images') {
|
||||
agent {
|
||||
label 'dockermain'
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
sh '''
|
||||
#!/bin/bash
|
||||
|
||||
docker build -t git.zontreck.com/ariascreations/conanservermanager:builddeps docker_images/builddeps
|
||||
docker push git.zontreck.com/ariascreations/conanservermanager:builddeps
|
||||
|
||||
docker build -t git.zontreck.com/ariascreations/conanservermanager:stable $(pwd)
|
||||
docker push git.zontreck.com/ariascreations/conanservermanager:stable
|
||||
|
||||
docker build -t git.zontreck.com/ariascreations/conanservermanager:installer docker_images/installer
|
||||
docker push git.zontreck.com/ariascreations/conanservermanager:installer
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
deleteDir()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build on Windows') {
|
||||
agent {
|
||||
label 'windows'
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
bat 'flutter pub get'
|
||||
bat 'flutter build windows'
|
||||
bat 'cd build\\windows\\x64\\release\\bundle && tar -cvf ..\\..\\..\\..\\..\\windows.tgz .'
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: '*.tgz'
|
||||
deleteDir()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue