From c07b584a452f23b0e202c290b2ca233d6dcb8fd3 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 22:48:44 +0530 Subject: [PATCH 01/35] Create Jenkinsfile --- Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..181734f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + agent any + + stages { + stage('Clone') { + // Get some code from a GitHub repository + checkout scm + } + stage('Build') { + steps { + // Run Maven on a Unix agent. + sh "mvn web3j:generate-sources" + + // To run Maven on a Windows agent, use + // bat "mvn -Dmaven.test.failure.ignore=true clean package" + } + + post { + // If Maven was able to run the tests, even if some of the test + // failed, record the test results and archive the jar file. + success { + + archiveArtifacts 'target/*.jar' + } + } + } + stage('Install') { + sh "mvn install" + } + + } +} From 2a97d870a94ffe6424e559b143fc003d7014feca Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 22:50:10 +0530 Subject: [PATCH 02/35] Update Jenkinsfile --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 181734f..6497ac3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,8 +3,10 @@ pipeline { stages { stage('Clone') { + steps { // Get some code from a GitHub repository checkout scm + } } stage('Build') { steps { @@ -25,7 +27,9 @@ pipeline { } } stage('Install') { - sh "mvn install" + steps { + sh "mvn install" + } } } From 9fbdb6459814e5b17726c3cb5d49941a2f8877c4 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 22:58:58 +0530 Subject: [PATCH 03/35] Update Jenkinsfile --- Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6497ac3..890904a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,11 +26,7 @@ pipeline { } } } - stage('Install') { - steps { - sh "mvn install" - } - } + } } From 1c4d13807ec11ab161b3a20ad80c1788564c1371 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 23:38:59 +0530 Subject: [PATCH 04/35] Create Dockerfile --- Dockerfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1048a65 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# +# Nginx Dockerfile +# +# https://github.com/dockerfile/nginx +# + +# Pull base image. +FROM ubuntu +RUN apt-get update -y +RUN apt-get install -y software-properties-common +# Install Nginx. +RUN \ + add-apt-repository -y ppa:nginx/stable && \ + apt-get update && \ + apt-get install -y nginx && \ + rm -rf /var/lib/apt/lists/* && \ + echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \ + chown -R www-data:www-data /var/lib/nginx + +# Define mountable directories. +VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] + +# Define working directory. +WORKDIR /etc/nginx + +# Define default command. +CMD ["nginx"] + +# Expose ports. +EXPOSE 80 +EXPOSE 443 From 2d61bfbb4c18cfe7822b6bebb9521de72574d756 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 23:40:29 +0530 Subject: [PATCH 05/35] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 890904a..b0dc1bb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,7 +26,9 @@ pipeline { } } } - + stage('docker build') { + sh "docker build -t="dockerfile/nginx" ." + } } } From 3f4f7d54262d3d0a78ade5d0f028cbf33aa77c72 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 23:41:06 +0530 Subject: [PATCH 06/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b0dc1bb..e0f073f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ pipeline { } } stage('docker build') { - sh "docker build -t="dockerfile/nginx" ." + sh "docker build -t=dockerfile/nginx ." } } From 97b2d9c7d79d9a67bc6542760a445677eaedea01 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 23:42:07 +0530 Subject: [PATCH 07/35] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e0f073f..c93dc62 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,9 @@ pipeline { } } stage('docker build') { - sh "docker build -t=dockerfile/nginx ." + steps { + sh "docker build -t=dockerfile/nginx ." + } } } From 51f8e1c9bd9629a3175c3ac20e450adf60f54c61 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 23:43:16 +0530 Subject: [PATCH 08/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c93dc62..f885153 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,7 @@ pipeline { } stage('docker build') { steps { - sh "docker build -t=dockerfile/nginx ." + sh "sudo docker build -t=dockerfile/nginx ." } } From 4567927e482edb4d393ae3ab4da307277c994e59 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 23:47:47 +0530 Subject: [PATCH 09/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f885153..c93dc62 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,7 @@ pipeline { } stage('docker build') { steps { - sh "sudo docker build -t=dockerfile/nginx ." + sh "docker build -t=dockerfile/nginx ." } } From d3c7d2c4c4800abfe3b1e71866f4dcb4a3843258 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 23:53:48 +0530 Subject: [PATCH 10/35] Delete README.md --- README.md | 124 ------------------------------------------------------ 1 file changed, 124 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 0cc2c65..0000000 --- a/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# web3j Sample Project - -This project provides a very simple starter application for working with web3j and the test -Ethereum network (testnet) known as Rinkeby. - -The demo deploys a *hello world* smart contract which contains a greeting message. The current -greeting message can be read and modified in the smart contract. - -In order to run this demo, three pieces of information are required: - -1. Ethereum client (or node) endpoint. The simplest thing to do is -[request a free access token](https://infura.io/register.html) from Infura. -2. A wallet file. This can be generated using the web3j -[command line tools](https://docs.web3j.io/command_line.html) by running the command: -3. Some Ether. This can be requested from the [Rinkeby Faucet](https://www.rinkeby.io/#faucet). - -- To create a wallet file, run the command: -```aidl -web3j wallet create -``` - -- You will be asked to secure your wallet with a password. You will have the option -of choosing a destination directory for your wallet file. -In the `Application.java` class under the package `org.web3j.sample`, -on line `66-67` replace the placeholders with your wallet file password and directory path. - -- With the access token retrieved from Infura, on line `58` replace the placeholder -in the url with your token. You can find this under the `Endpoint` section: - -![Alt text](Artboard.png) - -Once these details have been added to the main Application class, you'll be good to go. - -### Run the project -- Make sure to be in the root directory -- First we need to create the smart contracts deriving from the solidity file `Greeter.sol` by running: -```aidl -mvn web3j:generate-sources -``` -- This will create the Greeter and Mortal contract under the package `org.web3j.model` -- Clean and build the project, run the command: -```aidl -mvn install -``` -This will also generate a jar file with all the dependencies which we will run once -it has been created. -- Run the `Main` method in `Application.java` by running -``` -mvn exec:java -``` -- Alternatively, you can run the `main` method in `Application.java` in your chosen IDE, e.g. `IntelliJ` - -## Functionality - -This application demonstrates a number of core features of web3j and Ethereum: - -- Connecting to a node on the Ethereum network -- Loading an Ethereum wallet file -- Sending Ether from one address to another -- Deploying a smart contract to the network -- Reading a value from the deployed smart contract -- Updating a value in the deployed smart contract -- Viewing an event logged by the smart contract - - -## Background - -This application has purposefully been kept as simple as possible with the aim of demonstrating -how to deploy and work with a smart contract on the decentralised Ethereum network. - -If you require further background information about the above configuration items for the project -you can refer to the below. - -For a more comprehensive overview, I recommend you read the -[Java Magazine Article](https://web3j.io/articles/web3j%20article%20-%20Java%20Magazine%20JanuaryFebruary%202017.pdf), watch -the -[YouTube](https://youtube.com/watch?v=ea3miXs_P6Y) talk, and read all of the -[documentation](https://docs.web3j.io). - -### Smart contracts - -The contained smart contract is based on the -[Greeter contract example](https://www.ethereum.org/greeter), with the addition that the value -stored in the Greeter can be modified. - -The associated Java smart contract wrapper is named Greeter. - -For more background on smart contracts, refer to the -[smart contracts](https://docs.web3j.io/smart_contracts.html) section of the docs. - - -### Infura - -If you don't want to sign up to Infura, and would like to run a node yourself, there are -instructions in the [getting started](https://docs.web3j.io/getting_started.html#start-a-client) -section of the docs. - -### Testnets - -For more information on the different Ethereum test networks (or testnets), refer -to the -[testnet overview](https://docs.web3j.io/transactions.html#ethereum-testnets) in the docs. - -### Ether - -For background on Ether, refer to the transactions -[overview](https://docs.web3j.io/transactions.html#transactions) section of the docs. - -### Wallets and transaction signing - -For a more technical overview of working with wallet files, refer to the -[Offline transaction signing](https://docs.web3j.io/transactions.html#offline-transaction-signing) -section of the docs. - - -## Viewing requests - -A logback configuration is included in the project dependencies allowing the logging of protocol -messages if required. To enable, simply change the following [line]() in the logback configuration -to read: - -```xml - -``` From 6b1e293c02a711609e5199cfca3630c07ce8d6c2 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 00:22:16 +0530 Subject: [PATCH 11/35] Update Jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c93dc62..3b5e389 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,8 @@ pipeline { } stage('docker build') { steps { - sh "docker build -t=dockerfile/nginx ." + sh "docker build -t=saijyothi9/nginx ." + sh "docker push saijyothi9/nginx" } } From 6e37ab53bff7ed09b3eca6b65294ec391fa4c9ae Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 00:28:02 +0530 Subject: [PATCH 12/35] Update Jenkinsfile --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 3b5e389..dbdfde8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,9 +29,19 @@ pipeline { stage('docker build') { steps { sh "docker build -t=saijyothi9/nginx ." + } + } + stage('docker push') { + steps { sh "docker push saijyothi9/nginx" } } + stage('docker run ') { + steps { + sh "docker rm $(docker ps -a -q) + sh "ddocker run --name mynginx1 -p 80:80 -d nginx + } + } } } From 23e321026bee41e3c90192c3fe2147ce1878873f Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 00:28:32 +0530 Subject: [PATCH 13/35] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dbdfde8..4e7a78e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,8 +38,8 @@ pipeline { } stage('docker run ') { steps { - sh "docker rm $(docker ps -a -q) - sh "ddocker run --name mynginx1 -p 80:80 -d nginx + sh "docker rm $(docker ps -a -q)" + sh "docker run --name mynginx1 -p 80:80 -d nginx" } } From 601f677e6671ead696918e397590e84f19db0820 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 00:29:46 +0530 Subject: [PATCH 14/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4e7a78e..58071a1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ pipeline { } stage('docker run ') { steps { - sh "docker rm $(docker ps -a -q)" + sh "docker rm \$(docker ps -a -q)" sh "docker run --name mynginx1 -p 80:80 -d nginx" } } From 90854e5879deb4d3de28b801c81b1f39098177f2 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 12:29:53 -0700 Subject: [PATCH 15/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 58071a1..c61a28b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ pipeline { stage('docker run ') { steps { sh "docker rm \$(docker ps -a -q)" - sh "docker run --name mynginx1 -p 80:80 -d nginx" + sh "docker run --name mynginx1 -p 80:80 -d saijyothi9/nginx" } } From 620719d0b4652d0bc9763ea9ababf445518b3f48 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 19 Mar 2020 12:31:56 -0700 Subject: [PATCH 16/35] Update Jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c61a28b..1859c6b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,8 @@ pipeline { } stage('docker run ') { steps { - sh "docker rm \$(docker ps -a -q)" + sh "docker stop \$(docker ps -a -q)" + sh "docker rm \$(docker ps -a -q)" sh "docker run --name mynginx1 -p 80:80 -d saijyothi9/nginx" } } From 88e305a6d08651968a463b764d3114b242059808 Mon Sep 17 00:00:00 2001 From: SaiJyothi Gudibandi Date: Thu, 19 Mar 2020 12:52:16 -0700 Subject: [PATCH 17/35] Commiting the latest changes --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1859c6b..85ef132 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ pipeline { stage('docker run ') { steps { sh "docker stop \$(docker ps -a -q)" - sh "docker rm \$(docker ps -a -q)" + sh "docker rm \$(docker ps -a -q)" sh "docker run --name mynginx1 -p 80:80 -d saijyothi9/nginx" } } From f05f3360720a188b16fc847606be4e6617038893 Mon Sep 17 00:00:00 2001 From: SaiJyothi Gudibandi Date: Thu, 19 Mar 2020 13:43:52 -0700 Subject: [PATCH 18/35] Latest changes --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 85ef132..c43dd70 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,11 +36,11 @@ pipeline { sh "docker push saijyothi9/nginx" } } - stage('docker run ') { + stage('docker run') { steps { sh "docker stop \$(docker ps -a -q)" sh "docker rm \$(docker ps -a -q)" - sh "docker run --name mynginx1 -p 80:80 -d saijyothi9/nginx" + sh "docker run --name mynginx1 -p 80:80 -d saijyothi9/nginx" } } From 18cdbb5159d555c1f0d87baac9bf673131de446f Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 21:30:00 +0530 Subject: [PATCH 19/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c43dd70..db81187 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Build') { steps { // Run Maven on a Unix agent. - sh "mvn web3j:generate-sources" + sh ${params.build_url} // To run Maven on a Windows agent, use // bat "mvn -Dmaven.test.failure.ignore=true clean package" From cb7ca999bc25aca86b91f800208e7192607f8efb Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 21:30:58 +0530 Subject: [PATCH 20/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index db81187..0be4889 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Build') { steps { // Run Maven on a Unix agent. - sh ${params.build_url} + sh ${build_url} // To run Maven on a Windows agent, use // bat "mvn -Dmaven.test.failure.ignore=true clean package" From 0c2d1b91bb95f99a7d4dc3033b659081d6065757 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 21:32:58 +0530 Subject: [PATCH 21/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0be4889..3dda8ca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Build') { steps { // Run Maven on a Unix agent. - sh ${build_url} + sh "${params.build_url}" // To run Maven on a Windows agent, use // bat "mvn -Dmaven.test.failure.ignore=true clean package" From 31d55c707133d18ba75a1c9913d65813b477fdb9 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 21:35:07 +0530 Subject: [PATCH 22/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3dda8ca..34af860 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Build') { steps { // Run Maven on a Unix agent. - sh "${params.build_url}" + sh "${params.build_cmd}" // To run Maven on a Windows agent, use // bat "mvn -Dmaven.test.failure.ignore=true clean package" From 51ddfca1da871de701355e9ebf6d3b8ae71e17f1 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 22:49:53 +0530 Subject: [PATCH 23/35] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 34af860..be2f763 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,7 @@ pipeline { - agent any + agent { + label any + } stages { stage('Clone') { From d5406dc36f458f2caceb3bf57dc33650f866506e Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 22:50:42 +0530 Subject: [PATCH 24/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index be2f763..a4b2baa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { agent { - label any + label 'master' } stages { From 094166dff5bc00aeaa59a945cea7d6b6d4931797 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 22:52:25 +0530 Subject: [PATCH 25/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a4b2baa..1db9dc1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { agent { - label 'master' + label '${params.slave_name}' } stages { From cc65009eb0c406c68ebf7909c6679e760b10ad6c Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 22:53:44 +0530 Subject: [PATCH 26/35] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1db9dc1..7bbbfa2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { agent { - label '${params.slave_name}' + label "${params.slave_name}" } stages { From 90ea0921bfdf6d6b86250b0253dec018650d852d Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 23:06:30 +0530 Subject: [PATCH 27/35] Update Jenkinsfile --- Jenkinsfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7bbbfa2..855130c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,15 +18,6 @@ pipeline { // To run Maven on a Windows agent, use // bat "mvn -Dmaven.test.failure.ignore=true clean package" } - - post { - // If Maven was able to run the tests, even if some of the test - // failed, record the test results and archive the jar file. - success { - - archiveArtifacts 'target/*.jar' - } - } } stage('docker build') { steps { From d3cd76758f6faeac776e72b44e2c0b7b5a38915f Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Fri, 20 Mar 2020 23:11:28 +0530 Subject: [PATCH 28/35] Update Jenkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 855130c..c6b09c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,19 +21,19 @@ pipeline { } stage('docker build') { steps { - sh "docker build -t=saijyothi9/nginx ." + sh "docker build -t=${params.docker_tag} ." } } stage('docker push') { steps { - sh "docker push saijyothi9/nginx" + sh "docker push ${params.docker_tag}" } } stage('docker run') { steps { sh "docker stop \$(docker ps -a -q)" sh "docker rm \$(docker ps -a -q)" - sh "docker run --name mynginx1 -p 80:80 -d saijyothi9/nginx" + sh "docker run --name mynginx1 -p 80:80 -d ${params.docker_tag}" } } From 1d3467c2d3ff1e6052ed9f833bc3163390d718d4 Mon Sep 17 00:00:00 2001 From: SaiJyothi Gudibandi Date: Wed, 1 Apr 2020 10:47:40 -0700 Subject: [PATCH 29/35] Commiy --- Jenkinsfile | 12 +++++------- jobs/job.groovy | 0 2 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 jobs/job.groovy diff --git a/Jenkinsfile b/Jenkinsfile index c6b09c4..19a03ce 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,5 @@ pipeline { - agent { - label "${params.slave_name}" - } + agent any stages { stage('Clone') { @@ -13,7 +11,7 @@ pipeline { stage('Build') { steps { // Run Maven on a Unix agent. - sh "${params.build_cmd}" + sh "mvn -v" // To run Maven on a Windows agent, use // bat "mvn -Dmaven.test.failure.ignore=true clean package" @@ -21,19 +19,19 @@ pipeline { } stage('docker build') { steps { - sh "docker build -t=${params.docker_tag} ." + sh "docker build -t sample ." } } stage('docker push') { steps { - sh "docker push ${params.docker_tag}" + sh "docker push sample" } } stage('docker run') { steps { sh "docker stop \$(docker ps -a -q)" sh "docker rm \$(docker ps -a -q)" - sh "docker run --name mynginx1 -p 80:80 -d ${params.docker_tag}" + sh "docker run --name mynginx1 -p 80:80 -d sample" } } diff --git a/jobs/job.groovy b/jobs/job.groovy new file mode 100644 index 0000000..e69de29 From 36efe0108a16f586a85fd2ab84cc37ca55f0d5e7 Mon Sep 17 00:00:00 2001 From: SaiJyothi Gudibandi Date: Wed, 1 Apr 2020 11:07:25 -0700 Subject: [PATCH 30/35] Commiy --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 19a03ce..372a5c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,19 +19,19 @@ pipeline { } stage('docker build') { steps { - sh "docker build -t sample ." + sh "docker build -t saijyothi9/sample ." } } stage('docker push') { steps { - sh "docker push sample" + sh "docker push saijyothi9/sample" } } stage('docker run') { steps { sh "docker stop \$(docker ps -a -q)" sh "docker rm \$(docker ps -a -q)" - sh "docker run --name mynginx1 -p 80:80 -d sample" + sh "docker run --name mynginx1 -p 80:80 -d saijyothi9/sample" } } From bf26daa12552bdc9d3afebd5d2c904c84c0dbf3f Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Wed, 1 Apr 2020 16:05:44 -0700 Subject: [PATCH 31/35] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 372a5c9..c5e67e7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,7 @@ pipeline { stage('docker build') { steps { sh "docker build -t saijyothi9/sample ." + echo "Overwrite the demo??" } } stage('docker push') { From 7d84ddec0fa70c7eb0b9e5eeb214ca6b22bb54a0 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 2 Apr 2020 11:42:42 -0700 Subject: [PATCH 32/35] Update Jenkinsfile --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index c5e67e7..5f97ca0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,6 +12,9 @@ pipeline { steps { // Run Maven on a Unix agent. sh "mvn -v" + echo "${params.GIT_COMMIT}" + echo "-------------" + echo "${params.ARTIFACT_BUILD_NUMBER}" // To run Maven on a Windows agent, use // bat "mvn -Dmaven.test.failure.ignore=true clean package" From 67304513b7d30097333881e714187e5f4cdbc62a Mon Sep 17 00:00:00 2001 From: SaiJyothi Gudibandi Date: Thu, 2 Apr 2020 12:51:31 -0700 Subject: [PATCH 33/35] Commit the multibranch file --- jobs/createMutibranchpipeline.groovy | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 jobs/createMutibranchpipeline.groovy diff --git a/jobs/createMutibranchpipeline.groovy b/jobs/createMutibranchpipeline.groovy new file mode 100644 index 0000000..12be2c2 --- /dev/null +++ b/jobs/createMutibranchpipeline.groovy @@ -0,0 +1,16 @@ +multibranchPipelineJob('spring-boot-java-11') { + branchSources { + git { + remote('https://github.com/sharadprsn/spring-boot-java-11.git') + credentialsId('github-credential') + } + } + orphanedItemStrategy { + discardOldItems { + numToKeep(20) + } + } + triggers { + periodic(5) + } +} \ No newline at end of file From db87c35c336ab3218b03410fc8bf3cb92314e5ce Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Thu, 2 Apr 2020 12:56:45 -0700 Subject: [PATCH 34/35] delete --- jobs/createMutibranchpipeline.groovy | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 jobs/createMutibranchpipeline.groovy diff --git a/jobs/createMutibranchpipeline.groovy b/jobs/createMutibranchpipeline.groovy deleted file mode 100644 index 12be2c2..0000000 --- a/jobs/createMutibranchpipeline.groovy +++ /dev/null @@ -1,16 +0,0 @@ -multibranchPipelineJob('spring-boot-java-11') { - branchSources { - git { - remote('https://github.com/sharadprsn/spring-boot-java-11.git') - credentialsId('github-credential') - } - } - orphanedItemStrategy { - discardOldItems { - numToKeep(20) - } - } - triggers { - periodic(5) - } -} \ No newline at end of file From 3d980eb2a223ae93e6d4fc82ae45590054fbfee2 Mon Sep 17 00:00:00 2001 From: SaiJyothiGudibandi Date: Tue, 7 Apr 2020 07:43:25 -0700 Subject: [PATCH 35/35] Update Jenkinsfile --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5f97ca0..2643063 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,10 +12,6 @@ pipeline { steps { // Run Maven on a Unix agent. sh "mvn -v" - echo "${params.GIT_COMMIT}" - echo "-------------" - echo "${params.ARTIFACT_BUILD_NUMBER}" - // To run Maven on a Windows agent, use // bat "mvn -Dmaven.test.failure.ignore=true clean package" }