Creating a remote from an already existing depo

0

Posted by Jaime | Posted in Coding, DevOps | Posted on 30-10-2016

Tags: , ,

Today, I created a remote depo, so that I can use the DVCS functionality in P4 with one of my projects.

First, I connected to my perforce server and typed:

$p4 remotes

To see all of the remotes that were on the server. Before doing this command you have to type:

$p4 login

Which thankfully, my username on the linux server is the same as my username in the Perforce server so I didn’t have to type that again.

Once I was logged in and saw that there was no remote set up for the project I wanted to use with DVCS, I typed:

$p4 remote PROJECT_CODE_NAME

This brought up NANO (I know some of you out there are rolling your eyes) and I modified the //local/… //remote/… paths to my liking. Remember, the left side represents the local depo representation on your computer and the right side of that mapping is the remote depo representation that is on your Perforce server.

Now, in another terminal, I typed:

$cd PATH_WHERE_YOU_HAVE_YOUR_DEVELOPMENT_WORK
$mkdir PROJECT_CODE_NAME
$cd PROJECT_CODE_NAME
$p4 -u jaimerios clone -p 192.168.1.10:1666 -r PROJECT_CODE_NAME

The last command then takes the files specified in the mapping and clones it to your local filesystem.

You can check that the origin server is set up by typing:

$p4 remote -o origin

Now, in my project, I had two read-only depos in my Perforce server that was for the Boost headers and the Google gtest framework libs.

For those normally import+ folders, I created a symbolic link to those folders that were already on my local filesystem:

$cd PROJECT_CODE_NAME/libs
$ln -s /Users/jaimerios/Development/Perforce/READONLY/libs/Boost ./Boost
$ln -s /Users/jaimerios/Development/Perforce/READONLY/libs/Google ./Google

And so far, everything seems to work well … except there are a few files I want p4 status to ignore, so:

$cd PROJECT_CODE_NAME
$nano .p4ignore

I added some folders and files to ignore and life is good.

So, onto happy coding 🙂

Using P4Plugin with Jenkins to publish assets

0

Posted by Jaime | Posted in DevOps | Posted on 28-12-2015

Tags:

perforce

I was previously using the Perforce Plugin in Jenkins to handle my tasks with Perforce, including adding files that needed to be released from a build, but in the past year, I’ve experienced some weirdness that lead me to evaluate the P4Plugin by Perforce.

All of the weirdness that I saw in the prior plugin went away, but I couldn’t figure out how to publish only certain files from a build.

There wasn’t anything in the documentation instructing you on how to do this feature and when I would use the Publish Assets feature, all of the extra files created in a build would be potentially added to my project, which was not the intent of the build.

It wasn’t until I found a bug report that said the following:

The shelve publish step should use a different workspace from the populate step. The view for this workspace should be very narrow (a Virtual stream, if using streams). Typically the view should be one or two files, limiting the files it will run the reconcile over.

By the way, I still haven’t figured out how to get Virtual streams to work in the P4Plugin as the plugin won’t recognize them.

So, to be able and isolate what you want published back to your Perforce server, you have to create another workspace to isolate the files, or directories, in question.

Hopefully, Perforce will include this text in their plugin documentation sometime soon.