diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a02e0f3146f8..72d86e81627f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -137,6 +137,8 @@ Tasks/CondaEnvironmentV0/* @leantk Tasks/CondaEnvironmentV1/* @leantk +Tasks/ContainerBuildV0/* @vithati @prebansa + Tasks/CopyFilesV2/* @jtpetty Tasks/CopyFilesOverSSHV0/* @leantk diff --git a/Tasks/AzureFunctionOnKubernetesV0/task.json b/Tasks/AzureFunctionOnKubernetesV0/task.json index 9c4f6b057f1f..7dcc0132a8cd 100644 --- a/Tasks/AzureFunctionOnKubernetesV0/task.json +++ b/Tasks/AzureFunctionOnKubernetesV0/task.json @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 160, - "Patch": 2 + "Patch": 3 }, "demands": [], "groups": [ diff --git a/Tasks/AzureFunctionOnKubernetesV0/task.loc.json b/Tasks/AzureFunctionOnKubernetesV0/task.loc.json index 7c1b8ca5e02a..6c130a2d7bf9 100644 --- a/Tasks/AzureFunctionOnKubernetesV0/task.loc.json +++ b/Tasks/AzureFunctionOnKubernetesV0/task.loc.json @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 160, - "Patch": 2 + "Patch": 3 }, "demands": [], "groups": [ diff --git a/Tasks/Common/docker-common-v2/containerconnection.ts b/Tasks/Common/docker-common-v2/containerconnection.ts index f276c1ecfa3d..4c11f74984e2 100644 --- a/Tasks/Common/docker-common-v2/containerconnection.ts +++ b/Tasks/Common/docker-common-v2/containerconnection.ts @@ -23,7 +23,13 @@ export default class ContainerConnection { private oldDockerConfigContent: string; constructor() { - this.dockerPath = tl.which("docker", true); + if(process.env["RUNNING_ON"] == "KUBERNETES") { + this.dockerPath = tl.which("img", true); + } + else { + this.dockerPath = tl.which("docker", true); + } + } public createCommand(): tr.ToolRunner { diff --git a/Tasks/ContainerBuildV0/Strings/resources.resjson/en-US/resources.resjson b/Tasks/ContainerBuildV0/Strings/resources.resjson/en-US/resources.resjson new file mode 100644 index 000000000000..4d58b681e471 --- /dev/null +++ b/Tasks/ContainerBuildV0/Strings/resources.resjson/en-US/resources.resjson @@ -0,0 +1,26 @@ +{ + "loc.friendlyName": "Container Build", + "loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?linkid=2107300)", + "loc.description": "Container Build Task", + "loc.instanceNameFormat": "Container Build Task", + "loc.input.label.poolService": "Pool Service (applicable when running on Kubernetes)", + "loc.input.help.poolService": "Name of the service applicable when running on Kubernetes.", + "loc.input.label.dockerRegistryServiceConnection": "Docker registry service connection", + "loc.input.help.dockerRegistryServiceConnection": "Select a Docker registry service connection.", + "loc.input.label.repository": "Container repository", + "loc.input.help.repository": "Name of the repository within the container registry.", + "loc.input.label.Dockerfile": "Dockerfile", + "loc.input.help.Dockerfile": "Path to Dockerfile.", + "loc.input.label.buildContext": "Build context", + "loc.input.help.buildContext": "Path to Build context.", + "loc.input.label.tags": "Tags", + "loc.input.help.tags": "A list of tags in separate lines. Tags are used while building and pushing the image to container registry.", + "loc.messages.ContainerPatternNotFound": "No pattern found in Docker filepath parameter", + "loc.messages.CouldNotFindDockerConfig": "Could not find Docker Config. Either DOCKER_CONFIG variable is not set, or the config file is outside the temp directory, or the file does not exist. DOCKER_CONFIG: %s", + "loc.messages.BuildctlLatestNotKnown": "Cannot get the latest Buildctl info from %s. Error %s. Using default Buildctl version %s.", + "loc.messages.BuildctlDownloadFailed": "Failed to download Buildctl from location %s. Error %s", + "loc.messages.BuildctlNotFoundInFolder": "Buildctl executable not found in path %s", + "loc.messages.FileContentSynced": "Synced the file content to the disk. The content is %s.", + "loc.messages.VerifyBuildctlInstallation": "Verifying Buildctl installation...", + "loc.messages.WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s" +} \ No newline at end of file diff --git a/Tasks/ContainerBuildV0/ThirdPartyNotices.txt b/Tasks/ContainerBuildV0/ThirdPartyNotices.txt new file mode 100644 index 000000000000..c8f96b68aefe --- /dev/null +++ b/Tasks/ContainerBuildV0/ThirdPartyNotices.txt @@ -0,0 +1,1098 @@ + +THIRD PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +Buildctl tool task for Azure Pipelines or Azure DevOps Server + +This software incorporates material from third parties. Microsoft makes certain +open source code available at http://3rdpartysource.microsoft.com, or you may +send a check or money order for US $5.00, including the product name, the open +source component name, and version number, to: + +Source Code Compliance Team +Microsoft Corporation +One Microsoft Way +Redmond, WA 98052 +USA + +Notwithstanding any other terms, you may reverse engineer this software to the +extent required to debug changes to any libraries licensed under the GNU Lesser +General Public License. + + +1. @types/node (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) +2. @types/q (https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) +3. array-union (https://github.com/sindresorhus/array-union) +4. array-uniq (https://github.com/sindresorhus/array-uniq) +5. arrify (https://github.com/sindresorhus/arrify) +6. balanced-match (https://github.com/juliangruber/balanced-match) +7. brace-expansion (https://github.com/juliangruber/brace-expansion) +8. concat-map (https://github.com/substack/node-concat-map) +9. del (https://github.com/sindresorhus/del) +10. fs.realpath (https://github.com/isaacs/fs.realpath) +11. Glob (https://github.com/isaacs/node-glob) +12. globby (https://github.com/sindresorhus/globby) +13. inflight (https://github.com/npm/inflight) +14. inherits (https://github.com/isaacs/inherits) +15. is-path-cwd (https://github.com/sindresorhus/is-path-cwd) +16. is-path-in-cwd (https://github.com/sindresorhus/is-path-in-cwd) +17. is-path-inside (https://github.com/sindresorhus/is-path-inside) +18. minimatch (https://github.com/isaacs/minimatch) +19. Mockery (https://github.com/mfncooper/mockery) +20. node-uuid (https://github.com/broofa/node-uuid) +21. object-assign (https://github.com/sindresorhus/object-assign) +22. once (https://github.com/isaacs/once) +23. path-is-absolute (https://github.com/sindresorhus/path-is-absolute) +24. path-is-inside (https://github.com/domenic/path-is-inside) +25. pify (https://github.com/sindresorhus/pify) +26. pinkie (https://github.com/floatdrop/pinkie) +27. pinkie-promise (https://github.com/floatdrop/pinkie-promise) +28. q (https://github.com/kriskowal/q) +29. Rimraf (https://github.com/isaacs/rimraf) +30. semver (https://github.com/npm/node-semver/) +31. semver-compare (https://github.com/substack/semver-compare) +32. ShellJS (https://github.com/shelljs/shelljs) + Includes:wrench-js +33. tunnel (https://github.com/koichik/node-tunnel) +34. typed-rest-client (https://github.com/Microsoft/typed-rest-client) +35. underscore (https://github.com/jashkenas/underscore) +36. vso-node-api (https://github.com/Microsoft/vsts-node-api) +37. VSTS-Task-Lib (https://github.com/Microsoft/vsts-task-lib) +38. vsts-task-tool-lib (git+https://github.com/microsoft/vsts-task-installer-lib.git) +39. wrappy (https://github.com/npm/wrappy) + + +%% @types/node NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE +========================================= +END OF @types/node NOTICES, INFORMATION, AND LICENSE + +%% @types/q NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE +========================================= +END OF @types/q NOTICES, INFORMATION, AND LICENSE + +%% array-union NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF array-union NOTICES, INFORMATION, AND LICENSE + +%% array-uniq NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF array-uniq NOTICES, INFORMATION, AND LICENSE + +%% arrify NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF arrify NOTICES, INFORMATION, AND LICENSE + +%% balanced-match NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(MIT) + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +========================================= +END OF balanced-match NOTICES, INFORMATION, AND LICENSE + +%% brace-expansion NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +(MIT) + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +========================================= +END OF brace-expansion NOTICES, INFORMATION, AND LICENSE + +%% concat-map NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) James Halliday/substack + +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF concat-map NOTICES, INFORMATION, AND LICENSE + +%% del NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF del NOTICES, INFORMATION, AND LICENSE + +%% fs.realpath NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license, as follows: + + Copyright Joyent, Inc. and other Node contributors. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +========================================= +END OF fs.realpath NOTICES, INFORMATION, AND LICENSE + +%% Glob NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF Glob NOTICES, INFORMATION, AND LICENSE + +%% globby NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF globby NOTICES, INFORMATION, AND LICENSE + +%% inflight NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF inflight NOTICES, INFORMATION, AND LICENSE + +%% inherits NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF inherits NOTICES, INFORMATION, AND LICENSE + +%% is-path-cwd NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF is-path-cwd NOTICES, INFORMATION, AND LICENSE + +%% is-path-in-cwd NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF is-path-in-cwd NOTICES, INFORMATION, AND LICENSE + +%% is-path-inside NOTICES AND INFORMATION BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF is-path-inside NOTICES AND INFORMATION + +%% minimatch NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF minimatch NOTICES, INFORMATION, AND LICENSE + +%% Mockery NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyrights for code authored by Yahoo! Inc. is licensed under the following + terms: + + MIT License + + Copyright (c) 2011 Yahoo! Inc. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +========================================= +END OF Mockery NOTICES, INFORMATION, AND LICENSE + +%% node-uuid NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) 2010-2016 Robert Kieffer and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +========================================= +END OF node-uuid NOTICES, INFORMATION, AND LICENSE + +%% object-assign NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF object-assign NOTICES, INFORMATION, AND LICENSE + +%% once NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF once NOTICES, INFORMATION, AND LICENSE + +%% path-is-absolute NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +path-is-absolute + +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +node.js: + +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +Software), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF path-is-absolute NOTICES, INFORMATION, AND LICENSE + +%% path-is-inside NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2013-2014 Domenic Denicola +Licensed under the WTFPL Version 2 (http://www.wtfpl.net/about/) +========================================= +END OF path-is-inside NOTICES, INFORMATION, AND LICENSE + +%% pify NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF pify NOTICES, INFORMATION, AND LICENSE + +%% pinkie NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF pinkie NOTICES, INFORMATION, AND LICENSE + +%% pinkie-promise NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF pinkie-promise NOTICES, INFORMATION, AND LICENSE + +%% q NOTICES AND INFORMATION BEGIN HERE +========================================= +Copyright 2009–2017 Kristopher Michael Kowal. All rights reserved. +Copyright 2009–2014 Kristopher Michael Kowal. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +/*! + * + * Copyright 2009-2012 Kris Kowal under the terms of the MIT + * license found at http://github.com/kriskowal/q/raw/master/LICENSE + * + * With parts by Tyler Close + * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found + * at http://www.opensource.org/licenses/mit-license.html + * Forked at ref_send.js version: 2009-05-11 + * + * With parts by Mark Miller + * Copyright (C) 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +========================================= +END OF q NOTICES AND INFORMATION + +%% Rimraf NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF Rimraf NOTICES, INFORMATION, AND LICENSE + +%% semver NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF semver NOTICES, INFORMATION, AND LICENSE + +%% semver-compare NOTICES AND INFORMATION BEGIN HERE +========================================= +Copyright (c) 2014 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF semver-compare NOTICES AND INFORMATION + +%% ShellJS NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2012, Artur Adib +All rights reserved. + +You may use this project under the terms of the New BSD license as follows: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Artur Adib nor the + names of the contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========================================= +Includes wrench-js +The MIT License + +Copyright (c) 2010 Ryan McGrath + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF ShellJS NOTICES, INFORMATION, AND LICENSE + +%% tunnel NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) 2012 Koichi Kobayashi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF tunnel NOTICES, INFORMATION, AND LICENSE + +%% typed-rest-client NOTICES AND INFORMATION BEGIN HERE +========================================= +Typed Rest Client for Node.js + +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF typed-rest-client NOTICES AND INFORMATION + +%% underscore NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +========================================= +END OF underscore NOTICES, INFORMATION, AND LICENSE + +%% vso-node-api NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF vso-node-api NOTICES, INFORMATION, AND LICENSE + +%% VSTS-Task-Lib NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Microsoft Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +========================================= +END OF VSTS-Task-Lib NOTICES, INFORMATION, AND LICENSE + +%% vsts-task-tool-lib NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE +========================================= +END OF vsts-task-tool-lib NOTICES, INFORMATION, AND LICENSE + +%% wrappy NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +========================================= +END OF wrappy NOTICES, INFORMATION, AND LICENSE + diff --git a/Tasks/ContainerBuildV0/icon.png b/Tasks/ContainerBuildV0/icon.png new file mode 100644 index 000000000000..0de14507c37c Binary files /dev/null and b/Tasks/ContainerBuildV0/icon.png differ diff --git a/Tasks/ContainerBuildV0/icon.svg b/Tasks/ContainerBuildV0/icon.svg new file mode 100644 index 000000000000..bf193c30c7ca --- /dev/null +++ b/Tasks/ContainerBuildV0/icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Tasks/ContainerBuildV0/make.json b/Tasks/ContainerBuildV0/make.json new file mode 100644 index 000000000000..ff58e4b65b83 --- /dev/null +++ b/Tasks/ContainerBuildV0/make.json @@ -0,0 +1,26 @@ +{ + "common": [ + { + "module": "../Common/docker-common-v2", + "type": "node", + "dest" : "./", + "compile" : true + }, + { + "module": "../Common/azure-arm-rest-v2", + "type": "node", + "dest": "./", + "compile": true + } + ], + "rm": [ + { + "items": [ + "node_modules/azure-arm-rest/node_modules/vsts-task-lib", + "node_modules/buildctl-common/node_modules/azure-pipelines-task-lib", + "node_modules/docker-common-v2/node_modules/azure-pipelines-task-lib" + ], + "options": "-Rf" + } + ] +} \ No newline at end of file diff --git a/Tasks/ContainerBuildV0/package-lock.json b/Tasks/ContainerBuildV0/package-lock.json new file mode 100644 index 000000000000..a663b8b8e7f7 --- /dev/null +++ b/Tasks/ContainerBuildV0/package-lock.json @@ -0,0 +1,462 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@types/mocha": { + "version": "2.2.48", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", + "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==" + }, + "@types/node": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", + "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==" + }, + "@types/q": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.0.7.tgz", + "integrity": "sha512-0WS7XU7sXzQ7J1nbnMKKYdjrrFoO3YtZYgUzeV8JFXffPnHfvSJQleR70I8BOAsOm14i4dyaAZ3YzqIl1YhkXQ==" + }, + "@types/semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==" + }, + "@types/uuid": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.4.tgz", + "integrity": "sha512-tPIgT0GUmdJQNSHxp0X2jnpQfBSTfGxUMc/2CXBU2mnyTFVYVa2ojpoQ74w0U2yn2vw3jnC640+77lkFFpdVDw==", + "requires": { + "@types/node": "*" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "azure-arm-rest-v2": { + "version": "file:../../_build/Tasks/Common/azure-arm-rest-v2-2.0.0.tgz", + "requires": { + "@types/mocha": "2.2.48", + "@types/node": "6.0.68", + "@types/q": "1.0.7", + "azure-pipelines-task-lib": "2.8.0", + "jsonwebtoken": "7.3.0", + "q": "1.4.1", + "typed-rest-client": "0.12.0" + }, + "dependencies": { + "@types/node": { + "version": "6.0.68", + "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.68.tgz", + "integrity": "sha1-DEO2uLlEX+uGoPvTRX4/S8WR5m0=" + }, + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=" + } + } + }, + "azure-pipelines-task-lib": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-2.8.0.tgz", + "integrity": "sha512-PR8oap9z2j+o455W3PwAfB4SX1p4GdJc9OHQaQV0V+iQS1IBY6dVgcNSQMkHAXb0V1bbuLOFBLanXPe5eSgGTQ==", + "requires": { + "minimatch": "3.0.4", + "mockery": "^1.7.0", + "q": "^1.1.2", + "semver": "^5.1.0", + "shelljs": "^0.3.0", + "uuid": "^3.0.1" + } + }, + "azure-pipelines-tool-lib": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-tool-lib/-/azure-pipelines-tool-lib-0.11.0.tgz", + "integrity": "sha512-Bg3usPtOs/YvM5V9dOEwxvsructz/BTsO5mVgLQ013kJsQN9DJrTjZMAgxxdaeW1H8KPHMz/40ix1T7XZ++VCw==", + "requires": { + "@types/semver": "^5.3.0", + "@types/uuid": "^3.0.1", + "azure-pipelines-task-lib": "^2.7.1", + "semver": "^5.3.0", + "semver-compare": "^1.0.0", + "typed-rest-client": "1.0.9", + "uuid": "^3.0.1" + }, + "dependencies": { + "typed-rest-client": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.0.9.tgz", + "integrity": "sha512-iOdwgmnP/tF6Qs+oY4iEtCf/3fnCDl7Gy9LGPJ4E3M4Wj3uaSko15FVwbsaBmnBqTJORnXBWVY5306D4HH8oiA==", + "requires": { + "tunnel": "0.0.4", + "underscore": "1.8.3" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "del": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.0.tgz", + "integrity": "sha1-mlDwS/NzJeKDtPROmFM2wlJFa9U=", + "requires": { + "globby": "^4.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + } + }, + "docker-common-v2": { + "version": "file:../../_build/Tasks/Common/docker-common-v2-1.0.0.tgz", + "requires": { + "azure-pipelines-task-lib": "2.8.0", + "del": "2.2.0", + "q": "1.4.1", + "vso-node-api": "6.0.1-preview" + }, + "dependencies": { + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=" + } + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globby": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-4.1.0.tgz", + "integrity": "sha1-CA9UVJ7BuCpsYOYx/ILhIR2+lfg=", + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^6.0.1", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=" + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "isemail": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", + "integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=" + }, + "joi": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz", + "integrity": "sha1-TVDDGAeRIgAP5fFq8f+OGRe3fgY=", + "requires": { + "hoek": "2.x.x", + "isemail": "1.x.x", + "moment": "2.x.x", + "topo": "1.x.x" + } + }, + "jsonwebtoken": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.3.0.tgz", + "integrity": "sha1-hRGNanDj/M3xQ4n056HD+cip+7o=", + "requires": { + "joi": "^6.10.1", + "jws": "^3.1.4", + "lodash.once": "^4.0.0", + "ms": "^0.7.1", + "xtend": "^4.0.1" + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mockery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz", + "integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8=" + }, + "moment": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + }, + "ms": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz", + "integrity": "sha1-cIFVpeROM/X9D8U+gdDUCpG+H/8=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=" + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=" + }, + "topo": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz", + "integrity": "sha1-6ddRYV0buH3IZdsYL6HKCl71NtU=", + "requires": { + "hoek": "2.x.x" + } + }, + "tunnel": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.4.tgz", + "integrity": "sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM=" + }, + "typed-rest-client": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-0.12.0.tgz", + "integrity": "sha1-Y3b1Un9CfaEh3K/f1+QeEyHgcgw=", + "requires": { + "tunnel": "0.0.4", + "underscore": "1.8.3" + } + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "vso-node-api": { + "version": "6.0.1-preview", + "resolved": "https://registry.npmjs.org/vso-node-api/-/vso-node-api-6.0.1-preview.tgz", + "integrity": "sha1-RBprv5s8aNpiTbAeo1y6jwpMLKs=", + "requires": { + "q": "^1.0.1", + "tunnel": "0.0.4", + "underscore": "^1.8.3" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } +} \ No newline at end of file diff --git a/Tasks/ContainerBuildV0/package.json b/Tasks/ContainerBuildV0/package.json new file mode 100644 index 000000000000..b6946437fba4 --- /dev/null +++ b/Tasks/ContainerBuildV0/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "azure-arm-rest-v2": "file:../../_build/Tasks/Common/azure-arm-rest-v2-2.0.0.tgz", + "azure-pipelines-task-lib": "2.8.0", + "azure-pipelines-tool-lib": "0.11.0", + "docker-common-v2": "file:../../_build/Tasks/Common/docker-common-v2-1.0.0.tgz" + } +} diff --git a/Tasks/ContainerBuildV0/src/buildcontainer.ts b/Tasks/ContainerBuildV0/src/buildcontainer.ts new file mode 100644 index 000000000000..8c35966b6699 --- /dev/null +++ b/Tasks/ContainerBuildV0/src/buildcontainer.ts @@ -0,0 +1,26 @@ +"use strict"; + +import tl = require('azure-pipelines-task-lib/task'); +import path = require('path'); +import docker = require("./docker"); +import buildctl = require("./buildctl"); + +tl.setResourcePath(path.join(__dirname, '..', 'task.json')); + +async function buildContainer() { + if (process.env["RUNNING_ON"] == "KUBERNETES") { + tl.debug("Building image using buildctl"); + buildctl.buildctlBuildAndPush(); + } + else { + tl.debug("Building image using docker"); + docker.dockerBuildAndPush(); + } +} + +buildContainer() + .then(() => { + tl.setResult(tl.TaskResult.Succeeded, ""); + }).catch((error) => { + tl.setResult(tl.TaskResult.Failed, error) + }); \ No newline at end of file diff --git a/Tasks/ContainerBuildV0/src/buildctl.ts b/Tasks/ContainerBuildV0/src/buildctl.ts new file mode 100644 index 000000000000..ff84d21c9fb0 --- /dev/null +++ b/Tasks/ContainerBuildV0/src/buildctl.ts @@ -0,0 +1,104 @@ +"use strict"; + +import tl = require('azure-pipelines-task-lib/task'); +import * as tr from "azure-pipelines-task-lib/toolrunner"; +import path = require('path'); +import * as toolLib from 'azure-pipelines-tool-lib/tool'; +import utils = require("./utils"); +import RegistryAuthenticationToken from "docker-common-v2/registryauthenticationprovider/registryauthenticationtoken"; +import ContainerConnection from "docker-common-v2/containerconnection"; +import { getDockerRegistryEndpointAuthenticationToken } from "docker-common-v2/registryauthenticationprovider/registryauthenticationtoken"; + +async function configureBuildctl() { + + tl.debug("configuring buildctl"); + var stableBuildKitVersion = await utils.getStableBuildctlVersion(); + var buildctlPath = await utils.downloadBuildctl(stableBuildKitVersion); + + // prepend the tools path. instructs the agent to prepend for future tasks + if (!process.env['PATH'].startsWith(path.dirname(buildctlPath))) { + toolLib.prependPath(path.dirname(buildctlPath)); + } +} + +async function verifyBuildctl() { + var buildctlToolPath = tl.which("buildctl", true); + + if (!buildctlToolPath) + await configureBuildctl(); + + tl.debug(tl.loc("VerifyBuildctlInstallation")); + + var buildctlTool = tl.tool(buildctlToolPath); + var executionOption: tr.IExecOptions = { + silent: true + }; + + buildctlTool.arg("--help"); + buildctlTool.exec(executionOption); +} + +export async function buildctlBuildAndPush() { + + await verifyBuildctl(); + + await utils.getBuildKitPod(); + + let tags = tl.getDelimitedInput("tags", "\n"); + let endpointId = tl.getInput("dockerRegistryServiceConnection"); + let registryAuthenticationToken: RegistryAuthenticationToken = getDockerRegistryEndpointAuthenticationToken(endpointId); + + // Connect to any specified container registry + let connection = new ContainerConnection(); + connection.open(null, registryAuthenticationToken, true, false); + let repositoryName = tl.getInput("repository"); + if (!repositoryName) { + tl.warning("No repository is specified. Nothing will be pushed."); + } + + let imageNames: string[] = []; + if (tl.getInput("dockerRegistryServiceConnection")) { + let imageName = connection.getQualifiedImageName(repositoryName, true); + if (imageName) { + imageNames.push(imageName); + } + } + + var dockerfilefolder = tl.getInput("Dockerfile", true); + if (dockerfilefolder == "Dockerfile") { + dockerfilefolder = "."; + } + else { + var index = dockerfilefolder.lastIndexOf("Dockerfile"); + dockerfilefolder = dockerfilefolder.substring(0, index); + tl.debug("Dockerfilefolder path: " + dockerfilefolder); + + } + var contextarg = "--local=context=" + tl.getInput("buildContext", true); + var dockerfilearg = "--local=dockerfile=" + dockerfilefolder; + var buildctlToolPath = tl.which("buildctl", true); + var buildctlTool = tl.tool(buildctlToolPath); + + buildctlTool.arg("build"); + buildctlTool.arg('--frontend=dockerfile.v0'); + buildctlTool.arg(contextarg); + buildctlTool.arg(dockerfilearg); + if (imageNames && imageNames.length > 0) { + imageNames.forEach(imageName => { + if (tags && tags.length > 0) { + tags.forEach(async tag => { + buildctlTool.arg(`--output=type=image,name=${imageName}:${tag},push=true`); + buildctlTool.exec(); + }) + } + else { + buildctlTool.arg(`--output=type=image,name=${imageName},push=true`); + buildctlTool.exec(); + } + }) + } + else { + // only build the image + await buildctlTool.exec(); + } +} \ No newline at end of file diff --git a/Tasks/ContainerBuildV0/src/docker.ts b/Tasks/ContainerBuildV0/src/docker.ts new file mode 100644 index 000000000000..f6c989f8488e --- /dev/null +++ b/Tasks/ContainerBuildV0/src/docker.ts @@ -0,0 +1,25 @@ +"use strict"; + +import path = require('path'); +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"; + +export async function dockerBuildAndPush() { + let endpointId = tl.getInput("dockerRegistryServiceConnection"); + let registryAuthenticationToken: RegistryAuthenticationToken = getDockerRegistryEndpointAuthenticationToken(endpointId); + + // Connect to any specified container registry + let connection = new ContainerConnection(); + connection.open(null, registryAuthenticationToken, true, false); + + /* tslint:disable:no-var-requires */ + let commandImplementation = require("./dockerbuild"); + await commandImplementation.runBuild(connection) + + if (tl.getInput("dockerRegistryServiceConnection")) { + commandImplementation = require("./dockerpush") + await commandImplementation.run(connection) + } +} diff --git a/Tasks/ContainerBuildV0/src/dockerbuild.ts b/Tasks/ContainerBuildV0/src/dockerbuild.ts new file mode 100644 index 000000000000..34dd4f8b5e8b --- /dev/null +++ b/Tasks/ContainerBuildV0/src/dockerbuild.ts @@ -0,0 +1,55 @@ +"use strict"; + +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"; + +export async function runBuild(connection: ContainerConnection) { + // find dockerfile path + let dockerfilepath = tl.getInput("Dockerfile", true); + let dockerFile = fileUtils.findDockerFile(dockerfilepath); + + if (!tl.exist(dockerFile)) { + throw new Error(tl.loc('ContainerDockerFileNotFound', dockerfilepath)); + } + + // get qualified image names by combining container registry(s) and repository + let repositoryName = tl.getInput("repository"); + let imageNames: string[] = []; + // if container registry is provided, use that + // else, use the currently logged in registries + if (tl.getInput("dockerRegistryServiceConnection")) { + let imageName = connection.getQualifiedImageName(repositoryName, true); + if (imageName) { + imageNames.push(imageName); + } + } + else { + imageNames = connection.getQualifiedImageNamesFromConfig(repositoryName, true); + } + + // get tags input + let tags = tl.getDelimitedInput("tags", "\n"); + let tagArguments: string[] = []; + // find all the tag arguments to be added to the command + if (imageNames && imageNames.length > 0) { + imageNames.forEach(imageName => { + if (tags && tags.length > 0) { + tags.forEach(tag => { + tagArguments.push(imageName + ":" + tag); + }); + } + else { + // pass just the imageName and not the tag. This will tag the image with latest tag as per the default behavior of the build command. + tagArguments.push(imageName); + } + }); + } + else { + tl.debug(tl.loc('NotAddingAnyTagsToBuild')); + } + + let output = ""; + return dockerCommandUtils.build(connection, dockerFile, "", [], tagArguments, (data) => output += data); +} diff --git a/Tasks/ContainerBuildV0/src/dockerpush.ts b/Tasks/ContainerBuildV0/src/dockerpush.ts new file mode 100644 index 000000000000..ffa9b0a1d4f6 --- /dev/null +++ b/Tasks/ContainerBuildV0/src/dockerpush.ts @@ -0,0 +1,72 @@ +"use strict"; + +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 Q = require('q'); + +function pushMultipleImages(connection: ContainerConnection, imageNames: string[], tags: string[], commandArguments: string): any { + let promise: Q.Promise; + let output = ""; + // create chained promise of push commands + if (imageNames && imageNames.length > 0) { + imageNames.forEach(imageName => { + if (tags && tags.length > 0) { + tags.forEach(tag => { + let imageNameWithTag = imageName + ":" + tag; + tl.debug("Pushing ImageNameWithTag: " + imageNameWithTag); + if (promise) { + promise = promise.then(() => { + return dockerCommandUtils.push(connection, imageNameWithTag, commandArguments, (data) => output += data) + }); + } + else { + promise = dockerCommandUtils.push(connection, imageNameWithTag, commandArguments, (data) => output += data); + } + }); + } + else { + tl.debug("Pushing ImageName: " + imageName); + if (promise) { + promise = promise.then(() => { + return dockerCommandUtils.push(connection, imageName, commandArguments, (data) => output += data) + }); + } + else { + promise = dockerCommandUtils.push(connection, imageName, commandArguments, (data) => output += data); + } + } + }); + } + + // will return undefined promise in case imageNames is null or empty list + return promise; +} + +export async function run(connection: ContainerConnection) { + + // get tags input + let tags = tl.getDelimitedInput("tags", "\n"); + + // get repository input + let repositoryName = tl.getInput("repository"); + if (!repositoryName) { + tl.warning("No repository is specified. Nothing will be pushed."); + } + + let imageNames: string[] = []; + // if container registry is provided, use that + // else, use the currently logged in registries + if (tl.getInput("dockerRegistryServiceConnection")) { + let imageName = connection.getQualifiedImageName(repositoryName, true); + if (imageName) { + imageNames.push(imageName); + } + } + else { + imageNames = connection.getQualifiedImageNamesFromConfig(repositoryName, true); + } + + await pushMultipleImages(connection, imageNames, tags, ""); +} \ No newline at end of file diff --git a/Tasks/ContainerBuildV0/src/utils.ts b/Tasks/ContainerBuildV0/src/utils.ts new file mode 100644 index 000000000000..f4e2de549a6c --- /dev/null +++ b/Tasks/ContainerBuildV0/src/utils.ts @@ -0,0 +1,156 @@ +"use strict" + +import tl = require("azure-pipelines-task-lib/task"); +import toolLib = require("azure-pipelines-tool-lib/tool"); +import * as tr from "azure-pipelines-task-lib/toolrunner"; +import * as path from 'path'; +import fs = require('fs'); +import webclient = require("azure-arm-rest-v2/webClient"); +import * as os from "os"; +import * as util from "util"; + +const buildctlToolName = "buildctl" +const uuidV4 = require('uuid/v4'); +const buildctlLatestReleaseUrl = "https://api.github.com/repos/moby/buildkit/releases/latest"; +const buildctlToolNameWithExtension = buildctlToolName + getExecutableExtension(); +const stableBuildctlVersion = "v0.5.1" +var serviceName = "azure-pipelines-pool" +var namespace = "azuredevops" +var port = "8080" +var clusteruri = "" + +export async function getStableBuildctlVersion(): Promise { + var request = new webclient.WebRequest(); + request.uri = buildctlLatestReleaseUrl; + request.method = "GET"; + + try { + var response = await webclient.sendRequest(request); + return response.body["tag_name"]; + } catch (error) { + tl.warning(tl.loc("BuildctlLatestNotKnown", buildctlLatestReleaseUrl, error, stableBuildctlVersion)); + } + + return stableBuildctlVersion; +} + +export async function downloadBuildctl(version: string): Promise { + + let buildctlDownloadPath: string = null; + var cachedToolpath = toolLib.findLocalTool(buildctlToolName, version); + + if (!cachedToolpath) { + try { + buildctlDownloadPath = await toolLib.downloadTool(getBuildctlDownloadURL(version), buildctlToolName + "-" + version + "-" + uuidV4() + getArchiveExtension()); + } catch (exception) { + throw new Error(tl.loc("BuildctlDownloadFailed", getBuildctlDownloadURL(version), exception)); + } + + var unzipedBuildctlPath = await toolLib.extractTar(buildctlDownloadPath); + unzipedBuildctlPath = path.join(unzipedBuildctlPath, "bin", buildctlToolNameWithExtension); + + tl.debug('Extracting archive: ' + unzipedBuildctlPath + ' download path: ' + buildctlDownloadPath); + + var cachedToolpath = await toolLib.cacheFile(unzipedBuildctlPath, buildctlToolNameWithExtension, buildctlToolName, version); + + tl.debug('CachedTool path: ' + cachedToolpath); + } + + var buildctlpath = findBuildctl(cachedToolpath); + if (!buildctlpath) { + throw new Error(tl.loc("BuildctlNotFoundInFolder", cachedToolpath)) + } + + tl.debug('Buildctl path: ' + buildctlpath); + + fs.chmodSync(buildctlpath, "777"); + return buildctlpath; +} + +function getBuildctlDownloadURL(version: string): string { + switch (os.type()) { + case 'Windows_NT': + return util.format("https://github.com/moby/buildkit/releases/download/%s/buildkit-%s.windows-amd64.tar.gz", version, version); + + case 'Darwin': + return util.format("https://github.com/moby/buildkit/releases/download/%s/buildkit-%s.darwin-amd64.tar.gz", version, version); + + default: + case 'Linux': + return util.format("https://github.com/moby/buildkit/releases/download/%s/buildkit-%s.linux-amd64.tar.gz", version, version); + + } +} + +export async function getServiceDetails() { + + var kubectlToolPath = tl.which("kubectl", true); + var kubectlTool = tl.tool(kubectlToolPath); + var serviceNameInput = tl.getInput('poolService', false); + if (serviceNameInput) { + serviceName = serviceNameInput; + } + kubectlTool.arg('get'); + kubectlTool.arg('service'); + kubectlTool.arg(`${serviceName}`); + kubectlTool.arg('-o=json'); + + var executionOption: tr.IExecOptions = { + silent: true + }; + var serviceResponse = kubectlTool.execSync(executionOption); + + if (serviceResponse && serviceResponse.stdout) { + namespace = JSON.parse(serviceResponse.stdout).metadata.namespace ? JSON.parse(serviceResponse.stdout).metadata.namespace : namespace; + port = JSON.parse(serviceResponse.stdout).spec.ports[0].port ? JSON.parse(serviceResponse.stdout).spec.ports[0].port : port; + clusteruri = JSON.parse(serviceResponse.stdout).status.loadBalancer.ingress[0].ip ? JSON.parse(serviceResponse.stdout).status.loadBalancer.ingress[0].ip : clusteruri; + } +} + +export async function getBuildKitPod() { + + await getServiceDetails(); + + let request = new webclient.WebRequest(); + let headers = { + "key": tl.getVariable('Build.Repository.Name') + tl.getInput("Dockerfile", true) + }; + let webRequestOptions: webclient.WebRequestOptions = { retriableErrorCodes: [], retriableStatusCodes: [], retryCount: 1, retryIntervalInSeconds: 5, retryRequestTimedout: true }; + + request.uri = `http://${clusteruri}:${port}/buildPod`; + request.headers = headers + request.method = "GET"; + + var response = await webclient.sendRequest(request, webRequestOptions); + var podname = response.body.Message; + + tl.debug("Podname " + podname); + + // set the environment variable + process.env["BUILDKIT_HOST"] = "kube-pod://" + podname + "?namespace=" + namespace; +} + +function findBuildctl(rootFolder: string) { + + var BuildctlPath = path.join(rootFolder, buildctlToolNameWithExtension); + var allPaths = tl.find(rootFolder); + var matchingResultsFiles = tl.match(allPaths, BuildctlPath, rootFolder); + + tl.debug('findBuildctl path: ' + BuildctlPath); + + return matchingResultsFiles[0]; +} + +function getArchiveExtension(): string { + if (os.type() == 'Windows_NT') { + return ".zip"; + } + return ".tar.gz"; +} + +function getExecutableExtension(): string { + if (os.type() == 'Windows_NT') { + return ".exe"; + } + return ""; +} \ No newline at end of file diff --git a/Tasks/ContainerBuildV0/task.json b/Tasks/ContainerBuildV0/task.json new file mode 100644 index 000000000000..3c5761289de8 --- /dev/null +++ b/Tasks/ContainerBuildV0/task.json @@ -0,0 +1,89 @@ +{ + "id": "8413C881-4959-43D5-8840-B4EA0FFC5CFE", + "name": "ContainerBuild", + "friendlyName": "Container Build", + "description": "Container Build Task", + "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks", + "helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?linkid=2107300)", + "category": "Build", + "visibility": [ + "Build", + "Release" + ], + "author": "Microsoft Corporation", + "version": { + "Major": 0, + "Minor": 160, + "Patch": 1 + }, + "demands": [], + "satisfies": [ + "Buildctl" + ], + "preview": "true", + "groups": [], + "inputs": [ + { + "name": "poolService", + "label": "Pool Service (applicable when running on Kubernetes)", + "type": "string", + "helpMarkDown": "Name of the service applicable when running on Kubernetes.", + "defaultValue": "" + }, + { + "name": "dockerRegistryServiceConnection", + "type": "connectedService:dockerregistry", + "label": "Docker registry service connection", + "helpMarkDown": "Select a Docker registry service connection." + }, + { + "name": "repository", + "label": "Container repository", + "type": "string", + "helpMarkDown": "Name of the repository within the container registry.", + "defaultValue": "" + }, + { + "name": "Dockerfile", + "type": "filePath", + "label": "Dockerfile", + "defaultValue": ".", + "required": true, + "helpMarkDown": "Path to Dockerfile." + }, + { + "name": "buildContext", + "type": "filePath", + "label": "Build context", + "defaultValue": ".", + "helpMarkDown": "Path to Build context." + }, + { + "name": "tags", + "type": "multiLine", + "defaultValue": "$(Build.BuildId)", + "properties": { + "resizable": "true", + "rows": "2" + }, + "label": "Tags", + "helpMarkDown": "A list of tags in separate lines. Tags are used while building and pushing the image to container registry." + } + ], + "instanceNameFormat": "Container Build Task", + "execution": { + "Node": { + "target": "src//buildcontainer.js" + } + }, + "messages": { + "ContainerPatternNotFound": "No pattern found in Docker filepath parameter", + "CouldNotFindDockerConfig": "Could not find Docker Config. Either DOCKER_CONFIG variable is not set, or the config file is outside the temp directory, or the file does not exist. DOCKER_CONFIG: %s", + "BuildctlLatestNotKnown": "Cannot get the latest Buildctl info from %s. Error %s. Using default Buildctl version %s.", + "BuildctlDownloadFailed": "Failed to download Buildctl from location %s. Error %s", + "BuildctlNotFoundInFolder": "Buildctl executable not found in path %s", + "FileContentSynced": "Synced the file content to the disk. The content is %s.", + "VerifyBuildctlInstallation": "Verifying Buildctl installation...", + "WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s" + } +} diff --git a/Tasks/ContainerBuildV0/task.loc.json b/Tasks/ContainerBuildV0/task.loc.json new file mode 100644 index 000000000000..1e407f8881e8 --- /dev/null +++ b/Tasks/ContainerBuildV0/task.loc.json @@ -0,0 +1,89 @@ +{ + "id": "8413C881-4959-43D5-8840-B4EA0FFC5CFE", + "name": "ContainerBuild", + "friendlyName": "ms-resource:loc.friendlyName", + "description": "ms-resource:loc.description", + "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks", + "helpMarkDown": "ms-resource:loc.helpMarkDown", + "category": "Build", + "visibility": [ + "Build", + "Release" + ], + "author": "Microsoft Corporation", + "version": { + "Major": 0, + "Minor": 160, + "Patch": 1 + }, + "demands": [], + "satisfies": [ + "Buildctl" + ], + "preview": "true", + "groups": [], + "inputs": [ + { + "name": "poolService", + "label": "ms-resource:loc.input.label.poolService", + "type": "string", + "helpMarkDown": "ms-resource:loc.input.help.poolService", + "defaultValue": "" + }, + { + "name": "dockerRegistryServiceConnection", + "type": "connectedService:dockerregistry", + "label": "ms-resource:loc.input.label.dockerRegistryServiceConnection", + "helpMarkDown": "ms-resource:loc.input.help.dockerRegistryServiceConnection" + }, + { + "name": "repository", + "label": "ms-resource:loc.input.label.repository", + "type": "string", + "helpMarkDown": "ms-resource:loc.input.help.repository", + "defaultValue": "" + }, + { + "name": "Dockerfile", + "type": "filePath", + "label": "ms-resource:loc.input.label.Dockerfile", + "defaultValue": ".", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.Dockerfile" + }, + { + "name": "buildContext", + "type": "filePath", + "label": "ms-resource:loc.input.label.buildContext", + "defaultValue": ".", + "helpMarkDown": "ms-resource:loc.input.help.buildContext" + }, + { + "name": "tags", + "type": "multiLine", + "defaultValue": "$(Build.BuildId)", + "properties": { + "resizable": "true", + "rows": "2" + }, + "label": "ms-resource:loc.input.label.tags", + "helpMarkDown": "ms-resource:loc.input.help.tags" + } + ], + "instanceNameFormat": "ms-resource:loc.instanceNameFormat", + "execution": { + "Node": { + "target": "src//buildcontainer.js" + } + }, + "messages": { + "ContainerPatternNotFound": "ms-resource:loc.messages.ContainerPatternNotFound", + "CouldNotFindDockerConfig": "ms-resource:loc.messages.CouldNotFindDockerConfig", + "BuildctlLatestNotKnown": "ms-resource:loc.messages.BuildctlLatestNotKnown", + "BuildctlDownloadFailed": "ms-resource:loc.messages.BuildctlDownloadFailed", + "BuildctlNotFoundInFolder": "ms-resource:loc.messages.BuildctlNotFoundInFolder", + "FileContentSynced": "ms-resource:loc.messages.FileContentSynced", + "VerifyBuildctlInstallation": "ms-resource:loc.messages.VerifyBuildctlInstallation", + "WritingDockerConfigToTempFile": "ms-resource:loc.messages.WritingDockerConfigToTempFile" + } +} \ No newline at end of file diff --git a/Tasks/ContainerBuildV0/tsconfig.json b/Tasks/ContainerBuildV0/tsconfig.json new file mode 100644 index 000000000000..75c70c9e1748 --- /dev/null +++ b/Tasks/ContainerBuildV0/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs", + "typeRoots": [ "node_modules/@types" ] + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/Tasks/ContainerStructureTestV0/task.json b/Tasks/ContainerStructureTestV0/task.json index 8a8fbdec6152..f9dac96ebecd 100644 --- a/Tasks/ContainerStructureTestV0/task.json +++ b/Tasks/ContainerStructureTestV0/task.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 1, - "Patch": 4 + "Patch": 5 }, "preview": true, "demands": [], diff --git a/Tasks/ContainerStructureTestV0/task.loc.json b/Tasks/ContainerStructureTestV0/task.loc.json index 8558b07789e7..e51b5a194f96 100644 --- a/Tasks/ContainerStructureTestV0/task.loc.json +++ b/Tasks/ContainerStructureTestV0/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 1, - "Patch": 4 + "Patch": 5 }, "preview": true, "demands": [], diff --git a/Tasks/DockerComposeV0/task.json b/Tasks/DockerComposeV0/task.json index 7950660897dd..c14e15e52cd9 100644 --- a/Tasks/DockerComposeV0/task.json +++ b/Tasks/DockerComposeV0/task.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 160, - "Patch": 1 + "Patch": 2 }, "demands": [], "preview": "false", diff --git a/Tasks/DockerComposeV0/task.loc.json b/Tasks/DockerComposeV0/task.loc.json index 04d6246055d1..6a03c74bc1c9 100644 --- a/Tasks/DockerComposeV0/task.loc.json +++ b/Tasks/DockerComposeV0/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 160, - "Patch": 1 + "Patch": 2 }, "demands": [], "preview": "false", diff --git a/Tasks/DockerV2/task.json b/Tasks/DockerV2/task.json index 68f957e03dc1..abf6c5673073 100644 --- a/Tasks/DockerV2/task.json +++ b/Tasks/DockerV2/task.json @@ -14,7 +14,7 @@ "version": { "Major": 2, "Minor": 160, - "Patch": 1 + "Patch": 2 }, "demands": [], "releaseNotes": "Simplified the task YAML by:
 - Removing the Container registry type input
 - Removing complex inputs as they can be passed as arguments to the command.", diff --git a/Tasks/DockerV2/task.loc.json b/Tasks/DockerV2/task.loc.json index f39f38586dc3..71ff31dbd4ee 100644 --- a/Tasks/DockerV2/task.loc.json +++ b/Tasks/DockerV2/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 2, "Minor": 160, - "Patch": 1 + "Patch": 2 }, "demands": [], "releaseNotes": "ms-resource:loc.releaseNotes", diff --git a/Tasks/KubernetesManifestV0/task.json b/Tasks/KubernetesManifestV0/task.json index 6492598735b3..74f546258a1c 100644 --- a/Tasks/KubernetesManifestV0/task.json +++ b/Tasks/KubernetesManifestV0/task.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 160, - "Patch": 1 + "Patch": 2 }, "demands": [], "groups": [], diff --git a/Tasks/KubernetesManifestV0/task.loc.json b/Tasks/KubernetesManifestV0/task.loc.json index c6a7d1226e6f..e88c78c6a156 100644 --- a/Tasks/KubernetesManifestV0/task.loc.json +++ b/Tasks/KubernetesManifestV0/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 160, - "Patch": 1 + "Patch": 2 }, "demands": [], "groups": [], diff --git a/Tasks/KubernetesV1/task.json b/Tasks/KubernetesV1/task.json index a7c8a855f292..e31f4b578318 100644 --- a/Tasks/KubernetesV1/task.json +++ b/Tasks/KubernetesV1/task.json @@ -14,7 +14,7 @@ "version": { "Major": 1, "Minor": 160, - "Patch": 1 + "Patch": 2 }, "demands": [], "releaseNotes": "What's new in Version 1.0:
 Added new service connection type input for easy selection of Azure AKS cluster.
 Replaced output variable input with output variables section that we had added in all tasks.", diff --git a/Tasks/KubernetesV1/task.loc.json b/Tasks/KubernetesV1/task.loc.json index 222c129534ea..b2f19686aede 100644 --- a/Tasks/KubernetesV1/task.loc.json +++ b/Tasks/KubernetesV1/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 1, "Minor": 160, - "Patch": 1 + "Patch": 2 }, "demands": [], "releaseNotes": "ms-resource:loc.releaseNotes", diff --git a/make-options.json b/make-options.json index 53c70b04a53a..27b252d265c8 100644 --- a/make-options.json +++ b/make-options.json @@ -49,6 +49,7 @@ "CondaEnvironmentV0", "CondaEnvironmentV1", "ContainerStructureTestV0", + "ContainerBuildV0", "CopyFilesV2", "CopyFilesOverSSHV0", "CUrlUploaderV2",