Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@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('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 {
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)
}
}
}
}
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Node Hello World
# Hello World application

Simple node.js app that servers "hello world"

Great for testing simple deployments to the cloud

## Run It
## To run:

`npm start`
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 Anwer!\n'
res.end(msg);
});

Expand Down
1 change: 1 addition & 0 deletions test.file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test