From 2db5be62ba26911048575da7becc83239f02ceb6 Mon Sep 17 00:00:00 2001 From: Osher Cohen Date: Mon, 31 Aug 2020 14:06:47 +0300 Subject: [PATCH] Image build with network=host (#22) Send slack notification Co-authored-by: osher cohen --- Jenkinsfile | 29 +++++++++++++++++------------ Makefile | 2 +- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ce39fd0..3a39e94 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,16 +36,21 @@ pipeline { } } - post { - failure { - script { - if (env.BRANCH_NAME == 'master') - stage('notify master branch fail') { - withCredentials([string(credentialsId: 'slack-token', variable: 'TOKEN')]) { - sh '''curl -X POST -H 'Content-type: application/json' --data '{"text":"Attention! master branch push integration failed, Check $BUILD_URL"}' https://hooks.slack.com/services/${TOKEN}''' - } - } - } - } - } + post { + failure { + script { + if (env.BRANCH_NAME == 'master') + stage('notify master branch fail') { + withCredentials([string(credentialsId: 'slack-token', variable: 'TOKEN')]) { + script { + def data = [text: "Attention! assisted-ignition-generator branch test failed, see: ${BUILD_URL}"] + writeJSON(file: 'data.txt', json: data, pretty: 4) + } + sh '''curl -X POST -H 'Content-type: application/json' --data-binary "@data.txt" https://hooks.slack.com/services/$TOKEN''' + + } + } + } + } + } } \ No newline at end of file diff --git a/Makefile b/Makefile index d6a6182..27ef6c7 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build: skipper build assisted-ignition-generator build-image: - docker build -f Dockerfile.assisted-ignition-generator . -t $(GENERATOR) + docker build --network=host -f Dockerfile.assisted-ignition-generator . -t $(GENERATOR) update: build GIT_REVISION=${GIT_REVISION} docker build --pull --build-arg GIT_REVISION -t $(GENERATOR) -f Dockerfile.assisted-ignition-generator .