For one file ,
grep -rli ‘TextToBeReplaced’ /path/to/filename | xargs -i@ sed -i ‘s/TextToBeReplaced/ReplacementText/g’ @
for many files
grep -rli ‘TextToBeReplaced’ –include=/path/to/*.txt | xargs -i@ sed -i ‘s/TextToBeReplaced/ReplacementText/g’ @
For one file ,
grep -rli ‘TextToBeReplaced’ /path/to/filename | xargs -i@ sed -i ‘s/TextToBeReplaced/ReplacementText/g’ @
for many files
grep -rli ‘TextToBeReplaced’ –include=/path/to/*.txt | xargs -i@ sed -i ‘s/TextToBeReplaced/ReplacementText/g’ @
jimmydunne1 vs joseantoniodelavega – Live Chess http://www.chess.com/livechess/game?id=853530800 via @chesscom
joseantoniodelavega vs kihwan – Live Chess http://www.chess.com/livechess/game?id=836767739 via @chesscom
joseantoniodelavega vs Sho2 – Live Chess http://www.chess.com/livechess/game?id=826559047 via @chesscom blitz 5 min rated
kaizen08 vs joseantoniodelavega – Live Chess http://www.chess.com/livechess/game?id=826426312 via @chesscom
joseantoniodelavega vs davidjosephlawler – Live Chess http://www.chess.com/livechess/game?id=824691737 via @chesscom
joseantoniodelavega vs mogensbech – Live Chess http://www.chess.com/livechess/game?id=823469116 via @chesscom
# sudo apt-get install davfs2
# sudo dpkg-reconfigure davfs2
Uncomment the line secrets ~/.davfs2/secrets
Add a line to the end of file in following style:
https://<WebDav URI> <username> <password>
Set the permission:
# chmod 600 ~/.davfs2/secrets
https://<WebDav URI> <mount point> davfs user,noauto,file_mode=600,dir_mode=700 0 1
# sudo vi /etc/group
Add your username as follows:
davfs2:x:134:<username>
# mount <mount point>
# umount <mount point>
You can also use nautilus to mount/umount the directory.
Initially Liferay Maven repository must be added so edit you maven settings xml
$ nano ~/.m2/settings.xml
and add the following
<repository>
<id>liferay-ce</id>
<name>Liferay CE</name>
<url>https://repository.liferay.com/nexus/content/groups/liferay-ce/ </url>
</repository>
…
<pluginRepository>
<id>liferay-plugin</id>
<url>https://repository.liferay.com/nexus/content/groups/liferay-ce/ </url>
</pluginRepository>
Next step is to checkout liferay from liferay git repository.
$ git clone https://github.com/liferay/liferay-maven-support
$ cd liferay-maven-support/
List the available tags
$ git tag -l
should produce a list like that
….
6.1.20
6.1.30
6.2.0
6.2.0-b1
6.2.0-b2
6.2.0-ga1
…6.2.10.1-ga1
Checkout the version you want
$ git checkout tags/6.2.10.1-ga1
Switch to Tag resources
$ git branch -D master
$ git checkout -b master
Build and install Liferay Maven support version 6.2.10-ga1
either with
$ mvn clean package install
for module supprot or for complete liferay artifact support
$ mvn clean install
at the end of the process you should see something like ,
[INFO] ————————————————————————
[INFO] Reactor Summary:
[INFO]
[INFO] Liferay Maven 2 Support ……………………… SUCCESS [ 0.279 s]
[INFO] Liferay Maven 2 Archetypes …………………… SUCCESS [ 0.004 s]
[INFO] Liferay Maven 2 Ext Archetype ………………… SUCCESS [ 1.404 s]
[INFO] Liferay Maven 2 Hook Archetype ……………….. SUCCESS [ 0.326 s]
[INFO] Liferay Maven 2 Layout Template Archetype ……… SUCCESS [ 0.307 s]
[INFO] Liferay Maven 2 Portlet Archetype …………….. SUCCESS [ 0.197 s]
[INFO] Liferay Maven 2 Portlet ICEfaces Archetype …….. SUCCESS [ 0.087 s]
[INFO] Liferay Maven 2 Portlet JSF Archetype …………. SUCCESS [ 0.094 s]
[INFO] Liferay Maven 2 Portlet Liferay Faces Alloy Archetype SUCCESS [ 0.080 s]
[INFO] Liferay Maven 2 Portlet PrimeFaces Archetype …… SUCCESS [ 0.255 s]
[INFO] Liferay Maven 2 Portlet RichFaces Archetype ……. SUCCESS [ 0.064 s]
[INFO] Liferay Maven 2 ServiceBuilder Archetype ………. SUCCESS [ 0.118 s]
[INFO] Liferay Maven 2 Theme Archetype ………………. SUCCESS [ 0.085 s]
[INFO] Liferay Maven 2 Web Archetype ………………… SUCCESS [ 0.379 s]
[INFO] Liferay Maven 2 Plugins ……………………… SUCCESS [ 0.014 s]
[INFO] Liferay Maven 2 Plugin ………………………. SUCCESS [ 3.433 s]
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 8.966 s
[INFO] Finished at: 2014-04-30T10:33:43+02:00
[INFO] Final Memory: 28M/210M
Next we want to keep this versioned since we might wish to make changes to the code or to have build integration with Jeknins and artifactory.
For this reason a liferay svn repository is created, if you want to know more about the configuration you can check my previous post.
$ svnadmin create /usr/local/svn/repos/liferay
$ nano /usr/local/svn/repos/liferay/conf/svnserve.conf
[general]
#anon-access = none
anon-access = read
auth-access = write
password-db = /usr/local/svn/passwd-team
realm = Team
Ctrl-X to save
Then back to the directory you checked out liferay with maven support , checkout your empty repository
$ svn checkout svn://localhost/liferay .
Add all to subversion recursively
$ svn add * –force
$ svn commit ‘Initial Version’
For a “How-To” Build Integration with Jenkins and Artifactory, you can read my earlier post .
References: how-to-configure-liferay-maven-plugin-module-with-liferay-portal-6-2
After Jenkins is installed and configured , we need to download and install artifactory plugin for jenkins. This is done by going to Manage Jenkins > Manage Plugins refresh the list of available plugins select the artifactory plugin.
Next go to artifactory plugin configuration , Manage Jenkins > selecting artifactory plugin.
Enter the artifactory root url as onfigurged it in the previous post or as you have configured it.
http://localhost:8081/artifactory/
If you not allow anonymous reads make sure you enter username / password so that jenkins will be able to connect
then click save
Now In order to be able to deploy artifacts to artifactory , we need to create user for jenkins.
Admin > Security >Users > Create new User
Fill in the required fields, for the purpose of this post i created the jenkins user under name “jenkins”
Let the checkboxes as they are by default. After the user is created, we need to give the user deploy permnissions to the selected target repositories
Admin > Security >Users > Permissions
Under permission management we will edit “Anything” permission target or create a new one.
Select the Snapshots and release repositories of the repository you wish to deploy, then go to users tab and give and check deploy for user jenkins. Save Changes.
Now we are ready to create a new job under jenkins and deploy to artifactory
New Item > fill the Item name form and select “build maven 2/3 project” click okto go to the project configuration screen.
Under Source Code Management, choose subversion, as configured in the previous post.
Fill in the svn url for your project svn://localhost/liferay, and or any credenetials you might have
Next provide a ROOT POM , pom.xml in Build sectrion and under Goals and options type clean install
Note: The ROOT POM should be in the root or a subdirectory of yuor project, and the path will be relative, so if you write just pom.xml means that the pom is in the root directory of your project. Similarly writing “maven/pom.xml” means that the pom file is in the maven subdirectory of your project root folder.
Once configured , you won’t have to worry for unresolved references in your projects.
Under Build Environment check : Resolve artifacts from artifactory enter your artifactory url, http://localhost:8081/artifactory/ select a repository from the automatically selected repositories “repo”
Finally at Post-Build Actions select , Deploy artifacts to artifactory,check the artifactory url, then select the repositories you gave deploy access to user jenkins we created earlier in this post.
“local-repo-release” and local-repo-snapshot”
At deploy time the target repository will be selected automatically , based on the deployed artifact type.
Check override default deployer credentials as our default user “anonymous” has only read access and enter “jenkins” credentials.
username: jenkins
password: somepassword
click save .
Next click build now to build the project and jenkins to use artifactory to download the required artifacts and upload your build.
Thats IT!
You should now have a fully traceable environment with jenkins, maven and artifactory working with subversion.
References: Jfrog tutorials & Screencasts