Skip to content

Commit

Permalink
DockerV2: Updating from docker-common to docker-common-v2
Browse files Browse the repository at this point in the history
- Also moved from utility-common to utility-common-v2
- Bumped up patch version
  • Loading branch information
savenkat committed Jun 20, 2019
1 parent 5e929f9 commit dd35c4b
Show file tree
Hide file tree
Showing 15 changed files with 85 additions and 99 deletions.
6 changes: 3 additions & 3 deletions Tasks/DockerV2/Tests/L0.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as path from "path";
import * as assert from "assert";
import * as ttm from "vsts-task-lib/mock-test";
import * as tl from "vsts-task-lib/task";
import * as dockerCommandUtils from "docker-common/dockercommandutils";
import * as ttm from "azure-pipelines-task-lib/mock-test";
import * as tl from "azure-pipelines-task-lib/task";
import * as dockerCommandUtils from "docker-common-v2/dockercommandutils";
import * as shared from "./TestShared";

describe("DockerV2 Suite", function () {
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV2/Tests/TestSetup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ma = require('vsts-task-lib/mock-answer');
import tmrm = require('vsts-task-lib/mock-run');
import ma = require('azure-pipelines-task-lib/mock-answer');
import tmrm = require('azure-pipelines-task-lib/mock-run');
import path = require('path');
import * as shared from './TestShared';

Expand Down
8 changes: 4 additions & 4 deletions Tasks/DockerV2/docker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";

import path = require('path');
import * as tl from "vsts-task-lib/task";
import RegistryAuthenticationToken from "docker-common/registryauthenticationprovider/registryauthenticationtoken";
import ContainerConnection from 'docker-common/containerconnection';
import { getDockerRegistryEndpointAuthenticationToken } from "docker-common/registryauthenticationprovider/registryauthenticationtoken";
import * as tl from "azure-pipelines-task-lib/task";
import RegistryAuthenticationToken from "docker-common-v2/registryauthenticationprovider/registryauthenticationtoken";
import ContainerConnection from "docker-common-v2/containerconnection";
import { getDockerRegistryEndpointAuthenticationToken } from "docker-common-v2/registryauthenticationprovider/registryauthenticationtoken";

tl.setResourcePath(path.join(__dirname, 'task.json'));

Expand Down
10 changes: 5 additions & 5 deletions Tasks/DockerV2/dockerbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import * as fs from "fs";
import * as path from "path";
import * as tl from "vsts-task-lib/task";
import ContainerConnection from "docker-common/containerconnection";
import * as dockerCommandUtils from "docker-common/dockercommandutils";
import * as fileUtils from "docker-common/fileutils";
import * as pipelineUtils from "docker-common/pipelineutils";
import * as tl from "azure-pipelines-task-lib/task";
import ContainerConnection from "docker-common-v2/containerconnection";
import * as dockerCommandUtils from "docker-common-v2/dockercommandutils";
import * as fileUtils from "docker-common-v2/fileutils";
import * as pipelineUtils from "docker-common-v2/pipelineutils";
import * as utils from "./utils";

function useDefaultBuildContext(buildContext: string): boolean {
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV2/dockerbuildandpush.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

import * as tl from "vsts-task-lib/task";
import ContainerConnection from "docker-common/containerconnection";
import * as tl from "azure-pipelines-task-lib/task";
import ContainerConnection from "docker-common-v2/containerconnection";

export function run(connection: ContainerConnection, outputUpdate: (data: string) => any): any {
let args = tl.getInput("arguments");
Expand Down
6 changes: 3 additions & 3 deletions Tasks/DockerV2/dockercommand.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use strict";

import * as tl from "vsts-task-lib/task";
import ContainerConnection from "docker-common/containerconnection";
import * as dockerCommandUtils from "docker-common/dockercommandutils";
import * as tl from "azure-pipelines-task-lib/task";
import ContainerConnection from "docker-common-v2/containerconnection";
import * as dockerCommandUtils from "docker-common-v2/dockercommandutils";
import * as utils from "./utils";

export function run(connection: ContainerConnection, outputUpdate: (data: string) => any): any {
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV2/dockerlogin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use strict";

import Q = require('q');
import * as tl from "vsts-task-lib/task";
import ContainerConnection from "docker-common/containerconnection";
import * as tl from "azure-pipelines-task-lib/task";
import ContainerConnection from "docker-common-v2/containerconnection";

export function run(connection: ContainerConnection): any {
var defer = Q.defer<any>();
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV2/dockerlogout.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use strict";

import Q = require('q');
import * as tl from "vsts-task-lib/task";
import ContainerConnection from "docker-common/containerconnection";
import * as tl from "azure-pipelines-task-lib/task";
import ContainerConnection from "docker-common-v2/containerconnection";

export function run(connection: ContainerConnection): any {
// logging out is being handled in connection.close() method, called after the command execution.
Expand Down
12 changes: 6 additions & 6 deletions Tasks/DockerV2/dockerpush.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use strict";

import * as tl from "vsts-task-lib/task";
import * as tl from "azure-pipelines-task-lib/task";
import * as fs from 'fs';
import ContainerConnection from "docker-common/containerconnection";
import * as dockerCommandUtils from "docker-common/dockercommandutils";
import ContainerConnection from "docker-common-v2/containerconnection";
import * as dockerCommandUtils from "docker-common-v2/dockercommandutils";
import * as utils from "./utils";
import { findDockerFile } from "docker-common/fileutils";
import { WebRequest, WebResponse, sendRequest } from 'utility-common/restutilities';
import { getBaseImageName, getResourceName, getBaseImageNameFromDockerFile } from "docker-common/containerimageutils";
import { findDockerFile } from "docker-common-v2/fileutils";
import { WebRequest, WebResponse, sendRequest } from 'utility-common-v2/restutilities';
import { getBaseImageName, getResourceName, getBaseImageNameFromDockerFile } from "docker-common-v2/containerimageutils";

import Q = require('q');

Expand Down
15 changes: 12 additions & 3 deletions Tasks/DockerV2/make.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"common": [{
"module": "../Common/docker-common",
"module": "../Common/docker-common-v2",
"type": "node",
"dest" : "./",
"compile" : true
},
{
"module": "../Common/utility-common",
"module": "../Common/utility-common-v2",
"type": "node",
"dest" : "./",
"compile" : true
}]
}],
"rm": [
{
"items": [
"node_modules/utility-common-v2/node_modules/azure-pipelines-task-lib",
"node_modules/docker-common-v2/node_modules/azure-pipelines-task-lib"
],
"options": "-Rf"
}
]
}
99 changes: 38 additions & 61 deletions Tasks/DockerV2/package-lock.json

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

4 changes: 2 additions & 2 deletions Tasks/DockerV2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"@types/node": "^6.0.101",
"@types/q": "^1.5.0",
"del": "2.2.0",
"docker-common": "file:../../_build/Tasks/Common/docker-common-1.0.0.tgz",
"docker-common-v2": "file:../../_build/Tasks/Common/docker-common-v2-1.0.0.tgz",
"esprima": "2.7.1",
"js-yaml": "3.6.1",
"utility-common": "file:../../_build/Tasks/Common/utility-common-1.0.2.tgz"
"utility-common-v2": "file:../../_build/Tasks/Common/utility-common-v2-2.0.0.tgz"
}
}
2 changes: 1 addition & 1 deletion Tasks/DockerV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 154,
"Patch": 1
"Patch": 2
},
"demands": [],
"releaseNotes": "Simplified the task YAML by:<br/>&nbsp;- Removing the Container registry type input<br/>&nbsp;- Removing complex inputs as they can be passed as arguments to the command.",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DockerV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 154,
"Patch": 1
"Patch": 2
},
"demands": [],
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV2/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";
import * as tl from "vsts-task-lib/task";
import * as tl from "azure-pipelines-task-lib/task";
import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import * as fileutils from "docker-common/fileutils";
import * as fileutils from "docker-common-v2/fileutils";

function getTaskOutputDir(command: string): string {
let tempDirectory = tl.getVariable('agent.tempDirectory') || os.tmpdir();
Expand Down

0 comments on commit dd35c4b

Please sign in to comment.