From 103f11cf208483fd2ba697728aff97ebbe554812 Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Tue, 19 Apr 2022 01:46:04 +0200 Subject: [PATCH 01/11] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 54e5fef1f..a4e333b41 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ const port = process.env.PORT || 3000; const server = http.createServer((req, res) => { res.statusCode = 200; - const msg = 'Hello Node!\n' + const msg = 'Hello World!\n' res.end(msg); }); From b71607559302909df346b31be68b3f85d34f0436 Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Tue, 19 Apr 2022 02:28:23 +0200 Subject: [PATCH 02/11] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index a4e333b41..fc4f6ee3b 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ const port = process.env.PORT || 3000; const server = http.createServer((req, res) => { res.statusCode = 200; - const msg = 'Hello World!\n' + const msg = 'Hello Anwer!\n' res.end(msg); }); From f0151c566f8389c2c83b7c7ac648e9db7cb0dcbe Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Sat, 20 Jan 2024 01:23:17 +0200 Subject: [PATCH 03/11] Create Jenkinsfile --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..de33f8e2f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,11 @@ +@Library("myLibrary") _ +pipeline { + agent any + stages { + stage('Testing') { + steps { + helloWorldExternal(dayOfWeek:"Friday",name:"Anwer") + } + } + } +} From ccb3540401be633419a2a8f5749f72879038b9ec Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Sat, 20 Jan 2024 01:27:26 +0200 Subject: [PATCH 04/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b84b3924e..53a6771c0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Node Hello World +# Hello World Simple node.js app that servers "hello world" From 2b755dc273a027346216d33320e71bbbef71b649 Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Sat, 20 Jan 2024 01:28:40 +0200 Subject: [PATCH 05/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53a6771c0..420f67a59 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Hello World +# Hello World application Simple node.js app that servers "hello world" From 3cf2188802daf7158f7222826a3507e29cc146aa Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Sat, 20 Jan 2024 01:36:24 +0200 Subject: [PATCH 06/11] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 420f67a59..d4effb43a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Simple node.js app that servers "hello world" -Great for testing simple deployments to the cloud - ## Run It `npm start` From 674c26da3b6eaa36bfb4ee548afef3cc11e96ae0 Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Sat, 20 Jan 2024 01:41:21 +0200 Subject: [PATCH 07/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4effb43a..1ae15bd86 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,6 @@ Simple node.js app that servers "hello world" -## Run It +## To run: `npm start` From 92c8177d1f807bec36ffcf6a75726d46fcaff726 Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Sat, 20 Jan 2024 01:52:02 +0200 Subject: [PATCH 08/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ae15bd86..07abd4e20 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,6 @@ Simple node.js app that servers "hello world" -## To run: +## To run `npm start` From a40229f1511a2fddb8c7861b281659dddd7f30de Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Thu, 25 Jan 2024 01:15:54 +0200 Subject: [PATCH 09/11] Update Jenkinsfile --- Jenkinsfile | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index de33f8e2f..aa1afe9d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,36 @@ @Library("myLibrary") _ + pipeline { agent any + + environment { + GITHUB_TOKEN = credentials('mahmoudanwer_github_token') + GITHUB_USERNAME = "mahmoud-anwer" + REPO_OWNER = "mahmoud-anwer" + REPO_NAME = "node-hello" + TARGET_DIRECTORY = "node-hello-dir" + SERVICE_NAME = "api" + BASE_BRANCH = "master" + } + stages { - stage('Testing') { + stage('Clone Repository') { + steps { + cloneRepo(github_username: env.GITHUB_USERNAME, github_token: env.GITHUB_TOKEN, repo_owner: env.REPO_OWNER, repo_name: env.REPO_NAME, target_dir: env.TARGET_DIRECTORY) + } + } + stage('Editing files') { + steps { + script{ + sh """ + echo "test" > ${TARGET_DIRECTORY}/test.file + """ + } + } + } + stage('Creating pull request') { steps { - helloWorldExternal(dayOfWeek:"Friday",name:"Anwer") + createPR(base_branch: env.BASE_BRANCH, target_dir: env.TARGET_DIRECTORY, service_name: env.SERVICE_NAME, build_id: env.BUILD_ID, commit_hash: env.GIT_COMMIT, github_username: env.GITHUB_USERNAME, github_token: env.GITHUB_TOKEN, repo_owner: env.REPO_OWNER, repo_name: env.REPO_NAME) } } } From 551d33bb93c18adf9727e89bf1b79350d6ac133d Mon Sep 17 00:00:00 2001 From: Mahmoud Anwer Date: Thu, 25 Jan 2024 01:27:27 +0200 Subject: [PATCH 10/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 07abd4e20..1ae15bd86 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,6 @@ Simple node.js app that servers "hello world" -## To run +## To run: `npm start` From ffb6224309aa0cd366cc75fba366501b6ae4692d Mon Sep 17 00:00:00 2001 From: Jenkins Date: Wed, 24 Jan 2024 23:27:39 +0000 Subject: [PATCH 11/11] Update image tag to 551d33bb93c18adf9727e89bf1b79350d6ac133d --- test.file | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.file diff --git a/test.file b/test.file new file mode 100644 index 000000000..9daeafb98 --- /dev/null +++ b/test.file @@ -0,0 +1 @@ +test