Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions Documentation/SIL.BuildTasks.AWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SIL.BuildTasks.AWS package

**SIL.BuildTasks.AWS** provides an msbuild task to publish files to an Amazon S3 bucket.

Tasks in the `SIL.BuildTasks.AWS` nuget package:

## S3BuildPublisher task

Uploads files to an S3 bucket, either a list of individual files or the contents of a folder.
Credentials come from a named profile in the AWS credential profile store, not from task
properties.

Files made public are served from `https://s3.amazonaws.com/<bucket>/<folder>/<file>`.

### Properties

- `CredentialStoreProfileName`: The profile name in the AWS credential profile store (required)

- `DestinationBucket`: The S3 bucket to upload to (required)

- `SourceFiles`: The files to upload. Subfolders are not supported. Provide either this or
`SourceFolder`, not both

- `SourceFolder`: The folder whose contents to upload. Provide either this or `SourceFiles`,
not both

- `DestinationFolder`: The folder within the bucket. Must not begin with `/` or `\`, or end
with `\`. Only checked with `SourceFiles`; with `SourceFolder` a leading slash silently
becomes part of the object key

- `IsPublicRead`: Whether the uploaded files are publicly readable. Defaults to `false`

- `ContentType`: The content type to record in the S3 metadata. Only applies to `SourceFiles`

- `ContentEncoding`: The content encoding to record in the S3 metadata, e.g. `gzip`. Only
applies to `SourceFiles`

### Example

```xml
<UsingTask TaskName="S3BuildPublisher" AssemblyFile="SIL.BuildTasks.AWS.dll" />

<Target Name="Publish">
<S3BuildPublisher CredentialStoreProfileName="my-profile" DestinationBucket="my-bucket"
SourceFolder="$(RootDir)/output/release" DestinationFolder="downloads/latest"
IsPublicRead="true" />
</Target>
```

This uploads everything in `output/release` to `my-bucket/downloads/latest`, publicly readable.
22 changes: 14 additions & 8 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,25 @@ Several useful msbuild tasks.

**Task** | **Description**
------------------------------|----------------------------------------------------------------
[Archive](Documentation/SIL.BuildTasks.md#archive-task) |
[Archive](Documentation/SIL.BuildTasks.md#archive-task) | Create a tar archive from a set of files.
[CpuArchitecture](Documentation/SIL.BuildTasks.md#cpuarchitecture-task) | Return the CPU architecture of the current system.
[DownloadFile](Documentation/SIL.BuildTasks.md#downloadfile-task) | Download a file from a web address.
[FileUpdate](Documentation/SIL.BuildTasks.md#fileupdate-task) |
[MakePot](Documentation/SIL.BuildTasks.md#makepot-task) |
[MakeWixForDirTree](Documentation/SIL.BuildTasks.md#makewixfordirtree-task) |
[FileUpdate](Documentation/SIL.BuildTasks.md#fileupdate-task) | Replace text in a file by regular expression, optionally substituting the current date.
[MakePot](Documentation/SIL.BuildTasks.md#makepot-task) | Generate a gettext POT template from strings in C# and XML files.
[MakeWixForDirTree](Documentation/SIL.BuildTasks.md#makewixfordirtree-task) | Generate a WiX fragment describing the files in a directory tree.
[NormalizeLocales](Documentation/SIL.BuildTasks.md#normalizelocales-task) | Drops country code from directories and filenames to help work with Crowdin
[NUnit](Documentation/SIL.BuildTasks.md#nunit-task) | Run NUnit (v2) on a test assembly.
[NUnit3](Documentation/SIL.BuildTasks.md#nunit3-task) | Run NUnit3 on a test assembly.
[Split](Documentation/SIL.BuildTasks.md#split-task) |
[StampAssemblies](Documentation/SIL.BuildTasks.md#stampassemblies-task) |
[Split](Documentation/SIL.BuildTasks.md#split-task) | Split a string on a delimiter and return one of the parts.
[StampAssemblies](Documentation/SIL.BuildTasks.md#stampassemblies-task) | Write version numbers into AssemblyInfo source files.
[UnixName](Documentation/SIL.BuildTasks.md#unixname-task) | Determine the Unix Name of the operating system executing the build.
[UpdateBuildTypeFile](Documentation/SIL.BuildTasks.md#updatebuildtypefile-task) |
[UpdateBuildTypeFile](Documentation/SIL.BuildTasks.md#updatebuildtypefile-task) | Set the build type in a source file's version-type enum.

### [`SIL.BuildTasks.AWS` package](Documentation/SIL.BuildTasks.AWS.md)

**Task** | **Description**
------------------------------|----------------------------------------------------------------
[S3BuildPublisher](Documentation/SIL.BuildTasks.AWS.md#s3buildpublisher-task) | Publish a set of files to an S3 bucket.

## Build

Expand All @@ -51,4 +57,4 @@ dotnet test

1. Run the Pack build command from inside Visual Studio on the SIL.ReleaseTasks.Dogfood project
2. Run the Pack build command from inside Visual Studio on the SIL.BuildTasks project
3. Install the package from the output folder into your local Nuget source e.g.`nuget.exe add output/Debug/SIL.BuildTasks.2.3.5-beta.1.nupkg -Source /c/Repositories/DevelopmentPackages/`
3. Install the package from the output folder into your local Nuget source e.g.`nuget.exe add output/Debug/SIL.BuildTasks.3.3.0.nupkg -Source /c/Repositories/DevelopmentPackages/`
7 changes: 7 additions & 0 deletions SIL.BuildTasks.AWS/SIL.BuildTasks.AWS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<RootNamespace>SIL.BuildTasks.AWS</RootNamespace>
<Description>SIL.BuildTasks.AWS defines a S3BuildPublisher msbuild task to publish a set of files to a S3 bucket.</Description>
<AssemblyTitle>SIL.BuildTasks.AWS</AssemblyTitle>
<PackageReadmeFile>SIL.BuildTasks.AWS.md</PackageReadmeFile>
<IsTool>true</IsTool>
<!-- This package's only purpose is to carry its own build-time tooling under tools/;
it should never export a dependency graph to consumers. -->
Expand All @@ -21,6 +22,12 @@
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="18.9.6" />
<PackageReference Include="SIL.ReleaseTasks.Dogfood" Version="[2.3.3-*,)" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<None Include="../Documentation/SIL.BuildTasks.AWS.md" Pack="true" PackagePath="/">
<Link>SIL.BuildTasks.AWS.md</Link>
</None>
</ItemGroup>

<!-- Collect all dependencies and include them in the package itself, next to the Task assembly. -->
<Target Name="CollectRuntimeOutputs" BeforeTargets="_GetPackageFiles">
<MakeDir Directories="$(OutputPath)/lib/net472" />
Expand Down
Loading