How to Edit Excel file from Jenkins UI? - java

Consider the following scenario:
Scripts are present in Subversion repository.
Jobs are created in Jenkins for scripts.
The scripts work based on data present in an Excel sheet in the Subversion repository.
QA runs the build and it fails.
QA needs to edit the Excel document in the Subversion repository to try again with new Test Data.
In the above scenario, please let me know how can the QA be given option to edit the Excel document and upload it into the Subversion repository.

Is there a problem if QA has read-only access to your Subversion repository? I can imagine that you don't want them to edit anything in the repository besides these Excel files, but not to touch anything else. I can also understand if you don't want your developers editing this Excel spreadsheet because this is QA's file to maintain.
In this case, you can use this pre-commit hook to say who is allowed to edit what files. It uses Perl and you need version 5.8.8 or higher (the latest is 5.18). This is already probably available on your Linux or Mac, and is easily installable on Windows as a free open source program.
With this pre-commit hook, you create a control file to control access:
[file Only QA is not allowed to touch the QA Excel spreadsheets]
file = **/*.xls
access = read-only
users = #ALL
[file QA users may only edit the QA Excel spreadsheets in this repository]
file = **
access = read-only
users = #QA
[file QA users may only edit the QA Excel spreadsheets in this repository]
file = **/*.xls
access = read-write
users = #QA
Permissions go from top to bottom. So in this setup, users in the #QA group can't commit changes to anything but the Excel spreadsheets while everyone else is allowed to modify all files but those Excel spreadsheets.
Now, QA can use Subversion to modify these spreadsheet without being allowed to modify anything else in your repository, and as a bonus, no one else is allowed to touch these QA spreadsheets.
This way, the spreadsheets are in the version of the software that matches the scripts for that version. Otherwise, you will have to modify Jenkins to download these spreadsheets from another server before building, or make the downloading of the spreadsheets part of your build process. Neither is going to be very fun.

There are several options:
Get QA access to SVN. Use TortoiseSVN to have them access SVN through Windows explorer (it integrates with the context menu)
Remove the file from SVN and upload the file every time you run the Jenkins job (File Parameter).
Find a new location for the excel file. Your QA people and Jenkins both need to have access to this location.

Related

How to download application from Google Cloud Platform Java Flexible Environment

I am trying to download Application from GCP using this link: Downloading Your Application. But it looks like this works only for the Standard environment cos code executes without errors but nothing is actually downloaded after. Output is:
AM Host: appengine.google.com
AM Fetching file list...
AM Fetching files...
What will be the solution to achieve the same result in Flexible environment?
When you deploy an App Engine Flexible application, the source code is uploaded to Cloud Storage on your project in a bucket named staging..appspot.com. You can navigate in this bucket and download the source code for a specific version as a .tar file.
Alternatively, you can find the exact Cloud Storage URL for your source code by going to Dev Console > Container Registry > Build History and select the build for your version. You'll find the link to your source code under Build Information.
One thing to note however is that the staging... bucket is created by default with a Lifecycle rule that deletes files older than 15 days automatically. You can delete this rule if you want so that all versions' source code is kept indefinitely.

How to change the read/write permission of SQLite database on windows?

I created a software using NetBeans and SQLite database. When I clean and build, the executable jar file and database work fine. It can read and write data from the database.
Then I created .exe file using "install creator" and after installing the software, the same dist folder is created in Program files on my Windows PC. When I run the executable jar file from that dist folder, it can only read the database, but can't write. I get this message
java.sql.SQLException:attempt to write a readonly database
Can anyone please help me solve this problem? Thanks in advance.
check this
The problem, as it turns out, is that the PDO SQLite driver requires that if you are going to do a write operation (INSERT,UPDATE,DELETE,DROP, etc), then the folder the database resides in must have write permissions, as well as the actual database file.
I found this information in a comment at the very bottom of the PDO SQLite driver manual page.
You should write the user specific data to the Application Data folder of current user.
You can get the ROAMING directory from
String path = System.getenv("APPDATA");
Or if you want to make it platform independent you can use getProperty which will give you users home directory and then you can write to specific directory:
String path = System.getProperty("user.home");
You can form the sqlite on path like
String sqliteUrl = "jdbc:sqlite:"+path+"sample.db";
Use this code line:
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\databasefile.db"
I can say this is the proper way of creating DB in application folder on to the drive like C:\ without permission
Use this code line:
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Yourfile.db"
I can say this is the proper way of crating DB without permission on to the drive like C:\

Deploy a customed Alfresco

I've customed my alfresco (classification plan, metadata, ...) and I wanted to know how to deploy this existing alfresco into a new one existing on other computer.
I think that I have to deploy my alfresco.war on the other computer in place on the existing alfresco.war and it's all ?
Thanks if you can help me !
Edit : I've tried to remplace the alfresco.war and share.war but it doesn't work.
If I produce a database dump that I restore on the new alfresco and I remplace the alf_data, do you think It can work ?
Yep, you've just about got it already. You need to:
Stop your tomcat instance.
Go to the tomcat/webapps directory in the Alfresco installation.
Delete the alfresco.war file. (taking a backup is always recommended)
Delete the alfresco directory.
Depending on the changes made delete the contents of the tomcat/temp and tomcat/work directories.
Start your tomcat instance.
Good practice is to package up your changes in to an amp and to deploy it using the Alfresco Module Management Tool so you may want to look at doing that in future.

cvs update - cannot open temp file for writing no such file or directory

Disclaimer: This isn't my repo, I'm trying to help a developer access theirs.
When checking out code (windows server 2003, tortoiseCVS 1.12.5), CVS displays many errors:
cvs udpate: cannot open temp file _new_r_cl_elementBeanInternalHome_12345b.class for writing
Eventually failing and aborting on the error:
cvs [update aborted]: cannot make directory path/path/path/PATH/Path/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/FOO/com/ams/BAR/entityBean/websphere_deploy/DB2UDBOS123_V0_1 no such file or directory.
There's nothing handy on Google about this or on stack overflow so far.
We do have a web browser on the cvs server and I can see the paths match and there are files there.
Anyone have any ideas?
In my case I wasn't able to check out to drive D: in windows but was able to checkout to drive c:
I believe that the problem is with the disk drive or filesystem.
Standard Windows API has 260-character limit for paths to any files. If the whole path to the file exceeds that limit you won't be able to save that file to in system.
Try to checkout repository as close the root of the disk as possible. If the file paths in you repo exceeds the limit, then try to checkout only fragment of the tree of your repository.
If you use the NTFS file system and the win32 API you can have as long as 32k characters path length. You may change your CVS client to other implementation, for example the Netbeans plugin for CVS is able to handle long paths, but probably you won't be able to work with it anyway.

Storing configuration file of an application in OS independent path

I am writing an application (basically eclipse plugin), so there are few combo-box, drop-downs etc, which I am getting values for them dynamically via XML file. My doubt is which is the best way to store these files in a particular directory so that it can be read in both Windows as well as Linux.
Initially I tried to create a config path under {eclipse.home.location} like:
String finalPath = System.getProperty("eclipse.home.location") +"/myAppConfig";
and store all of my plugin's configuration there (not only configuration but few helper jars which I programatically read in my plugin). But there is a probabilty that Eclipse installation maybe in shared location and user may not have write access to it.
I also tried to store it in a program files directory using:
System.getenv("ProgramFiles");
But this fails under non-windows environments. So my question is can anyone shed a light on this so that I can store in some common directory where it is valid for both windows and linux?
Kindly let me know if my wordings are confusing. Or is it possible to store my config files under plugins directory and get the path like this /plugins/myConfigDir ?
Try using the getStateLocation() method in Plugin.
That will give you an IPath that points to a user specific workspace location.

Categories