AFAICT I can tell AppVeyor to wrap an entire folder into a zip file artifact, as in the following example:
artifacts:
- path: logs
name: test logs
type: zip
which will push all the files in the logs subfolder to the logs.zip ZIP file.
I want to give the generated ZIP file a different name. How can I do that?
Issue number 929 in the community support repository suggests that this is currently not supported declaratively. What you can do is rename the artifact in the after_build step as outlined in the issue:
after_build:
- appveyor PushArtifact local-file.zip -FileName remote-file-%appveyor_build_version%.zip
It appears that the name attribute controls the name of the ZIP file as well. So if I want the ZIP file to be named foo.zip, I can write the following in the appveyor.yml:
artifacts:
- path: logs
name: foo
type: zip
And so I've done -- see here and here.
Related
I have a Release Pipeline setup to extract my build artifact and then I use the RegEx Find & Replace task to update a few configuration files on my static website before uploading via AzureBlob File Copy task.
What I have currently works. However I have to use the full source path to the "wwwroot" folder in order to for the correct files to be uploaded.
My concern is that my builds may change the directory structure that gets dropped as a build artifact which will break my release tasks.
I've tried to use various wildcards for the source path such as:
**/wwwroot/*
*/*wwwroot/*
And many other variations to no avail.
I read in some of the docs that wildcards won't work for directory paths in this task but was hoping there was a way to work around this as I have long term concerns about the path changing over time. I looked at a few other tasks in the marketplace but nothing seems to fit the bill and I couldn't find any definitive guidance on the matter. Any suggestions?
1.You can use $(System.DefaultWorkingDirectory)/**/wwwroot/*.*(or .json,.xml...) in Source input.
(If the wwwroot folder doesn't have subfolders and all files within that folder can match format *.*)
2.Otherwise I suggest you archive the wwwroot folder first before uploading it:
Use $(System.DefaultWorkingDirectory) to get working directory and then use full path(not recommend using * here) to archive the specific wwwroot folder. Then upload the zipped folder which contains all content of your wwwroot folder.
I deploy an artifact ZIP file and want to unzip it afterwards. The pipeline looks like this:
The first step downloads the artifact to this path:
C:\azagent\A2\_work\r2\a\worker-ASP.NET Core-CI\drop\worker.zip
but the zip Task looks for the zip file in this path:
C:\azagent\A2\_work\_tasks\Unzip_31f040e5-e040-4336-878a-59a473334434\1.2.3\*.zip
I know there are some hidden variables i can use to give the correct path to the unzip task. Where can i see the variables set for my release task and which one would contain "C:\azagent\A2_work\r2\a\worker-ASP.NET Core-CI\drop\" ?
The default artifact location is stored in one of these variables:
$(System.ArtifactsDirectory)/{artifact-alias}
$(Pipeline.Workspace)/{artifact-alias}
and artifacts are placed in a subdirectory with the artifact alias (the name you gave the alias).
See also:
https://learn.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops&tabs=batch#default-variables---general-artifact
I am trying to specify a mount point in a kubernetes deployment descriptor and for that I need there to be a directory
volumeMounts:
- name: volume-mount
mountPath: /dev/bus/usb/003/005
to correspond to:
volumes:
- name: my-host-volume
hostPath:
path: /dev/bus/usb/003/005
How do I create this using jib?
UPDATE: newer Jib versions have the feature to allow specifying a copy destination directory when using <extraDirectories>. You no longer have to manually prepare the target directory structure beforehand.
Create an empty directory <project root>/src/main/jib/dev/bus/usb/003/005 in your source repo.
Details
Jib allows adding arbitrary extra files and directories using the <extraDirectories> (Maven / Gradle) configuration. Files and (sub-)directories under <extraDirectories> will be recursively copied into the root directory of the image. By default, <project root>/src/main/jib is one such "extra directory", so you can simply create an empty directory with the structure you like.
You can also tune the permissions of files and directories using <permissions> if you want.
I am new to Azure DevOps. I tried many ways but nothing helped. I am trying to create a pipeline which has Copy Files Task. I have folder structure like below
Bin
Common
abc.dll
Staging
Bin
Common
I want to copy abc.dll from Bin\Common to Staging\Bin\Common
In my Copy Files Task I am giving below
Source: Bin/Common
Contents: *.dll
Target Folder: Staging/Bin/Common
In Advanced:
Clean Target Folder: Check
Overwrite: Check
The Copy File Task succeeds and when I go to my Repo I donot see abc.dll in Staging\Bin\Common folder. In my Copy File Task log I see
Copying D:\a\1\s\Bin\Common\abc.dll to Staging\Bin\Common\abc.dll
I guess it must be
Copying D:\a\1\s\Bin\Common\abc.dll to D:\a\1\s\Staging\Bin\Common\abc.dll
Thanks in advance.
SOLUTION
Thanks to 4c74356b41 for pointing me in right direction. I accepted and marked as answer. As suggested, I created variable and used it like below
Variable Name: BinCommonStagingFolder
Variable Value: $(Build.Repository.LocalPath)\Staging\Bin\Common\
I used the variable in my Copy Files Task like below to copy only files which I need not all files
Source: Bin/Common
Contents:
abc.dll
abc.pdb
Target Folder: $(BinCommonStagingFolder)
In Advanced:
Clean Target Folder: Check
Overwrite: Check
i guess you should add full path, you can use build varible for that:
Target Folder: $(Build.Repository.LocalPath)\Staging\Bin\Common\
this would reference the root of the repo you checked out
For me, the issue was because I migrated from a Windows pipeline to a Linux one and path separators "\" on Windows hadn't been updated to "/" causing relative paths to be wrongly interpreted.
I have an Azure DevOps build pipeline. In that pipeline, I have the following tasks:
dotnet build
Path to project(s): ./MyConsoleApp/MyConsoleApp.csproj
Arguments: --configuration Release --output ../content
Archive Files
Root folder or file to archive: ./content
Prepend root folder name to archive paths: unchecked
Archive type: zip
Archive file to create: content.zip
Replace existing archive: checked
AzureBlob File Copy
Source: content.zip
Destination Type: Azure Blob
RM Storage Account: "<mystorageaccount>"
Container Name: "content"
Blob Prefix: MyConsoleApp/content
This build pipeline runs successfully. I can see the .zip file successfully created and in my Azure Storage account. The size looks like an appropriate size for the console app. However, I'm unable to unzip the .zip file.
When I download the .zip file from Azure Storage, I then try to "unzip" it. I do this by right-clicking on the .zip file in File Explorer nd choosing "Extract All...". I click "Extract" and I get an error that says:
The Compressed (zipped) Folder 'C:\Users\user\Downloads\content.zip' is invalid.
I don't understand this. Everything looks correct. What am I doing wrong?