Publish build artifacts step fails, when using fileshare (TFS 2015) - node.js

TFS Version: 14.102.25423.0 (Tfs2015.Update3)
In my build definition when I set the Path argument of the
Publish Build Artifacts step
with
Artifact type: File share
to
\VSALM\share
Behind the scene this build step executes a node.js script function which is called recursively, but there is a bug and the function repeats itself over and over again while trying to create the drop folder**.
The failing node.js script is
mkdir.js
and resides below the build agent folder:
agent\tasks\PublishBuildArtifacts\1.0.28\node_modules\shelljs\src\mkdir.js
Name of the failing function is:
mkdirSyncRecursive
The error msg:
016-07-23T21:22:02.3703397Z shell.js: internal error
2016-07-23T21:22:02.3703397Z RangeError: Maximum call stack size
exceeded
--> Stackoverflow
When I enter an absolut path like
c:\workspaces\share
I get this error:
2016-07-23T21:03:07.5727256Z shell.js: internal error
2016-07-23T21:03:07.5727256Z Error: EEXIST: file already exists, mkdir
'C:\workspaces\share'
Workaround
When I set the drop folder to (escaped network share path):
\\\\VSALM\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)
Then the build step succeeds but the files are not dropped under the path of the share.
They are dropped here in my case:
C:\VSALM\share\MyBuildDefinition\20160723.7\drop
I don't know why it doesn't work with my share set to:
C:\workspaces\share
but it works when I create a network share in
C:\drop\share
and set the drop folder path in my build definition to:
\\\\drop\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)
Question:
Someone knows how to fix this script?

"Publish Build Artifacts" task publishes the build output to a shared network path when you select "File Share" type. The "Maximum call stack size exceeded" error usually occurs when the shared network path cannot be found. Please check if the "Path" you entered is correct and can be accessed from the build agent. The format is usually like following:
\\hostnameoripaddress\sharedfolder
When you enter a path with "\\\\" prefix, the task will copy the output to the root of the drive where the build agent located. For example, your build agent work folder is placed in C drive, when you specify "\\\\VSALM\share" as the path, it will copy files to "C:\VSALM\Share" folder(It will create the folder if the path does not exist).

Related

AWS Elastic beanstalk - My deployed app can't seem to write pdf's into this directory i've set up in my project folder

I am currently using nodejs that is deployed in ebs on aws. I have a function that will write a pdf and then email it off but it says the file path can't be found. I've verified the project file seems to be /var/app/current/, but changing the reference of the file path doesn't seem to remove the error. Any idea how to go about fixing this?
The /var/app/current/ does not exist initially. Its only created at the very last stage of your deployment.
The deployment happens in /var/app/staging/ folder, and at the very last, once everything finishes, /var/app/staging/ is moved into /var/app/current/.
Thus, I would not recommend using absolute paths in your project or config files. Its better to use relative path or container_commands for config scripts:
The specified commands run as the root user, and are processed in alphabetical order by name. Container commands are run from the staging directory, where your source code is extracted prior to being deployed to the application server.

How to open D:\a\r1\a\ on Azure?

I'm running Cypress in one of my release stages and it gives me this output:
Finished processing: D:\a\r1\a\_ClientWeb-Build-CI\ShellArtifact\tests\integration\cypress\videos\onboarding.spec.js.mp4 (0 seconds)
I have 2 questions:
Is the path name relative to the app service? If I have a app service called randomname and run the Cypress Stage on that randomname app service should I be able to find tCypresshe output in randomname.scm.azurewebsites.net.
If I go into the scm debug console and I do cd D:\a\ I get:
cd : Cannot find path 'D:\a\' because it does not exist.
So how do I actually access my Cypress test results?
I've also tried archiving the files into a zip file:
In the output of the task step I see:
Creating archive: d:\home\testing\somefile.zip
But when I try to access the D:/home/testing folder on my appname.scm.azurewebsites.net I get:
cd : Cannot find path 'D:\home\testing' because it does not exist.
The path D:\a\r1\a is inside the hosted agent that run the release pipeline, is not in your application.
The same thing is for the zip file, when you specify d:/home/... is in the agent.
After the release is finish all the files are deleted, so you need to save the file in another place (maybe in azure?) during the pipeline, for example, with "Azure File Copy" task.

Gradle Copy Task causes file permission issue

Background
I have a JetBrains Plugin that I am developing. Recently, I moved from a Windows to a Ubuntu system. I am trying to set up everything correctly as before. Note: I am fairly new to Linux.
Issue
I am having an apparent file permission issue (as can be seen in the error section of this question) when I ran the following Gradle script. Note: Whenever I build the project, this Gradle script is automatically called. It also worked correctly on Windows.
If I comment out the copy{...} closure then everything works correctly. I just need to manually copy over the required file.
tasks.create(name: "copyJar_v${project['version']}") {
group GROUP_CHROMATERIAL
def mostCurrentJarFile = "ChroMATERIAL-${project['version']}.jar"
// comment this out and there are not errors, but I need to do this copy manually
copy {
into '/' // Copy into project's root folder
from 'build/libs', {
include mostCurrentJarFile
rename mostCurrentJarFile, 'ChroMATERIAL.jar'
}
}
}
Error
FAILURE: Build failed with an exception.
* Where:
Build file
'/home/ciscorucinski/IdeaProjects/ChroMATERIAL/ChroMATERIAL/build.gradle' line: 100
* What went wrong:
A problem occurred evaluating project ':ChroMATERIAL'.
> Could not copy file '/home/ciscorucinski/IdeaProjects/ChroMATERIAL/ChroMATERIAL/build/libs/ChroMATERIAL-2.5.1.jar' to '/ChroMATERIAL.jar'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.139 secs
/ChroMATERIAL.jar (Permission denied)
오후 12:20:39: Task execution finished 'copyJar_v2.5.1'.
What I tried
I have been using the UI to modify the file permissions of the Plugin Project Folder within IdeaProjects.
I gave everyone Create and delete files permissions and I Change Permissions for Enclosing Files...
Everyone has Read and write access to files and Create and delete files access to folders.
Clicked Change
Run the Gradle script again ... same error message
Thoughts
It appears that Linux is not letting Gradle modify these files. I can comment out the code and do everything myself, but I need to allow Gradle to have higher control. Don't know how though.
I notice that when I go back to Change Permissions for Enclosing Files... the shown permissions are not what I selected! Others has Read-only access to files and Access files access to folders. I don't know if this is common Ubuntu behavior, a bug, or something else.
It would be nice to know how to give as restrictive as possible access while fixing this.
Well, it is true -- you cannot (and should not) copy files into the Root folder in a linux box. You could if you ran the script as sudo, but that is a bad idea.
Edited
Since you want to copy to the root of the project, you can use ${projectDir} or ${rootDir}.
Also, you should be able to do this without the hassle of a closure -- and it makes your script cleaner, IMHO -- by using the built in Copy task:
task copyClientLoc(type: Copy) {
from "build/libs/"
into "${rootDir}"
include "ChroMATERIAL-${project['version']}.jar"
fileMode = 0644
}

Mount a Directory from one Server to set top box linux environment

I run my build stored in linux server path eg user/aaditya/builds/build1/bin/ i have written an api which takes linux mount path as input
for example API- takeimage,..//xyz.bmp
when i run it capture the image and stored in build1 folder but when i execute takeimage,..//..//build2/ , no image is stored in build2 folder
where path to build2 is user/aaditya/builds/build2/ how to mount user/aaditya/builds/build2/
because API uses the linux system call to write the file
In your two examples you are running your API like this:
takeimage ..//zyx.bmp
takeimage ..//..//build2/
I am guessing you run this from user/aaditya/builds/build1/bin/
In your first example you are providing your API the name of a file to save your image in. In your second example you are only providing a directory path. If the Build2 directory does not exist it could be producing an error.

Is that the 'path to war' which I am giving wrong? If yes,how do I do a rollback?

I have been trying to use the command to rollback the last process of deploying the website which was interrupted due to a network failure.
The generic command that I am using while inside the bin directory of server's SDK (On Linux) is :
./appcfg.sh rollback /path_to_the_war_directory_that_has_appengine-web.xml
Is this the way we do a rollback ? If not please tell me the method.
_(I was asked to make a directory war in the project directory and place the WEB-INF folder in that with appengine-web.xml inside it. It may be wrong)_
I am fully convinced that I am making a mistake while giving the path to my app .
Shot where my .war file is there :
Now the command that I am using is (while inside the bin directory of the server's SDK) :
./appcfg.sh rollback /home/non-admin/NetbeansProjects/'Personal Site'/web/war
The following is the representation of the path to war directory :
Where am I wrong ? How should I run this command so that I am able to deploy my project once again ?
On running the above command I get this message :
Unable to find the webapp directory /home/non-admin/NetbeansProjects/Personal Site/web/war
usage: AppCfg [options] <action> [<app-dir>] [<argument>]
NOTE : I have duplicated the folder WEB-INF. There is still a folder named WEB-INF inside the web directory that contains all other xml files.
The error tells you that the folder /home/non-admin/NetbeansProjects/Personal Site/web/war does not exist. If you look carefully the name of the folder is NetBeansProjects (the filesystem in Linux is case-sensitive).
So, you should run instead the command:
./appcfg.sh rollback /home/non-admin/NetBeansProjects/'Personal Site'/web/war
and just to make sure that the directory exists run first
ls /home/non-admin/NetBeansProjects/'Personal Site'/web/war

Resources