copy sub directories as well using Jenkins S3 plugin - amazon-web-services

I am using s3 plugin in Jenkins to copy my project from GIT to S3.
Its working fine; except that it copies only the top level files. It doesn't copy the subdirectories or the files with in the sub directory.
How can I achieve a full copy?

It depends on your OS where the Jenkins job is executed: JENKINS issue 27576 seems to indicate it was an issue, but PR 55 also shows the right syntax to use for a recursive upload:
We had the S3 plugin configured with the source parameter as trunk/build/resources/**/* on Windows builders.
So in your case, make sure your path to upload finishes with /**/* in order to consider all files.

Ant -- copying files and subdirectories from only one subdirectory on a tree
This helped me a lot
if you only what to upload to s3 the whole folder use: foldername/**/
i used this to host a nuxt project in s3 with the dist generated folder.

Related

CodeBuild get Artifact Folder Path

I am running a build through a Codebuildpipeine. I am uploading artifacts based on each stage as documented which is working fine. As you know each time a build is run the artifact folder creates a new folder for the new set of artifacts (all in S3) to be uploaded. What I want to do is retrieve the new folder name that is created in the Artifact folder into my buildspec so I can use it as a variable. Does anyone have a link or a way I can reference this? I would be willing to settle if I can get the entire URL where I can parse it?

How do I view the contents of my build artifact folder in Azure Dev Ops?

I am trying to modify my configuration file, dataSettings.json, located somewhere inside the build artifacts folder. Figuring out the correct access path to it is like working in the dark. Using "**/dataSettings.json" as a path doesn't work in my task since I don't know the artifact's folder structure, nor wether dataSettings.json even exists.
Is there a way to quickly view the contents of a build artifacts folder within DevOps?
Add a script step in your shell scripting language of choice (bash, PowerShell, Windows command prompt, etc) that recursively outputs the directory structure. Specific commands are easy to Google. i.e. PowerShell would be gci -rec. DOS would be dir /s. Bash would be ls -R.
You can quickly view the contents of the artifacts in many of the tasks in your release pipeline.
For example, If you are using File transform task or Azure App Service deploy task. You can click the 3dots at the right end of the Package or folder field to view the contents and folder structure of the artifacts.
The Source Folder field of Copy files tasks for example:
If the artifacts is a zip file. You can navigate to its correponding build pipeline runs and download the artifacts locally to check its contents. You can download the build artifacts at the Build summary page.

CodePipeline not saving all files in source artifacts

I've set up a new pipeline in AWS CodePipeline, and connected it to my GitHub account. I'm getting build errors in CodeBuild because a folder that is in my GitHub repository, static/css/, is missing (I'm using CodeBuild to do a gatsby build).
This is not a folder generated in the build process - this folder and its files exist in a clean repo. I've also checked that the branch is correct (master).
When I inspect the zip file in the SourceArtifacts folder in my S3 bucket, this folder is not there.
Any ideas why CodePipeline is not retrieving, or at least keeping, this subfolder and its contents?
Go to your Github repo and select the Green button "Clone or Download", then download the zip file. This is essentially what CodePipeline is doing to get your Github source. Now inspect the files in the zip file and confirm if 'static' directory is there. If it is not there you need to fix that and get the files into github.
It turned out that the missing folder was listed with an export-ignore attribute in the .gitattributes folder. The static/css folder got zipped up with everything else after removing this attribute.

Can I use COPY to add in files when building images on Bluemix?

I'd like to build my images on Bluemix and not locally.
Can I use COPY to include my own files into the image ?
If so where can I store the files ?
Or maybe if I had the files on github I could pull them from github ?
Yes, you can!
When you run cf ic build or docker build, the contents of your current directory (your "build context") are sent along with the build request. You can use the COPY or ADD instructions to add any file or folder within the build context into your container image, just as you can locally.
If you want to use an online source such as Github anyway, you can ADD the file from a URL. For more information, see the Dockerfile reference.
Bonus, you can now use cf ic cp to copy files to and from your containers once they are up and running.

jenkins ci : how to select the artifacts to be archived

I'm using Jenkins to build a maven 2 project. As part of the build a couple of jar files get generated in the target directory. I would like Jenkins to archive/copy a specific jar from the target location to a custom folder.
How can I achieve this ? I've tried using the 'Archive the artifacts' post build option but it does not allow me to select the file under target. I get a error message saying such a location does not exist.
I'm new to Jenkins so any help is appreciated.
Thanks.
Sirius
You may have your file specification or the base directory for the artifacts wrong. From the help text:
Can use wildcards like 'module/dist/*/.zip'. See the #includes of Ant fileset for the exact format. The base directory is the workspace.
So you'll need to figure out where your target directory is relative to the workspace directory.
The archive feature copies/saves your build artifacts out of the workspace into the build's individual directory. You cannot specify where it puts them. That said, I would probably leave archiving turned on if you'll ever need to refer back to a previous version.
You can use a script build step to create the dir if it does not exist and perform the copy.
But you have not said why you want to move the artifacts around. If it is to make them available to other projects, you should look instead at the Copy Artifact build step.