init
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,7 +9,7 @@
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
nuget.exe
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
|
||||
41
Readme.md
Normal file
41
Readme.md
Normal file
@@ -0,0 +1,41 @@
|
||||
This is an example of a webforms project being compiled into a docker container. The gulp file is used for build orchestration. This is for **windows 10** or **server 2016**
|
||||
|
||||
## Gettting started
|
||||
|
||||
Install docker with [this script on windows 10](https://gist.github.com/TerribleDev/dd424d3d090bcf5634dcf8417411a081), or setup docker on [server 2016](https://gist.github.com/TerribleDev/106197d88d1535dd0546165f5a7eb6a8)
|
||||
|
||||
Install nodejs
|
||||
|
||||
run:
|
||||
```
|
||||
npm install -g gulp
|
||||
npm install
|
||||
```
|
||||
|
||||
## tasks
|
||||
|
||||
|
||||
|
||||
`clean:` clean up artifacts
|
||||
|
||||
`retrieve:` alias for retrieve docker image and nuget
|
||||
|
||||
`build:` build everything
|
||||
|
||||
`restore:nuget` restores nugets
|
||||
|
||||
`build:patchAssemblyInfo` patch assemblyinfo cs files
|
||||
|
||||
`build:csharp` compile csharp
|
||||
|
||||
`build:dockerImage` build the docker image
|
||||
|
||||
|
||||
arguments:
|
||||
`--version` version to set for assemblyinfo docker image
|
||||
|
||||
usage:
|
||||
|
||||
`gulp build --version 1.0.1`
|
||||
|
||||
|
||||
1
WebForms1/.gitignore
vendored
Normal file
1
WebForms1/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
output
|
||||
3
WebForms1/Dockerfile
Normal file
3
WebForms1/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM microsoft/aspnet
|
||||
ARG site_root=.
|
||||
ADD ${site_root} /inetpub/wwwroot
|
||||
@@ -116,6 +116,7 @@
|
||||
<Content Include="fonts\glyphicons-halflings-regular.woff" />
|
||||
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
|
||||
<Content Include="fonts\glyphicons-halflings-regular.eot" />
|
||||
<Content Include="Dockerfile" />
|
||||
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
|
||||
<Content Include="Scripts\bootstrap.js" />
|
||||
<Content Include="Scripts\bootstrap.min.js" />
|
||||
@@ -224,7 +225,7 @@
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>53523</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
|
||||
11
WebForms1/p.pubxml
Normal file
11
WebForms1/p.pubxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project ToolsVersion="$(VisualStudioVersion)" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<publishUrl>.\output</publishUrl>
|
||||
<DeleteExistingFiles>True</DeleteExistingFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
66
gulpfile.js
Normal file
66
gulpfile.js
Normal file
@@ -0,0 +1,66 @@
|
||||
var gulp = require('gulp');
|
||||
var request = require('request');
|
||||
var fs = require('fs');
|
||||
var nuget = require('gulp-nuget');
|
||||
var request = require('request');
|
||||
var child_process = require('child_process');
|
||||
var msbuild = require('gulp-msbuild');
|
||||
var assemblyInfo = require('gulp-dotnet-assembly-info');
|
||||
var argv = require('yargs')
|
||||
.default('version', '1.0.0').argv;
|
||||
var del = require('del');
|
||||
|
||||
gulp.task('retrieve', ['restore:nuget', 'restore:dockerImage']);
|
||||
gulp.task('build', ['build:csharp', 'build:dockerImage'])
|
||||
|
||||
gulp.task('clean', ()=>{
|
||||
return del(['nuget.exe', 'packages', 'WebForms1/output'])
|
||||
});
|
||||
|
||||
gulp.task('download:nuget', ['clean'] ,(cb)=>{
|
||||
return request('http://nuget.org/nuget.exe')
|
||||
.pipe(fs.createWriteStream('nuget.exe'));
|
||||
});
|
||||
|
||||
gulp.task('restore:nuget', ['clean','download:nuget'], ()=>{
|
||||
return gulp.src('WebForms1.sln')
|
||||
.pipe(nuget.restore({ nuget: "./nuget.exe" }));
|
||||
});
|
||||
|
||||
gulp.task('restore:dockerImage', ()=>{
|
||||
//so help my soul for making this sync
|
||||
child_process.execSync('docker pull microsoft/aspnet', {stdio: 'inherit'})
|
||||
});
|
||||
|
||||
gulp.task('build:patchAssemblyInfo', function() {
|
||||
gulp.src(['**/AssemblyInfo.cs', '!packages/**'])
|
||||
.pipe(assemblyInfo({
|
||||
title: 'Planet Express Website',
|
||||
description: 'Shipping and tracking website.',
|
||||
configuration: 'Release',
|
||||
company: 'Planet Express',
|
||||
product: 'Planet Express Website',
|
||||
copyright: 'Copyright 3002 © Planet Express',
|
||||
trademark: 'Planet Express',
|
||||
culture: 'en-us',
|
||||
version: function(value) { return argv.version },
|
||||
fileVersion: function(value) { return argv.version; },
|
||||
}))
|
||||
.pipe(gulp.dest('.'));
|
||||
});
|
||||
|
||||
|
||||
gulp.task('build:csharp', ['retrieve', 'build:patchAssemblyInfo'], ()=>{
|
||||
return gulp.src("./WebForms1/WebForms1.csproj")
|
||||
.pipe(msbuild({
|
||||
targets: ['Clean', 'Build'],
|
||||
properties: { Configuration: 'Release', DeployOnBuild: 'true', PublishProfile: '.\\p.pubxml' },
|
||||
toolsVersion: 14
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('build:dockerImage', ['build:csharp', 'restore:dockerImage'], ()=>{
|
||||
//so help my soul for making this sync
|
||||
child_process.execSync(`docker build -t tparnell/mywebforms:${argv.version} .`, {stdio: 'inherit', cwd: "./WebForms1/output"})
|
||||
});
|
||||
20
package.json
Normal file
20
package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "webforms1",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"del": "^2.2.2",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-dotnet-assembly-info": "^0.1.12",
|
||||
"gulp-msbuild": "^0.4.1",
|
||||
"gulp-nuget": "^1.0.1",
|
||||
"request": "^2.75.0",
|
||||
"yargs": "^6.2.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user