I have an AWS S3 website, my yaml builds my site to a dist folder.
What I expect is for my website structure to look like this:
-root
index.html
etc...
Everything works fine, except my website structure ends up looking like this:
-root
-dist
index.html
etc...
This is what my artifacts section of my yaml looks like:
artifacts:
files:
- 'dist/**/*'
It seems, essentially, I do not want the dist folder to be my artifacts, I want the CONTENTS of the dist folder to be the artifacts.
It also seems that the flag to ignore paths flattens the entire system, which I do NOT want. I just want to ignore that one folder dist, and get its contents, including subfolders, etc.
Seems you need the 'base-directory' mapping:
Try this:
artifacts:
base-directory: dist
files:
- '**/*'
Related
I'm using struct from subpackage and it works. But on find usage of this structure IDEA doesn't see usages. The same situation on rename for the structure - IDEA renames the original structure and doesn't rename it in all places of usage.
How can I fix it, because I don't want to put all go files only in one package.
go project directory like this.
projectname:
bin/
src/
structs/
custom_types.go
main.go
pkg/
Use go build command will auto create bin/pkg directory.
src directory contains all go source files.
I have a Xamarin.Forms GetFiles.IOS project that has a "Resources" directory that's part of the project. I have placed 25 files into the Resources Directory. I now want to be able to go to the resource directory and get all the file names. I created some code to read the files in the directory but I'm getting a DirectoryNotFoundException. Here's the code I'm using.
String dir = Directory.GetCurrentDirectory();
var filePath = Path.Combine(dir,"Resources");
String[] files = Directory.GetFiles(filePath);
I just can't seem to get the path correct!
Thank you for helping me.
There are two things necessary to have the files be copied into the app folder:
They need to be set with Build Action Content with Copy to Output Directory Copy Always in the Properties window.
They must be in a different custom folder than Resources.
Number 2. is because Resources is a special reserved directory name and even if you put some content files in it, it is never copied in the app bundle's folder. You can check for yourself, if you put the files in a folder Test, your code will work as intended.
I have a TeamCity (9.0.2) build configuration which contains the following artefact path pattern:
App\Agent\**\bin\%env.Configuration%\** => Deployment\AgentBuildPackage.%env.ApplicationVersion.EMX%.%system.build.number%.zip
which will create a file named something like AgentBuildPackage.4.5.0.185.zip in an artefact folder named Deployment
The current structure is like this:
Deployment/
AgentBuildPackage.4.5.0.185.zip/
MyFirstServiceFolder/
bin/
Debug|Release/
All the Files
The artefact archive contains all the folders it finds under App\Agent which is great. What I can't figure out is how to flatten those individual folders so they no longer contain the /bin/Release sub-folders.
What I want is
Deployment/
AgentBuildPackage.4.5.0.185.zip/
MyFirstServiceFolder/
All the Files
Can anyone tell me how please?
You can specify target folders within your target archive by using the ! character after the name of the .zip file. Like this:
folderA\** => output.zip!/afolder/
Depending on how many service folders you have, this could be quite verbose, as you'll need to do it for each one, but it should do what you've described:
App\Agent\MyFirstServiceFolder\bin\%env.Configuration%\** => Deployment\AgentBuildPackage.%env.ApplicationVersion.EMX%.%system.build.number%.zip!/MyFirstServiceFolder/
Here's the documentation page on specifying artifact paths if you haven't seen it yet: https://confluence.jetbrains.com/display/TCD9/Configuring+General+Settings#ConfiguringGeneralSettings-PathsPatterns
I'm working on a gradle multi project (java), where some of the sub-projects are applications (have a main class, and are executable) and some others are libraries (e.g, ends up being packaged as a jar, which some other sub-projects define a dependency on). It's working fine.
I'd like to be able to package (tar) the entire project for production, according to some structure that will make it easy for my users to deploy and use later on.
Currently, the distTar task creates a build/distribution/project-name.tar for each application project, and a build/libs/project-name.jar for each non application project, under each project build directory. That's a step in the right direction, but I'd like to consolidate the contents into one thing I can distribute.
As an example, right now after running distTar:
myapp/
README
docs/
services/
service1/
build/
libs/service1.jar
<other build dirs I don't want to distribute>
service2/
build/
distributions/service2.tar
<other build dirs I don't want to distribute>
service3/
build/
distributions/service3.tar
<other build dirs I don't want to distribute>
and the contents of service2.tar are:
service2/lib/service2.jar
service2/lib/some-service2-dependency.jar
service2/bin/service2 (start script)
service2/config.yml
(and similarly for service3.tar).
I'd like my final result to be a single myapp.tar(.gz) that includes a similar directory structure, but only with the production files:
README
docs/
services/
service1/
lib/service1.jar
service2/
lib/service2.jar
lib/some-service-dependency.jar
bin/service2 (start script)
config.yml
service3/
lib/service3.jar
lib/some-service-dependency.jar
bin/service3 (start script)
config.yml
Not sure what is the best way to achieve such a task. Do I create a parent level task that depends on distTar and copies files around, untar'ing stuff, etc? (tried that unsuccessfully).
Many thanks!
UPDATE:
I started doing something along these lines:
distributions {
main {
contents {
into('scripts') {
from {'scripts/sbin'}
}
into('service1') {
from {tarTree(tarFileForProject("service1"))}
}
into('service2') {
from {tarTree(tarFileForProject("service2"))}
}
into ...
}
}
}
distTar.dependsOn([subprojects.clean, subprojects.distTar])
(where tarFileForProject is a simple function that returns the path to the build/distributions/*.tar file of the given subproject name).
It seems to work, but also seems ugly. I wonder if there's a cleaner way to do this.
Can anyone give me an example of what the Artifact paths setting defined for a build configuration could look like if I want to create two artifacts dist and source where I am using the sln 2008 build runner and building my projects using the default bin/Release?
**/Source/Code/MyProject/bin/Release/*.* => dist
**/*.* => source
I get two artifact roots dist and source but under dist I get the whole directory structure (Source/Code/MyProject/bin/Release) which I don't want and under source I get the whole thing along with obj and bin/Release which I do not want.
Can you give some advice on how to do this correctly?
Do I need to change the target location for all the projects I am building to be able to get this thing to work?
So you'll just need:
Source\Code\MyProject\bin\Release\* => dist
Source\**\* => source
This will put all the files in release into a artifact folder called dist and everything in Source into a artifact folder called source.
If you have subfolders in Release try:
Source\Code\MyProject\bin\Release\**\* => dist
According to TeamCity documentation; it should be like this:
file_name|directory_name|Ant-like wildcard [ => target_directory ]
So..
Source\Code\MyProject\bin\Release|**\* => dist (| not \)