Commit f2ff7ef2 authored by qhoangxuan's avatar qhoangxuan


parent a2cb76a6
# Zoe Continuous Integration
# Overview
- Integrated Zoe repository to Jenkins and SonarQube
- Integrate Zoe repository to Jenkins and SonarQube
- Each commit to Zoe repository trigger a build at Jenkins:
- Run SonarQube Scanner to analyze the codebase
- Create two containers for zoe-master, zoe-api
......@@ -16,28 +16,29 @@
# Configuration
### Jenkins
- Required:
- Plugins: Github plugin, SonarQube Plugin, Email Plugin (optional)
- Plugins: Github plugin, SonarQube Plugin, Email Plugin (optional), Cobetura Coverage Report (optional)
- Softwares: Java, Python, Docker
- Go to Manage Jenkins, then Global Tool Configuration to setup Java SDK
- Go to **Manage Jenkins**, then **Global Tool Configuration** to setup Java SDK
- SonarQube server configuration:
- Go to Manage Jenkins then Configure System
- Go to **Manage Jenkins** then **Configure System**
- SonarQube servers: input name, server URL, server version, **sever authentication token** (created on SonarQube Server)
- Create credentials for Github account
- Create SSH key pair on Jenkins Server
- Add public key to Github
- Add private key to Jenkins credentials
- Create new item as a **freestyle project** to descibe Github repository
- Create new item as a **freestyle project** to describe Github repository
- General
- Select Github project
- Insert project URL
- Source Code Management
- Select **Git**
- Repositories
- Repository URL: use **SSH URL** of github repository
- Repository URL: use **SSH URL** of Github repository
- Credentials: select the one created above
- Build Triggers
- Select **Build when a change is pushed to Github**
- Post-build Actions [Optional]
- Add **Publish Covetura Coverage Report** for getting report from coverage
- Add **E-mail Notification** for notifying when jobs finish
### Github
- Add new SSH key (the one created on Jenkins server)
......@@ -54,12 +55,12 @@
# Execute Shell Script
Script to execute ci in zoe-kpmg branch i34-t7.4.1
Push this script inside the **execute shell script** of Jenkins job
Push this script inside the execute shell script of Jenkins job
# Build new container images
python3 ci/ 1 tcp://$BUILD_ID
python3 cicd/ 1 tcp://$BUILD_ID
# Deploy new zoe with the above images for testing
python3 ci/ 0 tcp:// ci/docker-compose-test.yml$BUILD_ID
python3 cicd/ 0 tcp:// cicd/docker-compose-test.yml$BUILD_ID
# Run integration test
cd tests
......@@ -77,7 +78,7 @@ cp -r zoe_fe/build/prod .
tar -cvf prod.tar prod
# Push the built images above to local registry
python3 ci/ 2 tcp://$BUILD_ID
python3 cicd/ 2 tcp://$BUILD_ID
# Redeploy zoe with new images
python3 ci/ 0 tcp:// ci/docker-compose-prod.yml$BUILD_ID
python3 cicd/ 0 tcp:// cicd/docker-compose-prod.yml$BUILD_ID
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment