Saturday, February 8, 2014

I spent quite some time figuring this out, but was happy when it worked. This is for Windows. In Linux, the process is the same, but it's far easier.

First, you have to know that if you've installed Git in Windows, it comes with curl pre-installed. So just open the Git bash prompt and start typing your commands.

Let's say you have a Jenkins job setup on localhost, named "someJob". To initiate a build, just type the following command in the Git Bash prompt:

curl http://localhost:8080/job/someJob/build?delay=0sec

That's it. Once you've typed the command, just have a look at your Jenkins dashboard and you'll see your project building. (you might also want to know about this)

Now to make a Git commit trigger the build, you have to navigate to the hidden ".git" directory in your git repository. Enter the "hooks" directory and you'll see there, a "post-commit.sample" file. You can open it with Notepad++ to see the contents of it.

Make a copy of the file and name it "post-commit". It does not need an extension. This is the file that Git will invoke whenever you do a commit to this particular Git repository. Don't worry about the fact that it looks like a Linux bash script. When Git triggers it, it will run even in Windows. If the file has a line ": Nothing", you can remove that line and insert this new line:

curl http://localhost:8080/job/someJob/build?delay=0sec

Now save the file, make some changes to your git repository and commit the changes. The moment you commit, you'll see the build being triggered in Jenkins! Awesome! :)

-----------------------------------------------------------------

Additional note: Many people reach this page via a StackOverflow answer. One such person (see comment below answer) mentioned being confused about what "someJob" was and also had faced an issue with his project name having a space in between, so he had to substitute "%20" in place of a space "codecept%20tests". Hope his response would be of help to anyone else who faces a similar situation. Thank you Paul.

Some people have emailed me asking if they could thank me
for having given them knowledge through the blog posts. The best way
to thank me is by contributing to Open Source.
Being a sweetheart if you'd like to give a more personal thank you,
then I don't really like the idea of monetary donations, but maybe a wishlist wouldn't be that bad.

Friday, February 7, 2014

I'm currently using the SmartGit client, as it's good and crossplatform. When I wanted to connect to my GitHub repository for a hobby project I was working on, I was a bit uncomfortable sharing my Github password with the application. Good thing is, Github allows you to also create a token which SmartGit can use to authenticate.

Click on settings on the top of the page:

Select "Applications" and "Create a new token". Use the hash value that gets generated (and treat this token like you would treat a password)

Wednesday, February 5, 2014

How many developers actually help out in the open source community? The numerous softwares we get to use for free are a result of people willingly putting in effort to create good quality softwares. I believe that if we're using such softwares, we can also help the community by contributing back.

Some ways you can contribute:

1. Be a part of the forums / mailing-lists and answer queries of people struggling with learning / implementing the software. I've been a member of some forums and mailing lists under various usernames (Actionscript, Intel TBB, Processing, OSG, OGRE, Stackoverflow and it's sister sites, linuxforums, ffmpeg, netsnmp, SDL and many others).2. Join the development of the software and contribute patches. Websites like OpenHatch can help you get up to speed with the process.3. Allow the software to report back crashes and anonymous usage statistics. The latter helps the dev's to improve the UI and interactivity by having authentic user journeys. I've allowed these for Fedora, Netbeans and a few other softwares.4. When you find a bug, report it on their issue tracking system. I filed an issue today.5. Sponsor them. Jenkins allows you to sponsor a particular issue. Other projects allow you to donate to the overall development effort. These people really do deserve sponsorship for the great work they're doing.6. Add to the Wiki. Most projects have a Wiki page which you can add useful information to.7. Create tutorials. Many users have a tough time learning how to use a software. You can create video tutorials and post them on youtube or post tutorials on your blog. I used to create tutorials on Stackoverflow too: my Mutex tutorial becoming the highest ranked in Google searches.

Doing all this not just makes you a good contributor to the community, it also expands your skills. It makes you a better developer, as you get exposure to international best-practices, standards, technologies. It improves your communication and hones your technical skills. I'd encourage every software developer to participate. All the best!

Monday, February 3, 2014

It was nice learning Gradle, but I felt it'd be a bit more convenient to have Gradle inside the Eclipse IDE. Gradle is already present in the Netbeans IDE, but for Eclipse you have to install it like so:This project at Github is what you need: https://github.com/spring-projects/eclipse-integration-gradleFrom the documentation on the website, just follow the same steps:

Review the list of software that will be installed. Click "Next" again.

Review and accept licence agreements and Click "Finish".

It'll take a while to install:

Now in Project Explorer, right click on your project, go to Run As > 2. Gradle... to run the project under whichever tasks you want to select.

You don't always have to return to this dialog box. The next time, you can simply run the selected tasks using Run As > 1. Gradle.If you add any tasks externally, click the refresh button to view that task.It's that simple. Happy building! :)

Saturday, February 1, 2014

If you've already installed the JDK, it's as simple as this:type locate jdk and search for the path.Mine was in /usr/local/jdk1.7.0_45/So I opened up bash_profile withvim ~/.bash_profileand added the following line into it.JAVA_HOME=/usr/local/jdk1.7.0_45export JAVA_HOME

Also add :PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/gradle-1.10/bin:/usr/local/jdk1.7.0_45/bin

So that when you execute commands like jar -xf somejar.jar, the executables will be recognized.

Then type source ~/.bash_profile to activate the changes you made (basically the whole of bash_profile will be executed again).That's it! all programs will recognize JAVA_HOME. I had to do this for Gradle to recognize the path. Without the path, it didn't compile Java programs.

Special Posts

Etcetera

You can call me a versatile creator. I'm known for quickly adopting new technologies and creating good quality working products with them. Apart from spending most of my life getting people to pronounce my name correctly, I also have a taste for fun, adventure and unprejudiced thought.