Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significant refactoring of scaffolding #2267

Merged
merged 63 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
e671179
Create wizard parts
bwateratmsft Jul 20, 2020
5ef1772
Move resources
bwateratmsft Jul 20, 2020
b419a39
Major refactoring and implementing
bwateratmsft Jul 20, 2020
ab32f7f
Some more refactoring
bwateratmsft Jul 20, 2020
9623af7
Implementing debug scaffolding
bwateratmsft Jul 21, 2020
8e072c0
Continued implementation
bwateratmsft Jul 21, 2020
7883f74
Merge branch 'master' into bmw/scaffolding
bwateratmsft Jul 23, 2020
a0225ee
Additional Python implementation
bwateratmsft Jul 23, 2020
1af3a02
Merge branch 'master' into bmw/scaffolding
bwateratmsft Jul 23, 2020
243c4d8
Major refactoring to use subwizards
bwateratmsft Jul 24, 2020
d3e12cb
More refactoring
bwateratmsft Jul 24, 2020
92f555c
Add some templates
bwateratmsft Jul 24, 2020
83bbaba
Templating stuff
bwateratmsft Jul 24, 2020
68e24c9
Magically scan upward for templates
bwateratmsft Jul 24, 2020
48dd928
Fill out the Dockerfile templates
bwateratmsft Jul 24, 2020
bcd38f4
More refactoring
bwateratmsft Jul 24, 2020
d82ce8e
Continued refactoring
bwateratmsft Jul 24, 2020
1d9a619
Fixes
bwateratmsft Jul 24, 2020
38ba372
Implement so much more stuff
bwateratmsft Jul 24, 2020
54e0ae4
Bugfix
bwateratmsft Jul 24, 2020
5c65483
Renaming some properties
bwateratmsft Jul 24, 2020
549c377
Bugfixes
bwateratmsft Jul 24, 2020
c89bf97
I don't even feel like a commit message anymore
bwateratmsft Jul 24, 2020
578a078
Merge branch 'master' into bmw/scaffolding
bwateratmsft Jul 24, 2020
d76ea59
Treat compose as separate command
bwateratmsft Jul 24, 2020
d0c7bdb
Fix template
bwateratmsft Jul 24, 2020
a706e35
Start actually removing old
bwateratmsft Jul 24, 2020
dc7edae
Remove some things that are no longer used
bwateratmsft Jul 24, 2020
ded43ee
Removing more
bwateratmsft Jul 24, 2020
b73a700
Dead code cleanup
bwateratmsft Jul 24, 2020
71ce0ac
Remove unneeded config provider
bwateratmsft Jul 24, 2020
cf7d51c
Remove files with no further business logic
bwateratmsft Jul 24, 2020
f7fdec6
More files without business logic
bwateratmsft Jul 24, 2020
ad4767b
Implementing Node and Python info gathering
bwateratmsft Jul 24, 2020
7e47b55
Finish python maybe
bwateratmsft Jul 24, 2020
5b9bea0
Implement netcore scaffolding info
bwateratmsft Jul 28, 2020
baac3d9
Implement java info gathering phase
bwateratmsft Jul 28, 2020
2199501
Remove unnecessary code for windows versions
bwateratmsft Jul 28, 2020
6870f8e
Build task validation for .NET
bwateratmsft Jul 28, 2020
89059be
Merge branch 'master' into bmw/scaffolding
bwateratmsft Aug 25, 2020
5f335e8
Merge branch 'master' into bmw/scaffolding
bwateratmsft Aug 27, 2020
5d9fc20
Merge branch 'master' into bmw/scaffolding
bwateratmsft Aug 31, 2020
a62a43d
Fix bad merge
bwateratmsft Aug 31, 2020
233a516
Update gitattributes for new file location
bwateratmsft Aug 31, 2020
d184299
Rename folder
bwateratmsft Aug 31, 2020
f5c442e
Remove redundant templates
bwateratmsft Sep 1, 2020
9b53750
Minor changes
bwateratmsft Sep 1, 2020
3591ac5
Remove dead resource file
bwateratmsft Sep 1, 2020
b5c0403
Minor logic changes
bwateratmsft Sep 1, 2020
6b106f8
Fix several bugs
bwateratmsft Sep 1, 2020
8b73141
Copy the wizard context so that telemetry works
bwateratmsft Sep 1, 2020
67eb8cc
Todo's
bwateratmsft Sep 1, 2020
9bccc05
Various bug / inconsistency fixes
bwateratmsft Sep 2, 2020
1486041
Fix WSGI comment
bwateratmsft Sep 2, 2020
539c825
Minor changes
bwateratmsft Sep 2, 2020
9ae0634
Telemetry
bwateratmsft Sep 2, 2020
29a3428
Misc fixes for .NET Core
bwateratmsft Sep 2, 2020
30903c2
Node fix
bwateratmsft Sep 2, 2020
db2a307
Whitespace prettiness in Python template
bwateratmsft Sep 2, 2020
330df1e
Minor fix for python
bwateratmsft Sep 2, 2020
f8c5074
Move python requirements to template
bwateratmsft Sep 3, 2020
85b7e23
Merge branch 'master' into bmw/scaffolding
bwateratmsft Sep 8, 2020
17d2d3c
Items from self-review
bwateratmsft Sep 9, 2020
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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Stop git from breaking this script by putting CRLF in place of LF
resources/vsdbg text eol=lf
resources/netCore/vsdbg text eol=lf
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"typescript"
],
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "relative"
"typescript.preferences.importModuleSpecifier": "relative",
"files.associations": {
"*.template": "plaintext"
}
}
5 changes: 1 addition & 4 deletions extension.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export { deactivateInternal } from './src/extension';
//
// The tests should import '../extension.bundle.ts'. At design-time they live in tests/ and so will pick up this file (extension.bundle.ts).
// At runtime the tests live in dist/tests and will therefore pick up the main webpack bundle at dist/extension.bundle.js.
export { configure, ConfigureApiOptions } from './src/configureWorkspace/configure';
export { splitPorts } from './src/configureWorkspace/configUtils';
export { configPrefix } from './src/constants';
export { ProcessProvider } from './src/debugging/coreclr/ChildProcessProvider';
export { DockerBuildImageOptions, DockerClient } from './src/debugging/coreclr/CliDockerClient';
Expand All @@ -34,12 +32,11 @@ export { OSProvider } from './src/utils/LocalOSProvider';
export { bufferToString } from './src/utils/spawnAsync';
export { DockerDaemonIsLinuxPrerequisite, DockerfileExistsPrerequisite, DotNetSdkInstalledPrerequisite, LinuxUserInDockerGroupPrerequisite, MacNuGetFallbackFolderSharedPrerequisite } from './src/debugging/coreclr/prereqManager';
export { ext } from './src/extensionVariables';
export { globAsync } from './src/utils/globAsync';
export { httpsRequestBinary } from './src/utils/httpRequest';
export { IKeytar } from './src/utils/keytar';
export { inferCommand, inferPackageName, InspectMode, NodePackage } from './src/utils/nodeUtils';
export { nonNullProp } from './src/utils/nonNull';
export { getDockerOSType, isWindows10RS3OrNewer, isWindows10RS4OrNewer, isWindows10RS5OrNewer, isWindows1019H1OrNewer } from "./src/utils/osUtils";
export { getDockerOSType } from "./src/utils/osUtils";
export { Platform, PlatformOS } from './src/utils/platform';
export { trimWithElipsis } from './src/utils/trimWithElipsis';
export { recursiveFindTaskByType } from './src/tasks/TaskHelper';
Expand Down
37 changes: 25 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
},
"homepage": "https://github.com/Microsoft/vscode-docker/blob/master/README.md",
"activationEvents": [
"onCommand:vscode-docker.api.configure",
"onCommand:vscode-docker.compose.down",
"onCommand:vscode-docker.compose.restart",
"onCommand:vscode-docker.compose.up",
Expand Down Expand Up @@ -127,10 +126,6 @@
"contributes": {
"menus": {
"commandPalette": [
{
"command": "vscode-docker.api.configure",
"when": "never"
},
{
"command": "vscode-docker.containers.select",
"when": "never"
Expand Down Expand Up @@ -2164,6 +2159,10 @@
"type": "boolean",
"default": true,
"description": "%vscode-docker.config.docker.showRemoteWorkspaceWarning%"
},
"docker.scaffolding.templatePath": {
"type": "string",
"description": "%vscode-docker.config.docker.scaffolding.templatePath%"
}
}
},
Expand All @@ -2177,11 +2176,6 @@
}
},
"commands": [
{
"command": "vscode-docker.api.configure",
"title": "%vscode-docker.commands.api.configure%",
"category": "%vscode-docker.commands.category.docker%"
},
{
"command": "vscode-docker.compose.down",
"title": "%vscode-docker.commands.compose.down%",
Expand Down Expand Up @@ -2766,12 +2760,12 @@
"@azure/arm-containerregistry": "^8.0.0",
"@azure/storage-blob": "^12.1.2",
"@docker/sdk": "^0.1.13",
"dockerfile-ast": "^0.0.30",
"dockerfile-language-server-nodejs": "^0.1.1",
"dockerode": "^3.2.1",
"fs-extra": "^9.0.1",
"glob": "^7.1.6",
"gradle-to-js": "^2.0.0",
"handlebars": "^4.7.6",
"moment": "^2.27.0",
"request": "^2.88.2",
"request-promise-native": "^1.0.9",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@
"vscode-docker.config.docker.dockerComposeBuild": "Set to true to include --build option when docker-compose command is invoked",
"vscode-docker.config.docker.dockerComposeDetached": "Set to true to include --d (detached) option when docker-compose command is invoked",
"vscode-docker.config.docker.showRemoteWorkspaceWarning": "Set to true to prompt to switch from \"UI\" extension mode to \"Workspace\" extension mode if an operation is not supported in UI mode.",
"vscode-docker.config.docker.scaffolding.templatePath": "The path to use for scaffolding templates.",
"vscode-docker.config.deprecated": "This setting has been deprecated and will be removed in a future release.",
"vscode-docker.commands.api.configure": "Add Docker Files to Workspace (API)...",
"vscode-docker.commands.compose.down": "Compose Down",
"vscode-docker.commands.compose.restart": "Compose Restart",
"vscode-docker.commands.compose.up": "Compose Up",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<WriteLinesToFile
File="$(BlazorManifestLocationsOutput)"
File="$(InfoOutputPath)"
Lines="$(BlazorManifestInputLocation)
$(BlazorManifestOutputLocation)"
Overwrite="True" />
Expand Down
10 changes: 10 additions & 0 deletions resources/netCore/GetProjectProperties.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<!-- All the relevant info is in root-level PropertyGroups, so there are no dependent targets to make this work -->
<Target Name="GetProjectProperties">
<WriteLinesToFile
File="$(InfoOutputPath)"
Lines="$(AssemblyName).dll
$(TargetFramework)$(TargetFrameworks.Split(';')[0])"
Overwrite="True" />
</Target>
</Project>
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions resources/template.docker-compose.yml

This file was deleted.

29 changes: 29 additions & 0 deletions resources/templates/.dockerignore.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{#if pythonProjectType}}
**/__pycache__
{{/if}}
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
{{#unless (eq platform 'Node.js')}}
**/bin
{{/unless}}
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
README.md
19 changes: 19 additions & 0 deletions resources/templates/cpp/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# GCC support can be specified at major, minor, or micro version
# (e.g. 8, 8.2 or 8.2.0).
# See https://hub.docker.com/r/library/gcc/ for all supported GCC
# tags from Docker Hub.
# See https://docs.docker.com/samples/library/gcc/ for more on how to use this image
FROM gcc:latest

# These commands copy your files into the specified directory in the image
# and set that as the working location
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp

# This command compiles your app using GCC, adjust for your source code
RUN g++ -o myapp main.cpp

# This command runs your application, comment out this line to compile only
CMD ["./myapp"]

LABEL Name={{ serviceName }} Version={{ version }}
14 changes: 14 additions & 0 deletions resources/templates/docker-compose.debug.yml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.4'

services:
{{ serviceName }}:
image: {{ serviceName }}
build:
context: .
dockerfile: Dockerfile
{{#if ports}}
ports:
{{#each ports}}
- {{ . }}:{{ . }}
{{/each}}
{{/if}}
12 changes: 12 additions & 0 deletions resources/templates/docker-compose.yml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.4'

services:
{{ serviceName }}:
image: {{ serviceName }}
build: .
{{#if ports}}
ports:
{{#each ports}}
- {{ . }}:{{ . }}
{{/each}}
{{/if}}
17 changes: 17 additions & 0 deletions resources/templates/go/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#build stage
FROM golang:alpine AS builder
WORKDIR /go/src/app
COPY . .
RUN apk add --no-cache git
RUN go get -d -v ./...
RUN go install -v ./...

#final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=builder /go/bin/app /app
ENTRYPOINT ./app
LABEL Name={{ serviceName }} Version={{ version }}
{{#each ports}}
EXPOSE {{ . }}
{{/each}}
11 changes: 11 additions & 0 deletions resources/templates/java/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAVA_OPTS
ENV JAVA_OPTS=$JAVA_OPTS
ADD {{ relativeJavaOutputPath }} {{ serviceName }}.jar
{{#each ports}}
EXPOSE {{ . }}
{{/each}}
ENTRYPOINT exec java $JAVA_OPTS -jar {{ serviceName }}.jar
# For Spring-Boot project, use the entrypoint below to reduce Tomcat startup time.
#ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar {{ serviceName }}.jar
16 changes: 16 additions & 0 deletions resources/templates/java/docker-compose.debug.yml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.4'

services:
{{ serviceName }}:
image: {{ serviceName }}
build:
context: .
dockerfile: Dockerfile
environment:
JAVA_OPTS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y
{{#if (join ports debugPorts)}}
ports:
{{#each (join ports debugPorts)}}
- {{ . }}:{{ . }}
{{/each}}
{{/if}}
21 changes: 21 additions & 0 deletions resources/templates/netCore/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM {{ netCoreRuntimeBaseImage }} AS base
WORKDIR /app
{{#each ports}}
EXPOSE {{ . }}
{{/each}}

FROM {{ netCoreSdkBaseImage }} AS build
WORKDIR /src
COPY ["{{ workspaceRelative . artifact }}", "{{ dirname (workspaceRelative . artifact) }}/"]
RUN dotnet restore "{{ workspaceRelative . artifact netCorePlatformOS }}"
COPY . .
WORKDIR "/src/{{ dirname (workspaceRelative . artifact 'Linux') 'Linux' }}"
RUN dotnet build "{{ basename artifact }}" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "{{ basename artifact }}" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "{{ netCoreAssemblyName }}"]
Loading