From 9dde1ef03887f0b569b0f9929a88290cb1a29d86 Mon Sep 17 00:00:00 2001 From: TechPrimers Date: Sun, 10 Jun 2018 12:56:42 +0530 Subject: [PATCH 1/8] add new branch for aws deploy testing --- Jenkinsfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c0b4c8..e310c0a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,9 +23,8 @@ pipeline { stage ('Deployment Stage') { steps { - withMaven(maven : 'maven_3_5_0') { - sh 'mvn deploy' - } + sh 'ls -lrt' + sh 'aws s3 ls' } } } -- 2.49.1 From aa6be34cd7de68a45fa60d4dedd4aecd649f8435 Mon Sep 17 00:00:00 2001 From: TechPrimers Date: Sun, 10 Jun 2018 17:38:52 +0530 Subject: [PATCH 2/8] add new branch for aws deploy testing --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e310c0a..bb40321 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { } } - stage ('Testing Stage') { + /* stage ('Testing Stage') { steps { withMaven(maven : 'maven_3_5_0') { @@ -19,12 +19,12 @@ pipeline { } } } - +*/ stage ('Deployment Stage') { steps { sh 'ls -lrt' - sh 'aws s3 ls' + sh '/usr/local/bin/aws s3 ls' } } } -- 2.49.1 From ec8b84b63097ed75b16faf5ba1cd012f4a0889ef Mon Sep 17 00:00:00 2001 From: TechPrimers Date: Sun, 10 Jun 2018 17:58:02 +0530 Subject: [PATCH 3/8] add new branch for aws deploy testing --- Jenkinsfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index bb40321..c101a17 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,6 +23,12 @@ pipeline { stage ('Deployment Stage') { steps { + + withCredentials([usernamePassword(credentialsId: 's3-bucket', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) { + sh 'export AWS_ACCESS_KEY_ID=USERNAME' + sh 'export AWS_SECRET_ACCESS_KEY=$PASSWORD' + sh 'export AWS_DEFAULT_REGION=ap-south-1' + } sh 'ls -lrt' sh '/usr/local/bin/aws s3 ls' } -- 2.49.1 From a1ce73f5356203a5282d55c77f212d3d9ea1eb68 Mon Sep 17 00:00:00 2001 From: TechPrimers Date: Sun, 10 Jun 2018 18:06:28 +0530 Subject: [PATCH 4/8] add new branch for aws deploy testing --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c101a17..dae9bce 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,12 +25,14 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: 's3-bucket', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) { - sh 'export AWS_ACCESS_KEY_ID=USERNAME' + sh 'export AWS_ACCESS_KEY_ID=$USERNAME' sh 'export AWS_SECRET_ACCESS_KEY=$PASSWORD' sh 'export AWS_DEFAULT_REGION=ap-south-1' } sh 'ls -lrt' + sh 'whoami' sh '/usr/local/bin/aws s3 ls' + sh '/usr/local/bin/aws configure list' } } } -- 2.49.1 From 903762360401eda5c48ba880d91405e8b1b75f1d Mon Sep 17 00:00:00 2001 From: TechPrimers Date: Sun, 10 Jun 2018 18:18:27 +0530 Subject: [PATCH 5/8] add new branch for aws deploy testing --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index dae9bce..6226802 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,6 +29,8 @@ pipeline { sh 'export AWS_SECRET_ACCESS_KEY=$PASSWORD' sh 'export AWS_DEFAULT_REGION=ap-south-1' } + sh 'cd ~' + sh 'pwd' sh 'ls -lrt' sh 'whoami' sh '/usr/local/bin/aws s3 ls' -- 2.49.1 From 02053964498498464576c93fa9e9c6fbb6876cd1 Mon Sep 17 00:00:00 2001 From: TechPrimers Date: Sun, 10 Jun 2018 18:26:57 +0530 Subject: [PATCH 6/8] add new branch for aws deploy testing --- Jenkinsfile | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6226802..81ced3b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,17 +24,9 @@ pipeline { stage ('Deployment Stage') { steps { - withCredentials([usernamePassword(credentialsId: 's3-bucket', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) { - sh 'export AWS_ACCESS_KEY_ID=$USERNAME' - sh 'export AWS_SECRET_ACCESS_KEY=$PASSWORD' - sh 'export AWS_DEFAULT_REGION=ap-south-1' - } - sh 'cd ~' - sh 'pwd' - sh 'ls -lrt' - sh 'whoami' + sh '/usr/local/bin/aws s3 cp target/jenkins-example*.jar s3://techprimers-s3/' sh '/usr/local/bin/aws s3 ls' - sh '/usr/local/bin/aws configure list' + sh '/usr/local/bin/aws s3 ls s3://techprimers-s3/' } } } -- 2.49.1 From f08e6e83f2cc902907986107dddce60e4ec464d3 Mon Sep 17 00:00:00 2001 From: TechPrimers Date: Sun, 10 Jun 2018 18:29:29 +0530 Subject: [PATCH 7/8] add new branch for aws deploy testing --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 81ced3b..35092a3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,8 +23,8 @@ pipeline { stage ('Deployment Stage') { steps { - - sh '/usr/local/bin/aws s3 cp target/jenkins-example*.jar s3://techprimers-s3/' + sh 'cd target' + sh '/usr/local/bin/aws s3 cp jenkins-example-1.0-SNAPSHOT.jar s3://techprimers-s3/' sh '/usr/local/bin/aws s3 ls' sh '/usr/local/bin/aws s3 ls s3://techprimers-s3/' } -- 2.49.1 From f842d55ed258c86e279897682926e16034d01d3d Mon Sep 17 00:00:00 2001 From: TechPrimers Date: Sun, 10 Jun 2018 18:30:05 +0530 Subject: [PATCH 8/8] add new branch for aws deploy testing --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 35092a3..ab2e2b0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { steps { withMaven(maven : 'maven_3_5_0') { - sh 'mvn clean compile' + sh 'mvn clean install' } } } @@ -23,8 +23,8 @@ pipeline { stage ('Deployment Stage') { steps { - sh 'cd target' - sh '/usr/local/bin/aws s3 cp jenkins-example-1.0-SNAPSHOT.jar s3://techprimers-s3/' + + sh '/usr/local/bin/aws s3 cp target/jenkins-example*.jar s3://techprimers-s3/' sh '/usr/local/bin/aws s3 ls' sh '/usr/local/bin/aws s3 ls s3://techprimers-s3/' } -- 2.49.1