https://github.com/khanmaster/sre_jenkins_cicd
https://github.com/khanmaster/sre_jenkins_cicd
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/khanmaster/sre_jenkins_cicd
- Owner: khanmaster
- Created: 2021-09-08T11:20:29.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-09T14:18:06.000Z (over 3 years ago)
- Last Synced: 2023-03-05T03:32:08.987Z (over 3 years ago)
- Language: JavaScript
- Size: 648 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: READMe.md
Awesome Lists containing this project
README
# Let's build a Continuous Integration and Continuous Delivery/Deployment (CICD) Pipeline
## Jenkins CI job Testing
### Webhooks with Git-hub
#### Automated Testing using Jenkins
#### Automated Deployment on AWS EC2 for 2Tier architecture - Nodejs app and Mongodb
-
- CI test wtih Eng130 - 100
- testing CI from localhost
- git flow test 1
- Jenkins Workflow
- feature added from localhost new attempt

##### Contiounus Integration Continuous Delivery/Deployment

###### Let's break it down

### For deployment job in Jenkins
- In the execute shell of CD job
- new webhook testing
```
# we need to by pass the key asking stage with below command:
ssh -A -o "StrictHostKeyChecking=no" ubuntu@ec2-ip << EOF
# copy the the code
# run your provision.sh to install node with required dependencies for app instance - same goes for db instance (ensure to double check if node and db are actively running)
# create an env to connect to db
# navigate to app folder
# kill any existing pm2 process just in case
# launch the app
nohup node app.js > /dev/null 2>&1 & - use this command to run node app in the background
# To debug ssh into your ec2 and run the above commands
EOF
```
## Jenkins CI Lab - Solution
##### Steps
##### Source Code Management
1. Set Branches to Build to develop
2. Under additional behaviours click add and "Merge before build"
3. name of repo "origin"
4. branch to merge "main"
### Post-Build Actions
#### Git Publisher
1. Add Post Build Action
2. Git Publisher
3. Push Only if Build Succeeds
4. Merge Results
5. change made on dev brance
---
Tigger deployment job if the merge was successfull
- Testing webhook in bootcamp test3
- -testing