Skip to content

Instantly share code, notes, and snippets.

@egek92
Created November 4, 2019 13:11
Show Gist options
  • Save egek92/8f3a3f0ffdf9ff1b2ea6a8ed93b87768 to your computer and use it in GitHub Desktop.
Save egek92/8f3a3f0ffdf9ff1b2ea6a8ed93b87768 to your computer and use it in GitHub Desktop.
One can specifies a different port than the usual 8080 to make it unique and avoid any errors, in case another service is using Jenkins
java -jar jenkins.war --httpPort=9091
Next Step: Configure Jenkins
Manage Jenkins > Configure System
Mentioned the ANDROID_HOME as my Android SDK path variable in Global properties.
2. Manage Jenkins > Global Tool Configuration
Here I told Jenkins where it can find GIT.
Next Step : Add New Item
Adding New Item is the easy part .Enter Item Name [ Android Application/Project Name ] and Select Freestyle project .
Click OK.
Next Step : Configure New Item
Next, go to Source Code Management. Configure you repository with Jenkins like below .
Also we need to git Credentials .So click on Add and your Credentials.
Select the newly added Credentials .
In Build Triggers, select Poll SCM
and add Schedule :
* * * * *
Five time “*” with space .Which mean Jenkins will check after every minute if there are any changes in the git repository it will run the build.
In Build , Add build step > Invoke Gradle script
Select Use Gradle Wrapper and add the following tasks
clean
assembleDebug
test
connectedAndroidTest
Lets add some Post-build Actions .
Publish JUnit test result report
2. Archive the artifacts
3. Editable Email Notification
In Project Recipient List add emails to which you would like to send email after each build . In above configuration I have attached the APK and the Build Log file .
All done .Click Apply and Save.
The Result .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment