diff --git a/Jenkinsfile b/Jenkinsfile index b8985ac..43b165c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,16 +6,26 @@ stage('Build') { steps { echo 'Building..' + sh './build.sh' + archiveArtifacts artifacts: 'build/hello*', fingerprint: true } } stage('Test') { steps { echo 'Testing..' + sh 'make test || true' + junit 'build/*.xml' } } stage('Deploy') { + when { + expression { + currentBuild.result == null || currentBuild.result == 'SUCCESS' + } + } steps { - echo 'Deploying....' + echo 'Deploying....' + sh 'make publish' } } } diff --git a/Jenkinsfile b/Jenkinsfile index b8985ac..43b165c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,16 +6,26 @@ stage('Build') { steps { echo 'Building..' + sh './build.sh' + archiveArtifacts artifacts: 'build/hello*', fingerprint: true } } stage('Test') { steps { echo 'Testing..' + sh 'make test || true' + junit 'build/*.xml' } } stage('Deploy') { + when { + expression { + currentBuild.result == null || currentBuild.result == 'SUCCESS' + } + } steps { - echo 'Deploying....' + echo 'Deploying....' + sh 'make publish' } } } diff --git a/Makefile b/Makefile index 9cddf49..80f74c4 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,18 @@ all: - x86_64-linux-gnu-g++ Test.cpp -o Hello-linux-64 - x86_64-w64-mingw32-g++ Test.cpp -o Hello-win64.exe - x86_64-apple-darwin19-c++ Test.cpp -o Hello-macosx.bin + mkdir -p build + x86_64-linux-gnu-g++ Test.cpp -o build/hello-linux-64 + x86_64-w64-mingw32-g++ Test.cpp -o build/hello-win64.exe + x86_64-apple-darwin19-c++ Test.cpp -o build/hello-macosx.bin +test: + mkdir -p build + echo "Blah" > build/tests.xml + + +publish: + echo "Publish..." +