hudson 최신 배포판에서의 tomcat deploy 설정과 Jenkins에서의 tomcat deploy 설정은 전혀 틀리다.. 기존에 올린 hudson 설정에서는 메이븐에 톰캣 플러그인을 추가하였으나 Jenkins에서는 딱 두가지만 설정하면 된다.

 

1. Plugin 관리에서 Deploy Plugin을 먼저 설치한다.

--> 설치를 하고나면 아래와 같이 Post-build Actions 메뉴에 "Deploy war/ear to a container" 체크박스 메뉴가 생긴다. 



Deploy to container Plugin 1.9에서는 context를 설정할 수 있다. context 값을 /으로 설정하면 *.war 파일이 ROOT.war 로 배포된다.


--> 메이븐의 톰캣 플러그인을 이용하는게 아니기때문에 pom.xml에 톰캣 플러그인 설정이 없어진다. 그렇기때문에 메이븐의 settings.xml 에 server 설정또한 없다. 위와 같이 톰캣 매니저에 대한 정보만 정확하게 적어준다.

 

다음으로 tomcat7의 tomcat-users.xml 에 manager-script  role만 아래와 같이 추가를 해주면 된다.

<tomcat-users>

 <role rolename="manager-script"/>

 <role rolename="manager-gui"/>

 <user username="admin" password="6877" roles="manager-gui, manager-script"/>

</tomcat-users>

 

--> 이 두가지만 설정해주면 tomcat manager를 이용해서 알아서 배포를 한다. 이 두가지 설정에 대해서 제대로된 문서가 없어서

겨우 겨우 deploy 하는데 성공했다. 반나절이나 소모를 해서 진이 다 빠진다..



출처 - http://cafe362.daum.net/_c21_/bbs_search_read?grpid=1DpW4&fldid=NQIz&datanum=9&contentval=&docid=1DpW4NQIz920120105182605 




'IDE & Build > Jenkins' 카테고리의 다른 글

jenkins - subversion post-commit hook 설정 및 troubleshooting  (0) 2013.06.08
jenkins - 설정  (0) 2013.06.05
jenkins - installation and update  (0) 2013.06.05
hudson과 jenkins  (0) 2012.04.25
hudson - 참고 사이트  (0) 2012.04.14
Posted by linuxism
,



Maven repository for Google-Cloud-Messaging server library

This permits to manage the Google GCM library with Maven. The gcm-server.jar provided with the Android SDK, used by servers to send push notification to Android devices, is not hosted in any official Maven repository. This is why a created this personal repository. The library has a dependency (simple-json) which is handled in the pom i've written.

Usage

Add the repository to your maven configuration:

<repository>
    <id>gcm-server-repository</id>
    <url>https://raw.github.com/slorber/gcm-server-repository/master/releases/</url>
</repository>

And then add the dependency

<dependency>
    <groupId>com.google.android.gcm</groupId>
    <artifactId>gcm-server</artifactId>
    <version>1.0.2</version>
</dependency>

If you build your client with Android you can also add the client dependency, thanks to cjbest:

<dependency>
    <groupId>com.google.android.gcm</groupId>
    <artifactId>gcm-client</artifactId>
    <version>1.0.2</version>
</dependency>

I've only deployed the 1.0.2 version, which is the version i've found in the ant script associated with the gcm-server sources.

Contribute

If you need another version, of gcm-server which is not already hosted on this server, don't hesitate to create a pull request.

You can see everything i've used here: https://github.com/slorber/gcm-server-repository/deployer

  • The source and jar files
  • The pom
  • A script to install the files to your local maven repository

The pom is required to handle the dependency of the project (simple-json 1.1 here). The script deploys files to ~/.m2/repository/com/google/android/gcm/gcm-server/1.0.2/ You just need to copy this files in your gcm-server-repository/releases/com/google/android/gcm/gcm-server/1.0.2/ and create your pull request

How to build your own Github repository: http://cemerick.com/2010/08/24/hosting-maven-repos-on-github/

LICENSE

This repository respects the Apache License distribution rules. No original files were modified



출처 - https://github.com/slorber/gcm-server-repository


'Android > GCM' 카테고리의 다른 글

GCM 특징 및 설정  (0) 2013.01.18
android - 아이폰, 안드로이드 통합 푸시 서버 만들기  (3) 2012.09.11
android - C2DM 이용하기  (0) 2012.09.11
Posted by linuxism
,


subversion post-commit hook 적용 시 jenkins 응답이 forbidden(403 status) 일 때

jenkins > Configure Global Security 에서 Prevent Cross Site Request Forgery exploits 이 체크되어 있다면 해제 한다.

해제하지 않을 경우 다음 처럼 post-commit 를 작성

 More robust *nix post-commit hook example

The basic script above is fine if your server does not do authentication or you have no problem providing anonymous read access to Jenkins (as well as anonymous read to all the individual jobs you want to trigger if you are using project-based matrix authorization). Here is a script that includes the more robust security concepts hinted at in the basic example. 

#!/bin/sh
REPOS="$1"
REV="$2"

# No environment is passed to svn hook scripts; set paths to external tools explicitly:
WGET=/usr/bin/wget
SVNLOOK=/usr/bin/svnlook

# If your server requires authentication, it is recommended that you set up a .netrc file to store your username and password
# Better yet, since Jenkins v. 1.426, use the generated API Token in place of the password
# See https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients
# Since no environment is passed to hook scripts, you need to set $HOME (where your .netrc lives)
# By convention, this should be the home dir of whichever user is running the svn process (i.e. apache)
HOME=/var/www/

UUID=`$SVNLOOK uuid $REPOS`
NOTIFY_URL="subversion/${UUID}/notifyCommit?rev=${REV}"
CRUMB_ISSUER_URL='crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)'

function notifyCI {
	# URL to Hudson/Jenkins server application (with protocol, hostname, port and deployment descriptor if needed)
	CISERVER=$1

	# Check if "[X] Prevent Cross Site Request Forgery exploits" is activated
	# so we can present a valid crumb or a proper header
	HEADER="Content-Type:text/plain;charset=UTF-8"
	CRUMB=`$WGET --auth-no-challenge --output-document - ${CISERVER}/${CRUMB_ISSUER_URL}`
	if [ "$CRUMB" != "" ]; then HEADER=$CRUMB; fi

	$WGET \
		--auth-no-challenge \
		--header $HEADER \
		--post-data "`$SVNLOOK changed --revision $REV $REPOS`" \
		--output-document "-"\
		--timeout=2 \
		${CISERVER}/${NOTIFY_URL}
}

# The code above was placed in a function so you can easily notify multiple Jenkins/Hudson servers:
notifyCI "http://myPC.company.local:8080"
notifyCI "http://jenkins.company.com:8080/jenkins"

The script above takes care of the Prevent Cross Site Request Forgery exploits option if you have it enabled on your server. If you do not have that option enabled, the extra wget call is harmless, but feel free to remove it if you do not need it. The script above also requires that you set up a .netrc file in the home directory of the user you are running subversion as (either the svnserve process or httpd). For more info on .netrc file syntax, look here. The script above makes it easy to notify multiple Jenkins servers of the same SVN commit. If you have a .netrc file, it keeps it easy even if they have different admin users set up. If you don't want to mess with a .netrc file, you could just hard-code the user and password (or API Token) info in the file and add --username=user and --password="pass" flags to the wget calls. 



출처 - https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin







jenkins.log에 다음 에러 발생 시

Jun 08, 2013 4:52:34 AM hudson.scm.SubversionRepositoryStatus doNotifyCommit

WARNING: No subversion jobs found


아래 내용 참고

Johnny Horvi added a comment - 28/Sep/11 1:24 PM

We had a similar issue with 1.428 when we had enabled project-based security and using LDAP for authentication.
Whenever we ran a post-commit as suggested at the plugin site, we got the following error in the Jenkins logfile:

Sep 28, 2011 2:55:54 PM hudson.scm.SubversionRepositoryStatus doNotifyCommit
WARNING: No subversion jobs found

Our workaround was to enable project-based security on the job we wish to trigger and give read access to "Anonymous".

Hope this can help.


출처 - https://issues.jenkins-ci.org/browse/JENKINS-9529


설정 예제








'IDE & Build > Jenkins' 카테고리의 다른 글

jenkins - war 파일 배포  (0) 2013.06.08
jenkins - 설정  (0) 2013.06.05
jenkins - installation and update  (0) 2013.06.05
hudson과 jenkins  (0) 2012.04.25
hudson - 참고 사이트  (0) 2012.04.14
Posted by linuxism
,