Integrating Github With Eclipse | Github Integration With Eclipse

github-intergration-with-eclipse

Tagged : / / / / / / / / / / / / / /

Setting up the cron jobs in Jenkins using “Build periodically” – scheduling the jenins Job

cron-jobs-in-jenkins

Setting up the cron jobs in Jenkins using “Build periodically” – scheduling the jenins Job

Examples –
To schedule your build every 5 minutes, this will do the job : */5 * * * * OR H/5 * * * *

To the job every 5min past every hour(5th Minute of every Hour) 5 * * * *

To schedule your build every day at 8h00, this will do the job : 0 8 * * *

To schedule your build for 4, 6, 8, and 10 o’clock PM every day – 0 16,18,20,22 * * *

To schedule your build at 6:00PM and 1 AM every day – 0 1,18 * * *

To schedule your build start daily at morning – 03 09 * * 1-5

To schedule your build start daily at lunchtime – 00 12 * * 1-5

To schedule your build start daily in the afternoon – 00 14 * * 1-5

To schedule your build start daily in the late afternoon – 00 16 * * 1-5

To schedule your build start at midnight – 59 23 * * 1-5 OR @midnight

To run a job on 9.30p.m. (at night) on 3rd of May then I ll write or 21.30 on 3/5/2011 – 21 30 3 5 *

Every fifteen minutes (perhaps at :07, :22, :37, :52) 0 – H/15 * * * *

Every ten minutes in the first half of every hour (three times, perhaps at :04, :14, :24) – H(0-29)/10 * * * *

Once every two hours every weekday (perhaps at 10:38 AM, 12:38 PM, 2:38 PM, 4:38 PM) – H 9-16/2 * * 1-5

Once a day on the 1st and 15th of every month except December – H H 1,15 1-11 *

CRON expression

A CRON expression is a string comprising five or six fields separated by white space that represents a set of times, normally as a schedule to execute some routine.

Format

Field name

Mandatory?

Allowed values

Allowed special characters

Remarks

Minutes Yes 0-59 * / , –
Hours Yes 0-23 * / , –
Day of month Yes 1-31 * / , – ? L W
Month Yes 1-12 or JAN-DEC * / , –
Day of week Yes 0-6 or SUN-SAT * / , – ? L #
Year No 1970–2099 * / , – This field is not supported in standard/default implementations.

In some uses of the CRON format there is also a seconds field at the beginning of the pattern. In that case, the CRON expression is a string comprising 6 or 7 fields.

Special characters

Support for each special character depends on specific distributions and versions of cron
Asterisk ( * )
The asterisk indicates that the cron expression matches for all values of the field. E.g., using an asterisk in the 4th field (month) indicates every month.
Slash ( / )
Slashes describe increments of ranges. For example 3-59/15 in the 1st field (minutes) indicate the third minute of the hour and every 15 minutes thereafter. The form “*/…” is equivalent to the form “first-last/…”, that is, an increment over the largest possible range of the field.
Comma ( , )
Commas are used to separate items of a list. For example, using “MON,WED,FRI” in the 5th field (day of week) means Mondays, Wednesdays and Fridays.
Hyphen ( – )
Hyphens define ranges. For example, 2000-2010 indicates every year between 2000 and 2010 AD, inclusive.
Percent ( % )
Percent-signs (%) in the command, unless escaped with backslash (\), are changed into newline characters, and all data after the first % are sent to the command as standard input.[7]

Non-Standard Characters

The following are non-standard characters and exist only in some cron implementations, such as Quartz java scheduler.
L – ‘L’ stands for “last”. When used in the day-of-week field, it allows you to specify constructs such as “the last Friday” (“5L”) of a given month. In the day-of-month field, it specifies the last day of the month.
W – The ‘W’ character is allowed for the day-of-month field. This character is used to specify the weekday (Monday-Friday) nearest the given day. As an example, if you were to specify “15W” as the value for the day-of-month field, the meaning is: “the nearest weekday to the 15th of the month.” So, if the 15th is a Saturday, the trigger fires on Friday the 14th. If the 15th is a Sunday, the trigger fires on Monday the 16th. If the 15th is a Tuesday, then it fires on Tuesday the 15th. However if you specify “1W” as the value for day-of-month, and the 1st is a Saturday, the trigger fires on Monday the 3rd, as it does not ‘jump’ over the boundary of a month’s days. The ‘W’ character can be specified only when the day-of-month is a single day, not a range or list of days.
Hash ( # )
‘#’ is allowed for the day-of-week field, and must be followed by a number between one and five. It allows you to specify constructs such as “the second Friday” of a given month.[8]
Question mark ( ? )
In some implementations, used instead of ‘*’ for leaving either day-of-month or day-of-week blank. Other cron implementations substitute “?” with the start-up time of the cron daemon, so that ? ? * * * * would be updated to 25 8 * * * * if cron started-up on 8:25am, and would run at time every day until restarted again.

In addition, @yearly, @annually, @monthly, @weekly, @daily, @midnight, and @hourly are supported as convenient aliases. These use the hash system for automatic balancing. For example, @hourly is the same as H * * * * and could mean at any time during the hour. @midnight actually means some time between 12:00 AM and 2:59 AM.

Reference:
https://en.wikipedia.org/wiki/Cron#CRON_expression

Tagged : / / / / / / / / / / / /

How to setup Gitlab in local machine ?

gitlab-setup

Download gitlab from

https://www.gitlab.com/downloads/

Installation, setup, configuration, backup Instructions is given in…

https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
https://github.com/gitlabhq/gitlabhq/blob/6-1-stable/doc/install/installation.md

Tagged : / / / / / / / / / / / / / / / / /

Apache web server Installation Guide, know how to Install Apache web server on Windows 7?

apache-web-server-on-windows-7-installation-guide

After a quick detour to install Notepad++, I’m on my way to installing Magento. Before I can get into the meat of it, though, I do require a few prerequisites.

From the installation instructions, installing Magento requires:

  • Apache 1.3.x or Apache 2
  • PHP 5.2.0 and above with Safe mode off
  • MySQL 4.1.20 and above

After a brief search, I happened upon a very handy site (Yes, my current dev machine runs Windows 7). No sense reinventing the wheel, so these instructions should do nicely.

I’ve chosen the latest stable release, 2.2.17, MD5-verified and ready to install.

Always one to put the right foot forward… The first thing I’ve done is to immediately download the wrong version (src) instead of the neatly prepped installer (msi) as per the instructions. Round 1 goes to my eagerness, but after a neat revisit to the Apache download page, I’m off in the right direction.

After kicking off the Apache installer, my first instinct was to twitch at the frozen installer progress (Did the instructions forget about that ghastly Windows 7 User Account Control?), but after only a brief pause, the UAC prompt has displayed and the Apache web server installation is back on track.

None the worse for wear, time for the next step.

PHP

I’ve pretty much kaboshed most of the PHP installation instructions, mostly due to its avoidance of the handy PHP for Windows installer. Pointing the installer to the Apache web server’s cgi-bin folder seems like a good idea.

A configuration change…

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = “./”
; On windows:
extension_dir = “ext” ; Uncommented (removed the semicolon at the beginning of) this line

… and I’m back to the instructions. After an update to my environment variables, looks like it’s time for a reboot… and sleep.

I’ll be leaving the MySQL install (and testing Apache web server and PHP) ’til tomorrow.

Tagged : / / / / / / / / / / / / / / / / /

How to Setup Configure Hudson Master Slave? – Complete Guide

hudson-master-slave-setup
The tasks can be scheduled to run on the same machine (Master), or on a different machine (Slave). A master is a installation of Hudson, that can manage one or more slaves. The role of master remains same in Master slave setup. It serves HTTP requests, and it can still build projects on it’s own.
Slaves are computers that are setup to build projects triggered from the master. A separate program called slave agent runs on slave computer. In this article we’ll discuss about how to setup Hudson to executed distributed builds using Master slave. One computer can be configured to execute multiple slave agents.

How it works

When the slaves are registered to a master, the master starts distributing loads to slaves. The delegation depends on the specific job. The job can be configured to either execute on the master, or it can be tied to a specific slave. On the other hand, the jobs can be configured to freely roam between slaves, wherein the job is executed using the free slave. As per the user is concerned, the setup is transparent. The results for all jobs are viewable using the Master, irrespective of the Slave that executed the job.
The slave may be built using any Operating system. The Master slave setup is highly helpful while the user has to execute the job on different Operating system. Consider this use case: The application is expected to run on different operating system, Linux, Solaris and Windows system. To address this need, the user can install Hudson on any machine, say Linux, and add 2 slaves: Solaris and Windows. The user can add 3 different jobs, one running on Master itself and others running on slave machines.

Methods to set up Slave agents

The slave can be launched from Master using any of below methods:
  1. Launch Slave agents on Unix machines via SSH.
  2. Launch Slave agents via JNLP.
  3. Launch Slave agents via execution of command on the master.
  4. Let Hudson control windows slave as a windows service.

The following screenshot illustrates the list of modes under which the Hudson slave can be launched.

Set up Slave agents on Unix machines via SSH

Hudson has a built-in SSH client implementation that it can use to talk to remote sshd and start a slave agent. This is the most convenient and preferred method for Unix slaves, which normally has sshd out-of-the-box. Click Manage Hudson, then Manage Nodes, then click New Node. In this set up, the connection information is supplied, including SSH host name, user name and authentication credentials. The authentication is performed using password or ssh keys. If it is configured to use ssh keys, the SSH public key should be copied to ~/.ssh/authorized_keys file. Hudson will do the rest of the work by itself, including copying the binary needed for a slave agent, and starting/stopping slaves.

 

Depending on the project and hardware resource availability, the user Desktop can be used as one of Slave, without affecting his day-to-day activities, thus avoiding the need for dedicated Slaves.

Establish slave agent via Java Web Start

Another way of launching slave is to start a slave agent through Java Web Start (JNLP). In this approach, the user will login to the slave node, open a browser and open the slave page using the URL pointed to the Master. It may look like the following URL:
http://masterserver:port/hudson/jnlpJars/slave.jar
The user is presented with the JNLP launch icon. If user click the icon, the Java Web Start kicks in and it launches a slave agent on this computer.
This mode is convenient when the master cannot initiate a connection to slaves, such as when it runs outside a firewall while the rest of the slaves are in the firewall. The disadvantage is, if the machine with a slave agent goes down, the master has no way of re-launching it on its own.

Set up slave agent headlessly

This launch mode uses a mechanism very similar to Java Web Start, except that it runs without using GUI, making it convenient for an execution as a daemon on Unix. To do this, the user should configure this slave to be a JNLP slave by downloading slave.jar, and then from the slave, run a command like this:
 
java -jar slave.jar -jnlpUrl http://yourserver:port/computer/slave-name/slave-agent.jnlp

The slave.jar file is downloaded from the above mentioned URL. Make sure to replace slave-name with the name of the slave setup in Master.

By default, Hudson runs on port 8080. It can be installed and managed without the need for super user privilege. The super user privilege is not required to manage both Master and Slave.

The below diagram illustrates the list of configuration parameters specific to a slave.

 

set up Slave Agent using own scripts

If the above modes is not flexible, the user can write his own script to launch the Slave agent. The script is placed in the Master computer and Hudson runs this script whenever it should connect to the slave. The script may use the remote login program like SSH, RSH to establish connection between Master and slave.
The script would execute the slave agent program like java -jar slave.jar. The stdin and stdout for the script should be connected to the master. For example, the script that does ssh myslave java -jar ~/bin/slave.jar would satisfy this need, when it is executed from the Master web interface. For this reason, running this script manually from the command line does no good.
The copy of slave.jar can be downloaded from the above mentioned URL. Launching the slave agent using this mode requires additional setup in the Slave. The benefit is that when the connection goes bad, the user can use Hudson web interface to re-establish the connection.
Tagged : / / / / / / / / / / / / / / / /