From the console If 1 were to update the application what 1 does is..
1. Click on deployments.
2. Selects the application name and clicks update option.
3. Here he may change:
i. Source Path
ii. Deployment Plan
Now in my application No Plan path is specified so to update the application I only change the source path. The application gets successfully updated.
I want to update the application using wlst command by giving the new source path.
Is it possible?
like
updateApplication('backoffice','path\to\the\ear\file')
In this case I believe the command you are looking for is redeploy:
progress = redeploy('myAppName', appPath='new/path/to/file')
progress.getState()
If you run into errors, you may need to put the new ear file into the original location OR execute an undeploy first, then do a normal deploy.
Reference:
http://docs.oracle.com/cd/E13222_01/wls/docs92/config_scripting/reference.html#wp1024321
Another example:
http://zachxu.blogspot.com/2010/08/how-to-use-weblogic-wlst-to-redeploy.html
Related
I have a folder in TFS which has SQL Scripts. At the moment I am manually adding a comment and updating a version number inside the comment every time i make a change and check it back it. This works however was hoping there might be a better way. Is there a way to automate this in TFS?
I have read the following article
Version control project files
do i have to go through such a process for simple .sql files? Are there any other simple ways.
There are a few ways you can do this:
Create an automated build in TFS and write a custom build step / PowerShell script to parse the appropriate SQL scripts, read the version, increment it, and store the new version by either checking in the updated file or a local store
Use a database project (part of SQL Server Data Tools) which will output a DACPAC. Inside the database project, you can set the version as specified here. This stores the version in the project file. If you update your TFS build number to be digits only, you can then update the project file to set that value to match the build using a custom build task. For example, if your build number was yyyy.m.d.R where R is the number of times that build was run today (TFS manages that - it's the revision variable). Or, you could set the the <DacVersion> tag to something like 2.1.0.0 and your build replaces the last digit with yyyymmddr.
I'd recommend using a database project. It's pretty easy to create a new database project off an existing database.
The first way mentioned by Jacob above can achieve that if you just want to incremental the version number of the script/folder, just create a CI build definition.
Actually you can just enable Label sources and set the Label format with predefined environment variables such as $(build.buildNumber), and set without publish any artifacts during build process.
Thus, it will automatically trigger the CI build when you check in files, and the source (SQL Script /folder) will be labeled with the incremental number.
Then you can find the specific versions with the label.
I want to use a property ('currentId') which has a certain start value. For each test case the value should be increased by 1. I can do that by adding an extra test step in each test case which increases the value but that would be much copy paste. The code for that would be (see reference):
def uniqueUserPortion = testRunner.testCase.testSuite.project.getPropertyValue("currentId")
// convert it to an Integer, and increment
def uniqueUserPortionInc = uniqueUserPortion.toInteger() + 1
// set the property back as string
testRunner.testCase.testSuite.project.setPropertyValue("currentId", uniqueUserPortionInc.toString())
To avoid that copy&paste I've added the code above to the Load Script of the project but it doesn't work:
testSuite.testCases.each {
*code above*
}
What can I do to use the code in one script/call for all test cases?
I could define the property as the start value plus the test case ID but that would be a definition in each test case again since I can not reference the #TestCase#ID in project level/property.
Issue with what your are trying
Load Script of the project is executed once when you import the project into soapui workspace. So, this approach does not work.
As you rightly mentioned, either you need to have it in a separate step of the each test case or you can add the same code as setup script. Yes, it is copy paste only
It is possible to achieve easily using SoapUI NG which pro edition using Event feature.
Then your next question may be : how to do it in Open Source edition of SoapUI.
Here is an soapuiExtensions which I did sometime ago which allows you do the same without having to copy paste for each test case in open source edition.
All you need do is have your groovy script into a specific file called 'TestCaseBeforeRun.groovy'. That means, the script is executed before running each test case.
For more details refer README
This soapuiExtensions library allows users to have some additional functionality in soapUI(free edition) tool, like soapui pro allows to do something before, after doing something.
For eg: User may want to do something before running a test case or after running a test case etc by implementing appropriate groovy script as required. Allow me to add an example here. Usually user may want to add credentials for the request step automatically, see the script samples/scripts/TestSuiteTestStepAdded.groovy
How to use this library:
set SOAPUI_HOME environment variable.
copy lib/SoapUIExtListeners.jar file under $SOAPUI_HOME/bin/ext directory
copy samples/listeners/custom-listeners.xml file under $SOAPUI_HOME/bin/listeners directory
copy samples/scripts directory under $SOAPUI_HOME
And implement appropriate groovy script available under $SOAPUI_HOME/scripts. Refer Mappings file in order to implement respective groovy script.
Note: for windows users, you may need to check %SOAPUI_HOME%\bin\soapui.bat which actually overwrites SOAPUI_HOME, need to fix soapui.bat script if requires.
Uses jdk 7, soapUI 4.5.1, and groovy 1.8.9
Dependency
log4j
UPDATE: this is realted to the note in the above.
As it was mentioned in the note, soapui.bat overrides SOAPUI_HOME environment variable on windows, needs to be tweaked a bit. May be you want to copy that groovy file under %SOAPUI_HOME%\bin\scripts (this is without tweaking soapui.bat)and retry. If your machine is linux then it should work if you copy the groovy file under $SOAPUI_HOME/scripts directory
I have some SSIS packages that connect to an Oracle database. The connection parameters are stored in a SQL database and retrieved by using the Package Configuration tool.
My problem is that the variable that gets populated automatically by SSIS with the configuration string does not get emptied after the package is run. As a result, the value of the variable get saved in the source code when the package is saved. I DO NOT want to have this variable value saved in my source files.
Any idea on how to prevent this from happening?
Thanks!
You can try setting the variable in a package configuration. The way you do this is simple.
First go to the top most layer of your package and right click on the empty space and select package configurations. Choose to add add. Give a location and name for the file and then click next.
Once you've done that choose the variable you want and set the value like this.
Now you're not storing the actual value in the package. Just the information for how to find it.
EDIT: I may not have been clear on this. This process will create a completely separate file that the package will look to to get that expression. This way you don't have to store the expression or the value in the package itself. It just knows at run time to go look for that config file for any additional data.
EDIT 2: The package configuration will only overwrite when you execute the package in BIDS over Visual Studio. The reason this happens is because the package evaluates and then saves prior to run time. This does not happen when you are using SQL agent to run a package and therefore will not store the value or the expression in the source code. I hope I have clarified that for you.
I have implemented continous build using TFS windows workflow.
In this I have created a custom activity that will help me creating custom template of folders.
Is there any way that I can monitor the status of the build, that is if the build fails due to some exception I want to set a flag in database table that i created to failed.
I want to handle this in C# TFS API only.
Yes, you would need to probably create a custom build activity to enter your record in the database. You would place this custom activity in the template at the very end of the Run on Agent Sequence and check the status of Microsoft.TeamFoundation.Build.Client.BuildStatus.Failed to know if the build failed or not
You can use the QueryBuilds method from the IBuildServer service API to query all builds inside TFS. You can specify the Build Status as one of the filters, plus a date range when the number of builds in the database grows too large.
I have a build definition in TFS 2012 and its currently dropping the build onto a network share which will be used as the website root folder.
The problem is it's creating a new folder based on the version number each time. I'd like to keep the version numbering but just make it clear out and deploy to the same folder over and over so I don't have to change anything in IIS. Folders are like -
Build20130123.1
Build20130123.2
each containing a complete deployment. I just need one folder that gets everything dumped in it for every build.
What you are trying to do is counterintuitive to the build system, because not only does it drop the artifacts of the build into that folder, but when the retention policy is fulfilled it will try to delete those artifacts back out. So if you do this you will need to set your retention policy to keep always so it never tries to delete out the contents of this folder. You are better off, adding after the copy to drop step a Manual copy to this static folder that won't be subject to retention policy as it will know nothing about it. But if you wish when you open the template in the main sequence you will see a sub-sequence called Update Drop Location. In there is 3 items, the middle one is an If statement for if drop build and Build Reason is triggered, dig down into the then side and you will find a sequence which contains an activity called Set Drop Location. Right click on its properties and you will see how the path string is currently put together, adjust this string to what you wish and then this value will be propagated through out the build template
You could use the new feature in 2012 sp1 that lets you place the output within TFS source control then you would just need to run a TFS GET command manually or via an updated workflow call to update the latest files and binaries for your website location. Option number 3 in the picture below.
2012 MSDN-Select a Staging Location and Setting Up a Drop Folder