How to pass getCredentials argument into the auto-generated deployment file [proj].Deploy.cmd (generated by VS2010 SP1)?
Related
I was to set the baseURL of my cypress tests to be read from .env file.
I can't set it directly in the cypress.json file.
And when I try to use cy.visit(process.env.MYAPPURL), I get an this error
cy.visit() must be called with a url or an options object containing a
url as its 1st argument
you can leave cy.visit() empty but you just need to set this env CYPRESS_BASE_URL with the base url instead like this for example:
CYPRESS_BASE_URL=$VUE_APP_BASE_URL
check this for explanation https://docs.cypress.io/guides/guides/environment-variables
I want to read command line arguments in settings.gradle so that i can add only those submodules in include what i am passing command line.
Can we read command line arguments in settings.gradle?
You can't read whole command line arguments in settings gradle file, though what you can do is to read project properties in settings file and those can be passed with the command line arguments.
For example if you want to specify to include sub-project-1 in your Gradle build you would have to provide this value in a project property like following:
gradlew build -Pincluded.projects=sub-project-1
Note CLI command with option -P defines project property. It has to have specified key and value. In this case key is included.projects and value is sub-project-1.
In settings file you can read it with following getProperties() method on Project object. getProperties().get(String key).
Following is the settings script if you have sub modules with names:
sub-module-1
sub-module-2
sub-module-3
It will read property that includes list of modules to include in build script. If property is empty then all modules will be included, otherwise it selects passed in sub projects names and includes only present ones. There is no validation on sub project names.
// Define all the sub projects
def subprojects = ['sub-project-1', 'sub-project-2', 'sub-project-3'] as Set
// Read all subprojects from the project properties.
// Example of passed in project properties with Gradle CLI with the -P option
// `gradlew build -Pincluded.projects=sub-project-1,sub-project-3`
def includedProjectsKey="included.projects"
def projectsToIncludeInput = hasProperty(includedProjectsKey) ? getProperties().get(includedProjectsKey) : ""
Set<String> projectsToInclude = []
if(projectsToIncludeInput != "") {
// Include passed in sub projects from project arguments
projectsToIncludeInput.toString().split(",").each {
projectsToInclude.add(it)
}
} else {
// Include all sub projects if none is specified
projectsToInclude = subprojects
}
// Include sub projects
projectsToInclude.each {
include it
}
I could able to fetch an archived file by copy articrafts from another project.
This archived file is in JSON. I need to extract a value from this JSON file and pass this parameter to the next build. I've used python script to do that (Execute Shell), but scope of that variable is not visible outside Execute Shell. Is there any other way, how can i do that ?
One way you could pass the parameter off to the next build is by using the Jenkins API in a Groovy postbuild step.
For example, here is a quick script that will:
Read in an archived json file called "myJsonFile.json" (assuming it lies in the root of the workspace)
Kick off a job called "myDownstreamJob" passing in the value of "myJsonParameter" (found within that "myJsonFile.json" file) for the build parameter named "Param1" in the downstream job.
// Parse the json file
def json = new groovy.json.JsonSlurper().parse(new File(manager.build.artifactsDir.path + "\\myJsonFile.json"))
// Get the target json value
def myValue = json.myJsonParameter
// Kick off downstream job passing in json value as Param1
manager.hudson.getItem("myDownstreamJob").scheduleBuild(5, new hudson.model.Cause.UpstreamCause(manager.build), new hudson.model.ParametersAction([ new hudson.model.StringParameterValue( "Param1", myValue ) ]));
Whenever I use the -lpf parameter with the pmcmd command, the workflow runs perfectly fine but when I add the same path in the Parameter FileName under Workflow 'Properties' and try to execute the workflow from the Workflow Manager, I get an error saying that parameter file is not found.
Now, the path which I am giving for '-lpf' is :
/apps/config/informatica/param.txt.
I don't understand why it works when I am overriding the parameter file name, whereas it doesn't work when I add it in the workflow properties (the file is not found).
By default, is any Informatica Environment variable set which needs to be changed and what's the default path of the parameter file on server and can this be changed?
Could you provide the log file?
Assuming I did understand this:
when you run the workflow with the parameter file -lpf that has this path:
/apps/config/informatica/param.txt
it does work, instead when you run it manually does not.
it could be so simply that manually you have to put instead of the extended path the string $PMSourceFileDir\ in the Source file Directory or to put it better: Source file Directory = $PMSourceFileDir\.
That because $PMSourceFileDir refer to the Informatica server initialization, as it is a server variable.
Instead with a parameter file usually is used to override that "deafult" path.
When using FinalBuilder to package our website, I would like it to be able to set the filename when it creates the file set with a variable somewhere else. So the filename would be Website 1.4.exe
Has anyone got this working?
I'm new to FinalBuilder, so if you could give some more info it would be useful - like which action you're using to create the exe.
Have you tried using project variables? From what I've seen you can use them in most FB actions.
At worst you could use the rename file action:
create a new project variable ([Tools\Edit Variables\Add]) called Version and give it a default value
if you need to, you can add a Set Variable action to dynamically set the value of the variable
add a Rename action
set Rename File to the file you want to rename (including path) eg c:\Release.exe
set New Name to Release%Version%.exe
That if the Version project variable is set to 1.4, Release.exe will be renamed to Release1.4.exe