Category Archives: travis ci

Creating issues using github api if travis build is failed.

Hello People,

If you are trying to build some project in travis ci and if it is failed then you have to go to travis ci and login to website and search for the repository where you will trying to see last build failure information, so it a time taking process to search for the log.

Instead of doing long process, i have create a shell script which will execute when build is failed in travis ci and will communicate to github api to create issue and adds build failure link as below.


Please find the link below for createissue shell scripting code.

body="{ \"title\": \"Travis Build no. $TRAVIS_JOB_NUMBER failure \", \"body\": \"Error code: $TRAVIS_TEST_RESULT \n\n JOB URL : $TRAVIS_JOB_WEB_URL\", \"labels\": [\"critical\"]}"
curl -i \
-H "Authorization: token $TicketApi" \
-d "$body" \$TRAVIS_REPO_SLUG/issues

view raw

hosted with ❤ by GitHub

and add below code in .travis.yml file to create issue on build failure.

- wget -O
- chmod 777
- ./

This will create a issue on build failure and will help you in tracking in which issue you have fixed the build.

and add TicketApi environment variable in travis ci settings with github OAuth key.



If you like this blog you can say thank you by clicking below say thanks icon and even you can share comments also.




How to test java project using docker in Travis CI without Maven

Hello People,

This blog is regarding build and test any java project without maven i hope it will help beginner who started learning java course.

First Create a account in github and create a repostory and add .java code in the github.

For example i am testing with below sample java program in the travis ci and github using official java docker.

public class HelloWorld

public class HelloWorld{

public static void main(String h[])


System.out.println(“Hello World !”);



After creating java program and commit in github, visit : and signup/signin with github account, import the github project in travis ci and enable project for build and testing in travis ci.

After enabling in travis ci go to github and create .travis.yml file as below

language: bash

– docker

– docker pull java:7


– docker run –rm -v”$PWD”:/usr/src/myapp -w /usr/src/myapp java:7 javac
– echo “Listing class files”
– ls -la
– echo “Output of java file”
– docker run –rm -v”$PWD”:/usr/src/myapp -w /usr/src/myapp java:7 java HelloWorld

– docker rmi $(docker images -aq)

As soon as above program is committed in github, travis ci will automatically detect new commit in the master branch it will start build and testing based on .travis.yml configuration.

You can find the sample log in link :

I have created a sample project in github please visit to below link.

If you are patching code and creating a pull request between master and patch branch, it will start building and testing the code parallelly as a checks before merging into master branch as shown below.

This will give you confidence before merging patch branch to master or main branch of program.



If you like the post please share and like.