I am creating a batch file that create a repository and will import a folder from an existing and fixed directory into that repository.
The repository will be created in the folder in which the batch file is placed in. So for example, if a user decides to place the batch file in the directory called C:/temp and runs the batch file, the repository will be created and placed in C:/temp. If the batch file is placed in C:/foo, the repository will be created and placed in C:/foo.
To do this, the batch file has this command:
svnadmin create ./Module_QWER
In the batch file however, there is a problem when using "svn import". I tried to import a folder from a directory into the repository that was just created by doing this:
svn import "C:/temp/content to import" ./Module_QWER/Sample/Trunk
And an error occurs:
svn: E205000: Try 'svn help import' for more information
svn: E205000: Invalid URL 'Module_QWER/Sample/Trunk'
I understand that if the URL of the repository is in full the import will work, but as said before the URL of the repository will depend on where the user puts the batch file. Is there a way to import the folder into a repository no matter where the repository is placed as long as it is placed together in the same directory as the batch file?
When you use svn commands related to a specific repository, you need to have its full path and the protocol you are connecting with.
So the path to the repository should be something like:
file:///d:/full/path/to/repo
In your case it would be:
svn import "C:/temp/content to import" file:///%cd%/Module_QWER/Sample/Trunk -m "log message"
Edit: OK, I just noticed the title of the question is without using the protocol in the path.
I don't think it's possible, but full path to the repository can simply be achieved with using %~dp0% for the batch's current directory or %cd% for the current working directory.
Related
I want to delete all files in specific folder from Gitlab using a batch file.
My Git repository folder looks like:
Branch :Develop
Test_Repo\Files\MyFiles\F1,F2,F3,F4,F5.....
Before cloning, I need to delete all files from under MyFiles directory
How to handle this in a batch file, I am stuck in this part?
I am using windows, and accessing WSL through VSCode
I am currently learning airflow and ran into an issue with the command airflow db init. According to a tutorial I'm following, there should be a new directory called airflow inside the current directory, but it is not there
My current path is (sandbox) nick#GameCube:/mnt/d/CodeAndIDE/DataScience/LearnAirflow$. I am using a venv called "sandbox"
When I run airflow db init, it outputs a bunch of lines, which match the tutorial, but no folder is created after. No error output either. Why is this?
I partially figured out the solution. You have to first set the airflow home directory to the current folder, with export AIRFLOW_HOME="$(pwd)".
For some reason, this didn't create a directory for the file and just dumped them all into the main directory, so I deleted them all and did mkdir airflow, cd airflow, export AIRFLOW_HOME="$(pwd)" again.
The last problem that I'm having is that unittests.cfg is not present in the folder, when I think that it should be
I want to monitor a logfile. The directory is created everyday.
The path is as follows:
"C:\Program Files (x86)\Parallels\Plesk\PMM\logs\backup-2020-03-28-23-00-09-939\backup.log"
The problem is the timestamp in directory name.
How must the config file be defined to check this directory?
Best regards
Steve
if you only monitor that the file exists, you could try to make a plugin in bash, perl, python, etc that monitor the directory using the date as a variable name of the folder where the log file exists.
I have found myself on the command line redundantly typing the same “create a jar file from stubs” commands over and over.
How can I create a Batch script that can create a .jar file from a set of Web service stubs to save me from this redundancy?
The below steps will help anyone trying to do this if BATCH scripts are supported.
Step 1:
Open your favorite text editor.
Step 2:
Copy and paste the below into your text editor.
echo "Starting .jar file creation process"
cd C:\stubs\YourStubFileDirectory
"C:\Program Files (x86)\Java\jdk1.6.0_26\bin\jar" -cvf NameYourJar.jar C:\stubs\YourStubFileDirectory \com\yourdomain\etc\axis\packagename
echo "Jar File Created... Please exit. "
Step 3:
Change the paths to meet your paths (path to your stub file directory, your package name, etc...) and change to your version of Java.
Step 4:
Save your file. Name it what you'd like but add the .bat extension at the end to form a "BATCH" file.
e.g.(myJarCreator.bat).
Step 5:
Double click your .bat file and it will execute for you; creating the .jar you want from your stubs.
Is there a way to create folder and copy artifacts into the created folders in sonatype nexus repository, through windows command line or batch files?
I have finally got solution to my problem by curl functionality.
curl -u admin:admin123 -T C:\upload\Test.txt http://Nexus_Repo_URL/folder_to_be_created/Test.txt
"folder_to_be_created" is the folder which is created in the repository and the file, 'Test.txt', is copied to it
Just upload the artifacts to whatever path is needed using one of the methods described here:
https://support.sonatype.com/hc/en-us/articles/213465818-How-can-I-programatically-upload-an-artifact-into-Nexus-
Any folders needed will be created automatically.