Using JFrog Artifactory Deployer with a shared UNC path - artifactory

We are using JFrog Artifactory with TFS 2017 and I am looking to use the JFrog Artifactory Deployer task with my build. Looking to upload artifacts from a shared UNC part. Whilst it works fine when uploading artifacts from local file system, it doesn't work with UNC path. I tried using mapped drive but that didn't work either. Does anyone know a solution for this?
Getting the following error
running 'C:\agent_work\16\a\jfrog.exe' rt upload
'\myshared\drops\BuildName\BuildVersion\**\*.zip' 'ext-repo'
--url=https://aritfactory/artifactory --user=******** --password=******** --props='build.number=2996783;build.name=ArtifactoryUpload' 2017-05-22T15:23:06.5911571Z 2017-05-22T15:23:06.5911571Z
2017-05-22T15:23:06.8240199Z Pinging Artifactory...
2017-05-22T15:23:07.0369535Z Done pinging Artifactory.
2017-05-22T15:23:07.0369535Z Path does not exist:
\myshared\drops\buildName\BuildVersion 2017-05-22T15:23:07.0838234Z
[error]Microsoft.PowerShell.Commands.WriteErrorException: Deployment to Artifactory failed 2017-05-22T15:23:07.0994475Z ##[error]PowerShell
script completed with 1 errors. 2017-05-22T15:23:07.0994475Z
[section]Finishing: JFrogArtifactoryDeployer

You can copy files to a local folder by using Copy Files or Windows Machine File Copy task, then upload artifacts.

Another workaround is that adding a powershell script task in your build definition to map the network drive and then publish to artifacts. I just did a quick test with it and it works. the powershell script I used:
New-PSDrive -Name "G" -PSProvider "FileSystem" -Root "\\UNC\Path"
cd G:\
./jfrog.exe rt upload folder\\file.txt 'example-repo-local' --url=https://xxxxx.jfrog.io/xxxx/example-repo-local/ --user='xxxxx' --password='xxxxx' --props='build.number=001;build.name=BuildName'
Remember to download the "jfrog.exe" and place it in the UNC Path.

I think the easiest solution would be to make a symbolic link of the data folder and copy the contents of the data folder into the symbolic link than restart Artifactory.

Related

Incorrect directory structure created using jfrog CLI

I am trying to download the entire folder (as it is with all files and subfolders) from an Artifactory repo to my local folder.
Note - I am using Artifactory Pro cloud version
This how my Artifactory local repo (generic) looks like -
I run the following command in jfrog CLI (used this article as refrence) -
jfrog rt download --include-dirs=true --flat=true --user=XXX --password=XXX --url=https://XXXX.jfrog.io/XXXX --recursive '/support-pack/aem-dispatcher/files/(*)' '{1}'
The files get downloaded however it results in a weird folder structure -
Below is a screenshot of the logs
Notice the additional resume folder under the resume folder. Why is this happening?
I want the exact structure under files folder in Artifactory to be replicated in my local folder.
Please help!
The answer turned out to be much simpler than expected. All I had to do was get rid of --include-dirs=true in my command.
Read this article for more info.

Issue in deployment of cord app

I checked https://docs.corda.net/deploying-a-node.html for deploying in windows server. I can see deploying nodes using NSSM Manager.
When I deploy nodes, how it will access my application which is placed as a jar under /opt/corda /CordaApp.jar
Also, When I run nssm.bat file under each nodes, my cmd is going on running with the first cmd and not stopping. Nothing proceed after that.
There is a typo in the docs. Where it says:
Create a directory called plugins in /opt/corda and save your CorDapp jar file to it. Alternatively, download one of our sample CorDapps to the plugins directory
It should read instead:
Create a directory called plugins in C:\Corda\ and save your CorDapp jar file to it. Alternatively, download one of our sample CorDapps to the plugins directory
This was fixed by the following PR: https://github.com/corda/corda/pull/2607.

Deploying binaries from Bamboo to Nexus repository

Firstly I am new to Nexus. So please bear if it is too noob a question. Let me first explain how our current build/deployment process works.
HOW WE DO IT AT PRESENT:
We have a project that is Maven based. There is a parent POM.xml and two module pom.xmls Each child module POM.xmls create a JAR file each when built. Currently I am doing the build/ deployments manually. I checkout code from SVN to my local machine. I run mvn clean install. I have created a bash script to bundle the 2 Jar files + few other resources (Present just in SVN repo and gets downloaded to local) into a tar.gzip file. Now I SCP this to the app server. Run install scripts that deploys the tar.gzip file.
HOW WE WANT TO DO IT:
We plan to automate the build in Bamboo (Which I have already done). Then the built artifact needs to be uploaded to a Nexus repository (Due to security issues, the SCP task in Bamboo does not work because of establishing SSH connectivity from Bamboo Server to App Server).
MY FIRST HURDLE:
I have created a Bash Script task in Bamboo which does the bundling ( 2 Jars from each child Module POM + resources) to a tar.gzip. This tar.gzip is prersent in a path a/b/c/d on my bamboo machine.
How do I upload this tar.gzip to Nexus Repository?
MY CONFUSION:
I have read about uploading artifacts to Nexus. But I understand it if just 1 jar/ear/war file is created from the build. But we want the bundle. So if I make changes to settings.xml & POM.xml to configure the upload to NEXUS, each JAR file will be uploaded into separate paths in Nexus. And then I have to configure separately to upload the resource files (Not part of build). Is my understanding correct? Please let me know how to proceed with this?
Thanks in advance!!!
Use the Maven Assembly Plugin to create an assembly that contains your artifacts and resources, and then your regular maven deploy will deploy it into Nexus.

How to deploy a Java project using war file on CloudControl

I have my Java project in a Hg repository. How can I use this code or convert to Git repo to be able to deploy on Cloud Control?
Is there an Option for me to use a .war file to Deploy instead of the entire file structure upload and compile? If so, would it matter if the war file was built using Tomcat server or Glass-fish server?
Your help in answering these question will be a valuable information for me. Appreciate your help in advance.
Best Regards.
If you want to keep all mercurial branches, tags and history use fast-export. Otherwise just create git repository from scratch:
git init; git add . ; git commit -am "Initial commit"
Deploying prebuilt war file is not the recommended way. You should push to the repository (via git or cctrlapp) and let cloudControl platform take care of the build process. Anyway you can still use Maven to download the war file. You can find some examples here.
Apart from this you have to provide an embedded jetty or tomcat runner and specify start command in Procfile:
Jetty:
web: java -jar target/dependency/jetty-runner.jar --port $PORT target/YOU_WAR.war
Tomcat:
web: java -jar target/dependency/webapp-runner.jar --port $PORT target/YOUR_WAR.war
Keep in mind that war file should be built independently of any application servers.

msdeploy v2 doesn't work with vs2010's packages

I had v1 of msdeploy installed and I uninstalled it to install the v2.
Now my vs2010 packages fail when I run the deploy.cmd because it can't find the registry entry - even though I've created an MSDeployPath environment variable pointing to the v2 path?
I have MSDeployPath set to "C:\Program Files\IIS\Microsoft Web Deploy V2" in the Advanced System Settings/Environment Variables under My Computer/Properties.
The error I get when I run the VS2010 deploy.cmd file is:
Files\IIS\Microsoft was unexpected at this time.
Anyone know how to fix this? The vs2010 package's deploy.cmd looks for /1 in the registry.
So how do I change this to look for /2 if the path variable doesn't work
Edit the .cmd file to look for the correct registry path. /2 instead of /1.
My understanding is that TFS 2010 sp1 fixes this.
The line from the cmd file for pre SP1 builds looks like this:
for /F "usebackq tokens=2*" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`) do (
post SP1 it looks like this
for /F "usebackq tokens=1,2,*" %%h in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy" /s ^| findstr -i "InstallPath"`) do (
I also get the same issue when I am trying to deploy the web site using bath file under the package created by MSbuild. Only difference is I am doing it remotely.that is I assign that task to my build server and once a build is successful then it execute the command
MVC-Client.deploy.cmd /y /M:es-websrv01
Although the set parameter xml is available it complains the it is unexpected.Normally it says for a remote web deployment we dont need admin privileges.(In my case build server is running with out admin privileges).Then I remotely logged to the build server machine and then using a command line try to to the deployment manually.But end up with the same issue.Then what I try was just copy the package in to a desktop and then did the remote deployment.It was successfully transferred the files into target IIS location.
Location where build server tries to to the deployment : C:\Program Files (x86)\Jenkins\jobs\Exile-LibrarySystem\workspace\Exile-LibrarySystem\Exile-LibrarySystem\obj\Staging\Package
I think since this folder has limits access it cant do the operation.Otherwise I should have end up with the same issue when I was trying to do the deployment in the desktop in build server machine. Is there any work around where I can get this deployment job done with in the build server location ?
Thanks

Resources