Teraform – script tool to manage infrastructure as code (AWS, Azure, Google, Heroku …)

http://labs.septeni-technology.jp/continuous-integration/terraform-mot-cong-cu-de-lam-infrastructure-as-code/

Advertisements

Possibility usage of Jenkins and its plugin

1. Jenkins Master-Slave model

2. Send notification/report by MAIL (Email-ext plugin)

3. Create JIRA ticket to assign task (JIRA plugin)

4. Build source code

5. Execute STATIC code analysis (Coverirty, SonarQube)

6. Execute SECURITY analysis ()

7. Execute UNIT test (JUNIT, EMMA)

8. Execute INTERGRATION test (Automation UI)

9. Execute JIRA query and report (REST API, JIRA PLUGIN)

10. Pipeline

 

1. Jenkins Master-Slave model
Master connect to Slave by SSH.

Two way to let Slave start build code.
– Slave pull code from SCM. Then Slave build.

– Master pull code from SCM and copy to Slave. Then Slave build.
https://wiki.jenkins-ci.org/display/JENKINS/Copy+To+Slave+Plugin

2. Send notification/report by MAIL (Email-ext plugin)
http://www.nailedtothex.org/roller/kyle/entry/articles-jenkins-email

3. Create JIRA ticket to assign task
JIRA plugin, Jira Issue Updater, JiraTestResultReporter plugins
http://www.agiletrailblazers.com/blog/how-to-make-your-scrum-master-happy-using-jira-integrations
(integration JIRA-GITHUB-JENKINS in a develoment loop)

4. Build source code
5. Execute STATIC code analysis (Coverirty, SonarQube)
http://macoscope.com/blog/using-sonarqube-with-jenkins-continuous-integration-and-github-to-improve-code-review/

https://lasithapetthawadu.wordpress.com/2014/05/03/configure-jenkins-with-sonarqube-for-static-code-analysis-and-integration/
Jenkins perform automated builds and would execute unit tests.
During this process it would run a sonarqube runner which ultimately integrates the static analysis results to the SonarQube dashboard.
Sonar is better than Coverity at following:
– Coud add/change rule, norm in Quality Gate
– Expose WebAPI so that external could access its database
– Bug/Vulnerability/CodeSmell/TechnicalDept
6. Execute SECURITY analysis (SSC)
7. Execute UNIT test
(Junit on target device, coverage analysis report by EMMA)

8. Execute INTERGRATION test (Automation UI)
9. Execute JIRA query and report
Via REST API???
10. Pipeline

Build Anddroid app from GIT/Gerrit by Jenkins

Build Anddroid app from GIT/Gerrit by Jenkins

(assump to use ANT in Jenkins to compile)

Jenkins – Setup a simple Ant build project
PREPARE ANDROID CODE ON GIT
1. Create Android app in Eclipse in local

2. Export build.xml from Eclipse
By Eclipse: Export/Ant build files
By terminal: android update project -p ./newtestapp
(if do not have build.xml, Jenkins will not be able to compile because Ant need build.xml)

3. Commit Android app source to Gerrit
(commit all except ./bin and ./gen folder)

4. Select CodeReview+2 to merge commited code to Git

CONFIG JENKINS TO USE ANT
5. Setup JDK path
Manage Jenkins -> Global Tool Configuration
(specify existed JDK or let Jenkins download new one)

6. Setup ANDT path
Manage Jenkins -> Global Tool Configuration
(I let Jenkins download new ANT so that user access right is OK for “jenkins” user)

BUILD JOB
7. Create build JOB

8. Setting build JOB
Source Code Management: GIT
– Repository URL: http://127.0.0.1:8087/gerritdemo.git
– Credentials: account which link to account which could access GIT (already setting previously)
– Branch Specifier: */master

Build trigger: Gerrit event

Gerrit Trigger
– Server: gerritserver (Name of gerrit server)
– Gerrit project: gerritdemo (name of a project on gerrit server)
– Branch: master

Build step: select Invoke ANT
– ANT version: Select ANT version
– ANT target: let empty or debug (any target existed in build.xml file)

Post build:
– Files to archive: **/*.apk
(if you dont setting, jenkins only compile source, not created APK)

9. Execute build JOB
– Commit a new change from GIT -> GERRIT then JENKINS will trigger build JOB immediately.
(even you haven’t +2 in Gerrit)

– OR you could actively exectute build JOB in Jenkins.
(select “Build now” or “Re-trigger”

NOTE:
– You could face error if there is not enough: build.xml, project.properties, etc…
– You could face error if “build file” parameter of ANT in Jenkins is different than your actual build.xml path in GIT.
In that case, modified it in JOB configure -> Build -> Invoke Ant -> Advanced -> Build file
– After build successfully, you could install your output APK to Emulator to check.