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

docker compose linux issue fixed and default values changed #4246

Merged
merged 2 commits into from
May 5, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"loc.friendlyName": "Docker",
"loc.helpMarkDown": "[More Information](http://aka.ms/dockertoolsforvsts)",
"loc.description": "Build, push or run Docker images, or run a Docker command",
"loc.helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
"loc.description": "Build, push or run Docker images, or run a Docker command. Task can be used with Docker or Azure Container registry.",
"loc.instanceNameFormat": "$(action)",
"loc.group.displayName.advanced": "Advanced Options",
"loc.input.label.containerregistrytype": "Container Registry Type",
Expand All @@ -23,7 +23,7 @@
"loc.input.label.context": "Build Context",
"loc.input.help.context": "Path to the build context.",
"loc.input.label.imageName": "Image Name",
"loc.input.help.imageName": "Name of the Docker image to build, push or run.",
"loc.input.help.imageName": "Name of the Docker image to build, push or run. The name will be converted to lowercase as Docker supports only lowercase for image names.",
"loc.input.label.qualifyImageName": "Qualify Image Name",
"loc.input.help.qualifyImageName": "Qualify the image name with the Docker registry connection's hostname if not otherwise specified.",
"loc.input.label.additionalImageTags": "Additional Image Tags",
Expand Down
12 changes: 12 additions & 0 deletions Tasks/Docker/containerbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ function findDockerFile(dockerfilepath : string) : string {
}
}

function changeImageNameToLowerCase(imageName: string): string {
var imageNameArray = imageName.split(":");

if(imageNameArray.length > 0)
{
imageName = imageNameArray[0].toLowerCase() + ":" + imageNameArray.slice(1).join(":");
}

return imageName;
}

export function run(connection: ContainerConnection): any {
var command = connection.createCommand();
command.arg("build");
Expand All @@ -45,6 +56,7 @@ export function run(connection: ContainerConnection): any {
});

var imageName = tl.getInput("imageName", true);
imageName = changeImageNameToLowerCase(imageName);
var qualifyImageName = tl.getBoolInput("qualifyImageName");
if (qualifyImageName) {
imageName = connection.qualifyImageName(imageName);
Expand Down
10 changes: 5 additions & 5 deletions Tasks/Docker/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "E28912F1-0114-4464-802A-A3A35437FD16",
"name": "Docker",
"friendlyName": "Docker",
"description": "Build, push or run Docker images, or run a Docker command",
"description": "Build, push or run Docker images, or run a Docker command. Task can be used with Docker or Azure Container registry.",
"helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
"category": "Build",
"visibility": [
Expand All @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 3
"Patch": 4
},
"demands": [],
"preview": "true",
Expand Down Expand Up @@ -97,7 +97,7 @@
"name": "defaultContext",
"type": "boolean",
"label": "Use Default Build Context",
"defaultValue": "false",
"defaultValue": "true",
"visibleRule": "action = Build an image",
"helpMarkDown": "Set the build context to the directory that contains the Docker file."
},
Expand All @@ -115,13 +115,13 @@
"defaultValue": "$(Build.Repository.Name):$(Build.BuildId)",
"required": true,
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
"helpMarkDown": "Name of the Docker image to build, push or run."
"helpMarkDown": "Name of the Docker image to build, push or run. The name will be converted to lowercase as Docker supports only lowercase for image names."
},
{
"name": "qualifyImageName",
"type": "boolean",
"label": "Qualify Image Name",
"defaultValue": "false",
"defaultValue": "true",
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
"helpMarkDown": "Qualify the image name with the Docker registry connection's hostname if not otherwise specified."
},
Expand Down
6 changes: 3 additions & 3 deletions Tasks/Docker/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 3
"Patch": 4
},
"demands": [],
"preview": "true",
Expand Down Expand Up @@ -97,7 +97,7 @@
"name": "defaultContext",
"type": "boolean",
"label": "ms-resource:loc.input.label.defaultContext",
"defaultValue": "false",
"defaultValue": "true",
"visibleRule": "action = Build an image",
"helpMarkDown": "ms-resource:loc.input.help.defaultContext"
},
Expand All @@ -121,7 +121,7 @@
"name": "qualifyImageName",
"type": "boolean",
"label": "ms-resource:loc.input.label.qualifyImageName",
"defaultValue": "false",
"defaultValue": "true",
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
"helpMarkDown": "ms-resource:loc.input.help.qualifyImageName"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"loc.friendlyName": "Docker Compose",
"loc.helpMarkDown": "[More Information](http://aka.ms/dockertoolsforvsts)",
"loc.description": "Build, push or run multi-container Docker applications",
"loc.helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
"loc.description": "Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.",
"loc.instanceNameFormat": "$(action)",
"loc.group.displayName.advanced": "Advanced Options",
"loc.input.label.containerregistrytype": "Container Registry Type",
Expand Down
16 changes: 8 additions & 8 deletions Tasks/DockerCompose/dockercompose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ if (nopIfNoDockerComposeFile && !tl.exist(dockerFile)) {
var action = tl.getInput("action", true);
/* tslint:disable:no-var-requires */
return require({
"Build services": "./dockerComposeBuild",
"Push services": "./dockerComposePush",
"Run services": "./dockerComposeUp",
"Run a specific service": "./dockerComposeRun",
"Lock services": "./dockerComposeLock",
"Write service image digests": "./dockerComposeDigests",
"Combine configuration": "./dockerComposeConfig",
"Run a Docker Compose command": "./dockerComposeCommand"
"Build services": "./dockercomposebuild",
"Push services": "./dockercomposepush",
"Run services": "./dockercomposeup",
"Run a specific service": "./dockercomposerun",
"Lock services": "./dockercomposelock",
"Write service image digests": "./dockercomposedigests",
"Combine configuration": "./dockercomposeconfig",
"Run a Docker Compose command": "./dockercomposecommand"
}[action]).run(connection);
/* tslint:enable:no-var-requires */
})
Expand Down
8 changes: 4 additions & 4 deletions Tasks/DockerCompose/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "6975E2D1-96D3-4AFC-8A41-498B5D34EA19",
"name": "DockerCompose",
"friendlyName": "Docker Compose",
"description": "Build, push or run multi-container Docker applications",
"description": "Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.",
"helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
"category": "Build",
"visibility": [
Expand All @@ -12,8 +12,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 3,
"Patch": 7
"Minor": 4,
"Patch": 0
},
"demands": [],
"preview": "true",
Expand Down Expand Up @@ -98,7 +98,7 @@
"name": "qualifyImageNames",
"type": "boolean",
"label": "Qualify Image Names",
"defaultValue": "false",
"defaultValue": "true",
"helpMarkDown": "Qualify image names for built services with the Docker registry connection's hostname if not otherwise specified."
},
{
Expand Down
6 changes: 3 additions & 3 deletions Tasks/DockerCompose/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 3,
"Patch": 7
"Minor": 4,
"Patch": 0
},
"demands": [],
"preview": "true",
Expand Down Expand Up @@ -98,7 +98,7 @@
"name": "qualifyImageNames",
"type": "boolean",
"label": "ms-resource:loc.input.label.qualifyImageNames",
"defaultValue": "false",
"defaultValue": "true",
"helpMarkDown": "ms-resource:loc.input.help.qualifyImageNames"
},
{
Expand Down