-
Notifications
You must be signed in to change notification settings - Fork 0
/
Publish.proj
51 lines (40 loc) · 2.16 KB
/
Publish.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<Project DefaultTargets="Publish" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- Using this MSBuild project to publish the build output of the project:
1) Build the release build of the S3 Build Publisher before calling this project
2) On first run the StoreKeys task should be called manually.
2.1) enter the appropriate Aws Access Key and Secret key
2.2) Run MSBuild Publish.proj /t:StoreKeys
2.3) Remove keys to prevent accidental checkin
Once run the release output files will be published to S3 and will be publically accessible through the bucket name -->
<UsingTask TaskName="S3BuildPublisher" AssemblyFile=".\Snowcode.S3BuildPublisher\bin\Release\Snowcode.S3BuildPublisher.dll"/>
<UsingTask TaskName="StoreClientDetailsTask" AssemblyFile=".\Snowcode.S3BuildPublisher\bin\Release\Snowcode.S3BuildPublisher.dll"/>
<Import Project="..\..\3rdparty\msbuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<PropertyGroup>
<Bucket>MSBuild-S3-Publisher</Bucket>
<Container>MySecretContainer</Container>
<ReleasesFolder>.\Build\Releases\</ReleasesFolder>
<ZipFileName>$(ReleasesFolder)MSBuild.AWS.Tasks.Release.zip</ZipFileName>
</PropertyGroup>
<!-- Include all the output release files -->
<ItemGroup>
<SourceFiles Include=".\Snowcode.S3BuildPublisher\bin\Release\*.*" />
</ItemGroup>
<!-- Publish the files generated from the build to S3 -->
<Target Name="Publish">
<RemoveDir Directories="$(ReleasesFolder)" />
<MakeDir Directories="$(ReleasesFolder)" />
<Zip Files="@(SourceFiles)" ZipFileName="$(ZipFileName)" WorkingDirectory=".\Snowcode.S3BuildPublisher\bin\Release\"/>
<S3BuildPublisher
EncryptionContainerName ="$(Container)"
SourceFiles="$(ZipFileName)"
DestinationBucket="$(Bucket)"
PublicRead="true" />
</Target>
<!-- Sample target to store AWS credentials -->
<Target Name="StoreKeys">
<StoreClientDetailsTask
EncryptionContainerName ="$(Container)"
AwsAccessKeyId="##YOUR-AMAZON-ID-HERE##"
AwsSecretAccesskey="##YOUR-SECRET-ACCESS-KEY-HERE##" />
</Target>
</Project>