From f6fb77d8362b641ba84aec4ed24a1a3f7e103daf Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 18:37:22 +0100 Subject: [PATCH 01/10] Change DockerHub repo --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 45030f6..1cae502 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ node { /* This builds the actual image; synonymous to * docker build on the command line */ - app = docker.build("brokenfire/testjenkins","--rm=true .") + app = docker.build("brokenfire/brokendiscordbot","--rm=true .") } stage('Push image') { /* Finally, we'll push the image with two tags: From 5a5b4ba39850e9d1652f0a1dc61497fadbd85fc0 Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 19:10:39 +0100 Subject: [PATCH 02/10] Edit jenkinsfile --- Jenkinsfile | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1cae502..92a5357 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,14 +1,28 @@ -node { - def app - stage('Clone') { // for display purposes - // Get some code from a GitHub repository - git 'https://github.com/BrokenFire/BrokenDiscordBot.git' - } - stage('Build image') { - /* This builds the actual image; synonymous to - * docker build on the command line */ +pipeline { + agent any - app = docker.build("brokenfire/brokendiscordbot","--rm=true .") + stages { + def app + stage('Clone') { // for display purposes + // Get some code from a GitHub repository + git 'https://github.com/BrokenFire/BrokenDiscordBot.git' + } + stage('Build image') { + /* This builds the actual image; synonymous to + * docker build on the command line */ + + app = docker.build("brokenfire/brokendiscordbot","--rm=true .") + } + stage('Push image') { + /* Finally, we'll push the image with two tags: + * First, the incremental build number from Jenkins + * Second, the 'latest' tag. + * Pushing multiple tags is cheap, as all the layers are reused. */ + app.push() + } + stage('Cleaning'){ + sh "docker image prune -f" + } } stage('Push image') { /* Finally, we'll push the image with two tags: From d384f2e7fe06de73dcf40199f74e6a0cc6b848e8 Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 19:15:37 +0100 Subject: [PATCH 03/10] - --- Jenkinsfile | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 92a5357..0535d2b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,35 +4,32 @@ pipeline { stages { def app stage('Clone') { // for display purposes - // Get some code from a GitHub repository - git 'https://github.com/BrokenFire/BrokenDiscordBot.git' + steps{ + // Get some code from a GitHub repository + git 'https://github.com/BrokenFire/BrokenDiscordBot.git' + } + } stage('Build image') { - /* This builds the actual image; synonymous to - * docker build on the command line */ + steps { + /* This builds the actual image; synonymous to + * docker build on the command line */ - app = docker.build("brokenfire/brokendiscordbot","--rm=true .") + app = docker.build("brokenfire/brokendiscordbot","--rm=true .") + } } stage('Push image') { - /* Finally, we'll push the image with two tags: - * First, the incremental build number from Jenkins - * Second, the 'latest' tag. - * Pushing multiple tags is cheap, as all the layers are reused. */ - app.push() + steps { + + /* Finally, we'll push the image with two tags: + * First, the incremental build number from Jenkins + * Second, the 'latest' tag. + * Pushing multiple tags is cheap, as all the layers are reused. */ + app.push("devel") + } } stage('Cleaning'){ sh "docker image prune -f" } } - stage('Push image') { - /* Finally, we'll push the image with two tags: - * First, the incremental build number from Jenkins - * Second, the 'latest' tag. - * Pushing multiple tags is cheap, as all the layers are reused. */ - app.push("devel") - - } - stage('Cleaning'){ - sh "docker image prune -f" - } } From 28c4ff34d2cac548d5f3f772d34a18f62bc539e6 Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 19:17:23 +0100 Subject: [PATCH 04/10] - --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0535d2b..636b80f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,9 +2,9 @@ pipeline { agent any stages { - def app stage('Clone') { // for display purposes steps{ + def app // Get some code from a GitHub repository git 'https://github.com/BrokenFire/BrokenDiscordBot.git' } From 7f8b928fabea20129ae28ed9c3727239e835db1e Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 19:20:14 +0100 Subject: [PATCH 05/10] - --- Jenkinsfile | 51 ++++++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 636b80f..9428b2c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,35 +1,24 @@ -pipeline { - agent any +node { + def app + stage('Clone') { // for display purposes + // Get some code from a GitHub repository + git 'https://github.com/BrokenFire/BrokenDiscordBot.git' + } + stage('Build image') { + /* This builds the actual image; synonymous to + * docker build on the command line */ - stages { - stage('Clone') { // for display purposes - steps{ - def app - // Get some code from a GitHub repository - git 'https://github.com/BrokenFire/BrokenDiscordBot.git' - } + app = docker.build("brokenfire/brokendiscordbot","--rm=true .") + } + stage('Push image') { + /* Finally, we'll push the image with two tags: + * First, the incremental build number from Jenkins + * Second, the 'latest' tag. + * Pushing multiple tags is cheap, as all the layers are reused. */ + app.push("devel") - } - stage('Build image') { - steps { - /* This builds the actual image; synonymous to - * docker build on the command line */ - - app = docker.build("brokenfire/brokendiscordbot","--rm=true .") - } - } - stage('Push image') { - steps { - - /* Finally, we'll push the image with two tags: - * First, the incremental build number from Jenkins - * Second, the 'latest' tag. - * Pushing multiple tags is cheap, as all the layers are reused. */ - app.push("devel") - } - } - stage('Cleaning'){ - sh "docker image prune -f" - } + } + stage('Cleaning'){ + sh "docker image prune -f" } } From bb2205593cb9300b9c892f7d3170eef4e15d252a Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 19:38:42 +0100 Subject: [PATCH 06/10] - --- Jenkinsfile | 57 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9428b2c..eaa7e95 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,24 +1,39 @@ -node { - def app - stage('Clone') { // for display purposes - // Get some code from a GitHub repository - git 'https://github.com/BrokenFire/BrokenDiscordBot.git' - } - stage('Build image') { - /* This builds the actual image; synonymous to - * docker build on the command line */ - app = docker.build("brokenfire/brokendiscordbot","--rm=true .") - } - stage('Push image') { - /* Finally, we'll push the image with two tags: - * First, the incremental build number from Jenkins - * Second, the 'latest' tag. - * Pushing multiple tags is cheap, as all the layers are reused. */ - app.push("devel") +pipeline { + agent any + stages { + + stage('Clone') { + node{ + def app + // for display purposes + // Get some code from a GitHub repository + git 'https://github.com/BrokenFire/BrokenDiscordBot.git' + } + + } + stage('Build image') { + /* This builds the actual image; synonymous to + * docker build on the command line */ + node{ + app = docker.build("brokenfire/brokendiscordbot","--rm=true .") + } + + } + stage('Push image') { + /* Finally, we'll push the image with two tags: + * First, the incremental build number from Jenkins + * Second, the 'latest' tag. + * Pushing multiple tags is cheap, as all the layers are reused. */ + node{ + app.push() + + } + + } + stage('Cleaning'){ + sh "docker image prune -f" + } } - stage('Cleaning'){ - sh "docker image prune -f" - } -} +} From e09915c342661d926b126242ec2435c78cb9e07c Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 19:41:27 +0100 Subject: [PATCH 07/10] - --- Jenkinsfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index eaa7e95..4870f14 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,11 +5,13 @@ pipeline { stages { stage('Clone') { - node{ - def app - // for display purposes - // Get some code from a GitHub repository - git 'https://github.com/BrokenFire/BrokenDiscordBot.git' + steps{ + node{ + def app + // for display purposes + // Get some code from a GitHub repository + git 'https://github.com/BrokenFire/BrokenDiscordBot.git' + } } } From a1e6fd48f6e24b3570cab67a32c5bc2e5598cd58 Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 19:42:41 +0100 Subject: [PATCH 08/10] - --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4870f14..026e53c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { stage('Clone') { steps{ - node{ + step{ def app // for display purposes // Get some code from a GitHub repository From 8da6315679ba061440986f5d4e88d4b5dd32b9af Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Sun, 18 Feb 2018 19:47:25 +0100 Subject: [PATCH 09/10] Finish test on Jenkinsfile --- Jenkinsfile | 63 +++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 026e53c..062f651 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,41 +1,24 @@ - -pipeline { - agent any - - stages { - - stage('Clone') { - steps{ - step{ - def app - // for display purposes - // Get some code from a GitHub repository - git 'https://github.com/BrokenFire/BrokenDiscordBot.git' - } - } - - } - stage('Build image') { - /* This builds the actual image; synonymous to - * docker build on the command line */ - node{ - app = docker.build("brokenfire/brokendiscordbot","--rm=true .") - } - - } - stage('Push image') { - /* Finally, we'll push the image with two tags: - * First, the incremental build number from Jenkins - * Second, the 'latest' tag. - * Pushing multiple tags is cheap, as all the layers are reused. */ - node{ - app.push() - - } - - } - stage('Cleaning'){ - sh "docker image prune -f" - } +node { + def app + stage('Clone') { // for display purposes + // Get some code from a GitHub repository + git 'https://github.com/BrokenFire/BrokenDiscordBot.git' + } + stage('Build image') { + /* This builds the actual image; synonymous to + * docker build on the command line */ + + app = docker.build("brokenfire/brokendiscordbot","--rm=true .") } -} + stage('Push image') { + /* Finally, we'll push the image with two tags: + * First, the incremental build number from Jenkins + * Second, the 'latest' tag. + * Pushing multiple tags is cheap, as all the layers are reused. */ + app.push("devel") + + } + stage('Cleaning'){ + sh "docker image prune -f" + } +} \ No newline at end of file