Hiển thị các bài đăng có nhãn Bamboo. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Bamboo. Hiển thị tất cả bài đăng

Chủ Nhật, 28 tháng 7, 2013

chmod folder with exec in ant build

I want to chmod recursively in my build.xml and borrowed the following from this post:

<chmod file="${basedir}/foo/**" perm="755" type="both"/>
 
It's unbelievably slow since that directory is deep and includes a large number of files.
This works much better & faster:

<exec executable="chmod" dir="${basedir}/foo" failonerror="true">
    <arg line="-R 0755 ." />
</exec>
 
http://osdir.com/ml/user-ant-apache/2010-12/msg00066.html 
 
http://ant.apache.org/manual/Tasks/copy.html 
 
http://ant.apache.org/manual/Tasks/mkdir.html 
 
http://ant.apache.org/manual/Tasks/ 

Thứ Tư, 24 tháng 7, 2013

Format build number from bamboo number

 https://answers.atlassian.com/questions/19648/changing-the-build-number-format

http://stackoverflow.com/questions/17174505/propertyregex-not-able-to-capture-numbers



We created a function in a build file that we included into our other NAnt scripts that handles converting the integer build number from Bamboo. Here is that function

<?xml version="1.0"?>
<!-- Generated by NAntBuilder v2.0-->
<!-- =================================
Project: FormatBuildNumber
Author : Lance Lyons
Onlife Health Solutions

Required inputs: Unpadded Buildnumber

Output: Build.version = Buildnumber padded with 0's to fill 3 digits

This script will take a buildnumber and format it to a certain
number of digits

The default will be 3 digits.


To change to a longer build number say 4 or 5 digits then update the statement below in the C# code

sTemp = releaseprefix+"."+String.Format("{0:000}", buildnumber);

to
sTemp = releaseprefix+"."+String.Format("{0:0000}", buildnumber);
or
sTemp = releaseprefix+"."+String.Format("{0:00000}", buildnumber);

for 4 and 5 digits respectively.
================================= -->
<project name="FormatBuildNumber" default="main">

<loadtasks assembly="C:\nantcontrib-0.85\bin\NAnt.Contrib.Tasks.dll" />

<property name="build.number" value="" readonly="false" />
<property name="build.releaseprefix" value="" readonly="false" />


<script language="C#" failonerror="true">
<code>
<![CDATA[
[Function("fFormatBuildNumber")]
public static string fBuildnumberfunc(string releaseprefix, int buildnumber)
{
//String sTemp= new String;
string sTemp;
sTemp = releaseprefix+"."+String.Format("{0:000}", buildnumber);

return sTemp;
}
]]>
</code>
</script>

<property name="build.version" value="${script::fFormatBuildNumber(build.releaseprefix,build.number )}" readonly="false" />



<target name="main" >

<echo message='Build version is ${build.version}'/>
</target>
</project>

Thứ Năm, 20 tháng 6, 2013

Fix error "java.lang.OutOfMemoryError" when build in bamboo server

Cause

The main part of the above error message is this: "java.lang.OutOfMemoryError: Java heap space". Bamboo remote agent runs out of Java heap.

Resolution

Increase the heap from REMOTE_AGENT_INSTALL/conf/wrapper.conf file:
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=512
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=1024

In case a similar error happens for Bamboo server, the heap can similarly be increased for Bamboo server from BAMBOO_INSTALL/conf/wrapper.conf file:
...
wrapper.java.additional.3=-Xms512m
wrapper.java.additional.4=-Xmx1024m
...
It is hard to guess how much memory should be allocated for Bamboo server or for remote agents. That's why it's a good idea to increase the default values a little bit in case the error happens and see how that goes.


Add Environment Variables: 

JAVA_OPTS="-Xmx256m -Xms128m"
JAVA_OPTS="-Xmx512m -Xms256m"


ANT_OPTS=”-Xmx1024m -Xms512m”
MAVEN_OPTS "-XmsMIN_HEAPm -XmxMAX_HEAPm"

Thứ Sáu, 31 tháng 5, 2013

Install Bamboo in Ubuntu

1. Download Bamboo in : http://www.atlassian.com/software/bamboo/download?os=linux

cd ~
mkdir BAMBOO
cd BAMBOO
wget http://www.atlassian.com/software/bamboo/downloads/binary/atlassian-bamboo-4.4.5.tar.gz
2. Extract package:
tar -zxvf atlassian-bamboo-4.4.5.tar.gz

3. Set up your Bamboo home directory — this is the directory where Bamboo will store its configuration data. To do this, open the file named bamboo-init.properties in the <Bamboo installation directory>/webapp/WEB-INF/classes

gedit bamboo-init.properties
bamboo.home=/data4tri/BAMBOO


4.  Launch Bamboo

cd  atlassian-bamboo-4.4.5/wrapper

./start-bamboo start

5. open web browser and entering the address: http://localhost:8085/.

 

 

Launch Bamboo on Linux

There are two ways you can launch Bamboo on Linux — using either a startup script or a Java Service Wrapper:

Launch via bamboo.sh startup script

You can start Bamboo with the default bamboo.sh file in your installation root directory. The bamboo.sh command accepts the following options (e.g. ./bamboo.sh start):
  • start — this starts Bamboo.
  • stop — this stops Bamboo.
  • restart — this restarts Bamboo
  • status — this provides the current status of Bamboo.

Launch via Java Service Wrapper


The wrapper is platform-specific and doesn't work on SunOS.
You can also start Bamboo using a Java Service Wrapper, which provides services such as automatic restarting. To do this, you will need to use the start-bamboo command available in the /wrapper folder of the Bamboo installation. You need to run the command with one of the following options (e.g. ./start-bamboo start):
  • console — this starts Bamboo in a console. The logs will scroll to standard out.
  • start — this starts Bamboo.
  • stop — this stops Bamboo.
  • restart — this restarts Bamboo
  • status — this provides the current status of Bamboo.
  • dump — stops Bamboo abruptly by killing the process
(info) If you have installed Bamboo on a machine with multiple interfaces, and need to bind Bamboo to a single IP address, please see Binding Bamboo to one IP address.

Thứ Sáu, 24 tháng 5, 2013

Continuous Integration Tools

http://en.wikipedia.org/wiki/Continuous_integration

1. jenkins - http://jenkins-ci.org/

2. hudson - http://hudson-ci.org/

3. Bamboo - http://www.atlassian.com/software/bamboo/overview
document : https://confluence.atlassian.com/display/BAMBOO/agent


Compare: http://en.wikipedia.org/wiki/Comparison_of_continuous_integration_software
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=53608972
http://bobbickel.blogspot.com/2011/03/jenkins-vs-hudson-time-to-upgrade.html

Bamboo and Jenkins

When considering Continuous Integration (CI) for your project, you have to think of tools that are readily available out there. Few such names that comes to our attention are Jenkins (Hudson), Bamboo, etc that are widely used by some of the major companies in the world. Recently I was involved with trying out Bamboo and Jenkins. Jenkins is an open source CI tool written in Java with more than 400 plugins available to extend its use. Bamboo is a commercial product from atlassian. It also has multiple plugins to customize its usage. Further we can also extend the functionality of both the above products by writing our own plugins using the SDK’s provided.

Both Jenkins and Bamboo supports multiple build tools that are available today, such as Maven, Ant, Make etc. Bamboo has support for both Maven2 and Maven3. Also we can run multiple projects builds with different version of Maven at the same time. Jenkins also has the same support where we also can specify different local maven repositories for different builds. This is a major advantage that these tools provide. Another point to note that we just have to give the source repository location of project when creating a new build (both the tools use different term for a new build, Bamboo – PLAN, Jenkins – JOB), then the CI tool will fetch the source files. Both these tools support almost every VCS available, such as Git, Subversion, etc. We can also specify some additional parameters when defining a new build, such as java heap memory, maven optional parameters (MVN_OPTS), so that we can allocate and fulfill the requirements.

We have to specify the goal for a build, such as maven or ant goal for each build. These tools allows to add multiple post build actions. So when a build fails or succeeds we can define what should take place, such as run tests, process test reports, code coverage reports and data visualization documents. This allows to create a pipeline structure for your build so we can break the build process into multiple steps which will makes the process easy to monitor.
We can setup these systems to send mails automatically, so that we can find out what is the status for each build. Bamboo even allows to integrate both way instant messaging so that we can instantly monitor the build.

Bamboo has a nice UI compared to Jenkins, but moreover both these tools provide almost same functionality and there are no any major deference in these tools. Some advantages that we can find is that since Bamboo is an atlassian product, the integration of JIRA issue tracker and Clover, the code coverage tool, becomes easy with bamboo. Jenkins has a set plugins to create dashboard like view for each of your build. We can add several gadgets to this dashboard which can show the statistics of a particular build or aggregated for all the builds.
Finally on my point of view, both these tools are same when comparing each other on functionality wise. The choice will depend on the need and the requirements at hand.



Học lập trình web căn bản với PHP

Bài 1: Các kiến thức căn bản Part 1:  https://jimmyvan88.blogspot.com/2012/05/can-ban-lap-trinh-web-voi-php-bai-1-cac.html Part 2:  https://...