How to open p4 file by a hyperlink - hyperlink

For example, I have written a document and submited to p4.Then I would like to share it on the company intranet or notify the others by email.
I create a post and refer to the p4 document as a hyperlink in the post.
When the user click on it, his local P4 will be launched to sync the document according to his p4 config(would be failed if he is not allow to access the relevant repo), then the document will be opend on his PC.
By imaging this feature, I am just trying to find a solution to share p4 document easily.
Since I dont want to upload the documents to the intranet then sync it between p4 manually.
Any suggestion is welcome.
thanks.

You can try using a custom url protocol and handler. This would allow you to write urls like p4v://Some/place/some/where/. The setup will depend on your platform.
Windows
Gnome
You could then set the handler to the p4v executable with the -s option. This will open a location, but it won't provide any kind of syncing.
p4v -s "//Some/place/some/where/"
You may also need to coerce the url into a valid perforce path. For example, windows urls will include the text before the colon, causing problems.
p4v -s "p4v://Some/place/some/where/"
So you will probably have to write a wrapper script around the execution of p4v to do some text filtering. This is all kind of a pain, which is why I haven't done it myself.

Another simple technique is to set up your intranet web server to serve documents from a frequently-sync'd workspace, as described here: http://www.perforce.com/customers/white_papers/web_content_management_perforce in the section "2. A Simple WCM Approach".
I have used this mechanism, with an Apache web server, and a Perforce client workspace with a cron script sync'ing the workspace every 10 seconds, to share documents via URL in a development environment with dozens of active developers, quite successfully.

The only thing that comes to mind is P4Web, which serves Perforce depot via HTTP. It still wouldn't solve the "sync automatically according to his p4 config", but at least you could send links to your document.

Related

save/load thingsboard configuration

Is it possible to somehow serialize current Thingsboard (let's call it TBoard) configuration, save it and than latter load saved configuration on TBoard startup.
I am specifically interested in loading device profiles, rule chains, and dashboards.
I want to save configuration together with my project in git repository so than latter I could just use docker-compose to start multiple services from project (let's call them sensors) and single TBoard instance with saved configuration which will be used for collecting telemetry from sensors and drawing dashboards.
Another reason for saving configuration is what happens if for some reason TBoard container crashes or somehow get corrupted so it can't be started again, would I have to click on the things again in order to create all device profiles, dashboards, configure rule chains ... etc etc ... ?
Regarding this line
I am specifically interested in loading device profiles, rule chains, and dashboards. I want to save configuration together with my project in git repository
I have just recently implemented version control for my Thingsboard deployment. The way i am doing it is with the python REST client.
I have written functions to export all dashboards/data converters/integrations/rule chains/widgets into json files which I save into a github repository.
I have also written the reverse script to push the stored files to a fresh environment, essentially "flashing" it. Surprisingly, this works perfectly.
I have an idea to publish this as a package, but it's something I've never done before so I'm unsure if I will get to it.
Just letting you know that it is definitely possible to get source control operational via the API.

Is it possible to create or edit a Jenkins Project on the fly?

My question was too long so I've shortened it:
Is it possible to create or edit a Jenkins Project on the fly with a template/environment variables/coding/etc, and would this be possible via a trigger from Gitlab/hub/etc.? If someone could point me in the right direction that would be great! Thanks!
Yes.
Your options are to use the rest API (and there's more detailed information in your own Jenkins, check the link in the bottom right corner of every page), or to create the job directory structure and XML files manually and have Jenkins re-scan its workspace directories.
I strongly recommend the rest API. It's designed for this sort of thing.

Sharing files in Jenkins

my post-commit build process in Jenkins prepares several files that are very useful in everyday development. Currently we zip necessary files, copy to a director that is simply shared resource.
I'm looking for some kind of a plugin that would allow me to point a directory for publishing and present its content (something like workspace view in defined job).
Any suggestions ??
OK, I solve this problem with jenkins default direcotry JENKINS_HOME\userContetn (files available from jenkins web page) and mentioned here side-bar-plugin. I created needed symbolic links in userContents and then added applicable links to mail window. Works great. Thx for hints!

Jenkins: Make file publicly available

I am creating files with a custom version number during the build that I want to be publicly available through http.
Assuming I am building the project "MyTestApp", I want the version number text file I created to be available at a location like http://jenkins.company/job/MyTestApp/revision.txt
Any idea how to achieve this?
David, this depends on what you mean by "publicly available". If your Jenkins instance is secured (jenkins.company/configureSecurity/), then access to artifacts requires that your http session be authenticated. If all users who need access have accounts on the Jenkins server, then you just need to use the post-build action "archive the artifacts", and your text file would be available here:
jenkins.company/job/MyTestApp/jobnumber/artifact/revision.txt
Or here:
jenkins.company/job/MyTestApp/lastSuccessfulBuild/artifact/revision.txt
See this screenshot: http://note.io/17oiykI
If you need unauthenticated access, you could publish your artifacts to another web server on the same or a different host. Or you could upload them to an Amazon S3 bucket.

Offline access on iPad to svn diff information

I've seen a couple iOS apps that allow access to svn logs, but none as nice as iOctocat is for git. It appears I could use iOctocat on a network to collect all the data, and then view it offline. I need to do that for svn, not git.
I'm looking for a way to read svn log commit diffs in an offline state on an eReader (prefer iPad, but could switch to say Kindle Fire if required.) Is there any OSX software/scripts that can get an svn server log, perform diffs, and output into files for viewing on an iPad, or alternatively, into a PDF that can be viewed darn near anywhere?
I'm trying to get a bit more productive on my 1.5 hour bus ride, and this could help tremendously...
Git is a DVCS which consists in having the whole repository, with its whole history, on every "client" machine. SVN is a centralized VCS, where the working copy only has the latest version of every file. The history is only available on the server.
If offline work is so important, git is obviously a much better choice, and you should switch to git. I don't think any SVN tool will ever give you access to previous versions offline, because that's just not how SVN works.
If you just want to review the logs, you can generate a PDF file easily enough. The command:
svn log | enscript -o log.ps
makes a PostScript file from the log for the current working directory. You can follow that with:
pstopdf log.ps
to generate log.pdf, a PDF file that contains your Subversion log. You can obviously automate that process to your heart's content. You might even run the process every few hours and post the result on an internal web server where it's easy to grab. You can also make the PDF file that you generate a lot fancier by configuring enscript, which has oodles of options (font, margins, columns, headers, footers, etc.) so you can make a really nice looking file.
For convenience, here's a version all on one line:
svn log -l 10 | enscript -o - | pstopdf -i -o svnlog.pdf
The -l 10 option to svn log limits the output to the 10 most recent log entries -- customize that as you wish, or customize the output with other options.
The next step would be to write a shell script or other small program that would filter the log to show just the most recent changes, generate diffs for the changed files, and wrap that all up into a PDF for you to review. As you can see from the above, the tools you'd need to do that are already there -- you just need to put them together in the right order.

Resources