Can I run git-p4 commands via JGit? - jgit

I'm developing a Java application using JGit and need to sync a p4 repository with a git repository.
I don't like idea of using Runtime.getRuntime().exec("git p4 sync");.
Can I use JGit to do the job? Or any other Java library?

I am afraid you need to resort to executing C Git or find some other means.
There is no support in JGit for syncing with p4 repositories.

Related

Is it possible to synch from our own Artifactory repo to Maven Central?

For some time, we have published all our artifacts to our own repository, which we host ourselves, using JFrog Artifactory.
We have some open source libraries we want to publish to Maven Central, and have come to the point where can publish every new version to Maven Central as a manual step. Now, we want to automate this, and the two options seems to be to either integrate it into our CI workflow or to sync it from our repository. Synching is the easier solution if we can make it work. Sonatype provide some straight forward instructions for doing so with the Nexus Repository Manager here: https://central.sonatype.org/publish/large-orgs/sync/
However, Nexus does not run on Artifactory, so the question is: How do we sync from Artifactory to Maven Central? (Or is it even possible? A confirmation that this is not possible would also be very valuable.)
The use case is to sync the artifacts in Artifactory to the Maven central and it is not possible from the Artifactory side.

Do Git operations on web server or on local filesystem?

I'm new to web development. I have a repo at GitHub where I manage my own theme for wordpress. What is the best way for handling this theme? Is it okay when I do the Git operations (clone, pull, push) directly on the webserver or should I sync the theme folder with a local repository and do all the Git operations on my local file system?
It's up to you. There is no a better way. Depends of what are you more confortable using. Doing the Git operations in the webserver, it will execute the same commands that you would run in your local folder. Another option for you, it can be to install a client for Git, like TortoiseGit, that is easy to use.

How to add veracode scanning to JFrog artifactory

Hi I am trying to find a simple solution to run a static security scan on binaries stored in JFrog Artifactory. It looks like the veracode integration supports Artifactory 6.7.8 https://community.veracode.com/s/article/Support-Matrix. Has anyone used this plugin with newer versions of Artifactory? If so how did you add the plugin to Artifactory? I'm trying to find a simple way to add the integration.
I was able to do this by using rtUpload and rtDownload jenkins plugins. https://www.jfrog.com/confluence/display/JFROG/Declarative+Pipeline+Syntax.
Make a repo for the binaries
Write a function for uploading the binaries to artifactory
Write a function for downloading the binaries from artifactroy

How to show history with remote git repository only in JGit

I only want to run the git log command to get some commit info, and don't want to do it after cloning a remote reprository to local. Wonder if there is quick way for JGit here?
All operations on a Git repository are local. In order to access the history of a repository, you must clone it first.
If you are only interested in the current state you may do a shallow clone to save some bandwidth.

How can I push a repository to my computer and my online server?

I have figured out how to create a repository on github. Now I am trying to push the repository to both my macbook pro and my server, which is hosted through http://namecheap.com, and be able to understand how to keep things simple. I am using wordpress on my server and I have a template theme. I want to edit my files on my mac and then push them to the website, keeping everything easy.
There is plenty of information out there on how to get started with github, so I will just focus on clearing up a misconception:
Now I am trying to push the repository to both my macbook pro and my server
You do not push from github to a server. You need to clone your github repo to your development (macbook) and production (server) environments.
git clone https://github.com/USERNAME/REPOSITORY.git
https://help.github.com/articles/fetching-a-remote/
Alternatively, you can push existing code to an empty repository by initializing locally, setting your remote and then pushing
git init
git add -A
git commit -m "Initial commit"
git remote add origin https://github.com/USERNAME/REPOSITORY.git
git push origin master
Once you have your repo setup, your typical workflow will look something like this:
Make changes in your development environment (macbook).
push those changes to github.
pull those changes from github in your production or staging environment (server).
One of the main things you need to use git this way is access to a terminal on the hosting serve, to push your files directly through git that should be installed as well.
Alternatively you can upload file using any available protocol such as (s)FTP or SSH direct to your server. In this case you'll be using git to version and manager your templates but not to upload or release them.
I've seen that cheapnames.com provides Softaculous as a mechanism to manage their servers. This software also provides synch and install scripts.

Resources