diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d73b94a..1629983 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,22 +16,26 @@ jobs: - run: npm install - uses: ./ with: - compose-file: "./docker/docker-compose.yml" + compose-file: "${{ github.workspace }}/docker/docker-compose.yml" + cwd: "${{ github.workspace }}" services: | helloworld2 helloworld3 - uses: ./ with: compose-file: "./docker/docker-compose.yml" + cwd: "${{ github.workspace }}" down-flags: "--volumes" - uses: ./ with: compose-file: "./docker/docker-compose.yml" compose-flags: "--profile profile-1" + cwd: "${{ github.workspace }}" down-flags: "--volumes" - uses: ./ with: compose-file: "./docker/docker-compose-with-env.yml" + cwd: "${{ github.workspace }}" env: IMAGE_NAME: hello-world - uses: ./ @@ -39,6 +43,7 @@ jobs: compose-file: | ./docker/docker-compose.yml ./docker/docker-compose.ci.yml + cwd: "${{ github.workspace }}" services: | helloworld2 helloworld4 diff --git a/action.yml b/action.yml index 41469ba..60441d4 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,10 @@ inputs: description: "additional options to pass to `docker-compose` command" required: false default: "" + cwd: # id of input + description: "Current working directory" + required: false + default: "" down-flags: # id of input description: "additional options to pass to `docker-compose down` command" required: false diff --git a/main.js b/main.js index da08d76..c87bc42 100644 --- a/main.js +++ b/main.js @@ -20,6 +20,7 @@ try { const options = { config: composeFiles, + cwd: core.getInput("cwd"), log: true, composeOptions: utils.parseFlags(core.getInput("compose-flags")), commandOptions: utils.parseFlags(core.getInput("up-flags")), diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 59edfd4..d63dfb3 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -454,9 +454,9 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, "node_modules/docker-compose": { - "version": "0.24.1", - "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.24.1.tgz", - "integrity": "sha512-CVphzCi0Hmw/0CHlAzgiwhLsJjFRqnvpBYMYbf63bz6MON69ElgrfrgQTmgPtEjbifjgaptu3+Gea62vI+9jiA==", + "version": "0.24.3", + "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.24.3.tgz", + "integrity": "sha512-x3/QN3AIOMe7j2c8f/jcycizMft7dl8MluoB9OGPAYCyKHHiPUFqI9GjCcsU0kYy24vYKMCcfR6+5ZaEyQlrxg==", "dependencies": { "yaml": "^2.2.2" }, diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity new file mode 100644 index 0000000..f254f1e --- /dev/null +++ b/node_modules/.yarn-integrity @@ -0,0 +1,171 @@ +{ + "systemParams": "darwin-arm64-93", + "modulesFolders": [ + "node_modules" + ], + "flags": [], + "linkedModules": [], + "topLevelPatterns": [ + "@actions/core@^1.8.2", + "@actions/github@^4.0.0", + "docker-compose@^0.24.3", + "eslint-config-prettier@^8.5.0", + "eslint-plugin-prettier@^4.2.1", + "eslint@^8.24.0", + "prettier@^2.7.1" + ], + "lockfileEntries": { + "@aashutoshrathi/word-wrap@^1.2.3": "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf", + "@actions/core@^1.8.2": "https://registry.yarnpkg.com/@actions/core/-/core-1.10.1.tgz#61108e7ac40acae95ee36da074fa5850ca4ced8a", + "@actions/github@^4.0.0": "https://registry.yarnpkg.com/@actions/github/-/github-4.0.0.tgz#d520483151a2bf5d2dc9cd0f20f9ac3a2e458816", + "@actions/http-client@^1.0.8": "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0", + "@actions/http-client@^2.0.1": "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.2.0.tgz#f8239f375be6185fcd07765efdcf0031ad5df1a0", + "@eslint-community/eslint-utils@^4.2.0": "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59", + "@eslint-community/regexpp@^4.6.1": "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63", + "@eslint/eslintrc@^2.1.4": "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad", + "@eslint/js@8.55.0": "https://registry.yarnpkg.com/@eslint/js/-/js-8.55.0.tgz#b721d52060f369aa259cf97392403cb9ce892ec6", + "@fastify/busboy@^2.0.0": "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.0.tgz#0709e9f4cb252351c609c6e6d8d6779a8d25edff", + "@humanwhocodes/config-array@^0.11.13": "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297", + "@humanwhocodes/module-importer@^1.0.1": "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c", + "@humanwhocodes/object-schema@^2.0.1": "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044", + "@nodelib/fs.scandir@2.1.5": "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5", + "@nodelib/fs.stat@2.0.5": "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b", + "@nodelib/fs.walk@^1.2.8": "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a", + "@octokit/auth-token@^2.4.4": "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36", + "@octokit/core@^3.0.0": "https://registry.yarnpkg.com/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085", + "@octokit/endpoint@^6.0.1": "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658", + "@octokit/graphql@^4.5.8": "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3", + "@octokit/openapi-types@^12.11.0": "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0", + "@octokit/plugin-paginate-rest@^2.2.3": "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e", + "@octokit/plugin-rest-endpoint-methods@^4.0.0": "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.15.1.tgz#91a064bee99d0ffcef74a04357e1cf15c27d1cd0", + "@octokit/request-error@^2.0.5": "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677", + "@octokit/request-error@^2.1.0": "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677", + "@octokit/request@^5.6.0": "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0", + "@octokit/request@^5.6.3": "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0", + "@octokit/types@^6.0.3": "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04", + "@octokit/types@^6.13.0": "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04", + "@octokit/types@^6.16.1": "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04", + "@octokit/types@^6.40.0": "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04", + "@ungap/structured-clone@^1.2.0": "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406", + "acorn-jsx@^5.3.2": "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937", + "acorn@^8.9.0": "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b", + "ajv@^6.12.4": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4", + "ansi-regex@^5.0.1": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304", + "ansi-styles@^4.1.0": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937", + "argparse@^2.0.1": "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38", + "balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee", + "before-after-hook@^2.2.0": "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c", + "brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd", + "callsites@^3.0.0": "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73", + "chalk@^4.0.0": "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01", + "color-convert@^2.0.1": "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3", + "color-name@~1.1.4": "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2", + "concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "cross-spawn@^7.0.2": "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6", + "debug@^4.1.1": "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865", + "debug@^4.3.2": "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865", + "deep-is@^0.1.3": "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831", + "deprecation@^2.0.0": "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919", + "deprecation@^2.3.1": "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919", + "docker-compose@^0.24.3": "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.24.3.tgz#298d7bb4aaf37b3b45d0e4ef55c7f58ccc39cca9", + "doctrine@^3.0.0": "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961", + "escape-string-regexp@^4.0.0": "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34", + "eslint-config-prettier@^8.5.0": "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz#3a06a662130807e2502fc3ff8b4143d8a0658e11", + "eslint-plugin-prettier@^4.2.1": "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b", + "eslint-scope@^7.2.2": "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f", + "eslint-visitor-keys@^3.3.0": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800", + "eslint-visitor-keys@^3.4.1": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800", + "eslint-visitor-keys@^3.4.3": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800", + "eslint@^8.24.0": "https://registry.yarnpkg.com/eslint/-/eslint-8.55.0.tgz#078cb7b847d66f2c254ea1794fa395bf8e7e03f8", + "espree@^9.6.0": "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f", + "espree@^9.6.1": "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f", + "esquery@^1.4.2": "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b", + "esrecurse@^4.3.0": "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921", + "estraverse@^5.1.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123", + "estraverse@^5.2.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123", + "esutils@^2.0.2": "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64", + "fast-deep-equal@^3.1.1": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525", + "fast-deep-equal@^3.1.3": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525", + "fast-diff@^1.1.2": "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0", + "fast-json-stable-stringify@^2.0.0": "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633", + "fast-levenshtein@^2.0.6": "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917", + "fastq@^1.6.0": "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a", + "file-entry-cache@^6.0.1": "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027", + "find-up@^5.0.0": "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc", + "flat-cache@^3.0.4": "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee", + "flatted@^3.2.9": "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf", + "fs.realpath@^1.0.0": "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f", + "glob-parent@^6.0.2": "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3", + "glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b", + "globals@^13.19.0": "https://registry.yarnpkg.com/globals/-/globals-13.23.0.tgz#ef31673c926a0976e1f61dab4dca57e0c0a8af02", + "graphemer@^1.4.0": "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6", + "has-flag@^4.0.0": "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b", + "ignore@^5.2.0": "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78", + "import-fresh@^3.2.1": "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b", + "imurmurhash@^0.1.4": "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "inflight@^1.0.4": "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "inherits@2": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", + "is-extglob@^2.1.1": "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2", + "is-glob@^4.0.0": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084", + "is-glob@^4.0.3": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084", + "is-path-inside@^3.0.3": "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283", + "is-plain-object@^5.0.0": "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344", + "isexe@^2.0.0": "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10", + "js-yaml@^4.1.0": "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602", + "json-buffer@3.0.1": "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13", + "json-schema-traverse@^0.4.1": "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660", + "json-stable-stringify-without-jsonify@^1.0.1": "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651", + "keyv@^4.5.3": "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93", + "levn@^0.4.1": "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade", + "locate-path@^6.0.0": "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286", + "lodash.merge@^4.6.2": "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a", + "minimatch@^3.0.5": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", + "minimatch@^3.1.1": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", + "minimatch@^3.1.2": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", + "ms@2.1.2": "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009", + "natural-compare@^1.4.0": "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7", + "node-fetch@^2.6.7": "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d", + "once@^1.3.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "once@^1.4.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "optionator@^0.9.3": "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64", + "p-limit@^3.0.2": "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b", + "p-locate@^5.0.0": "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834", + "parent-module@^1.0.0": "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2", + "path-exists@^4.0.0": "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3", + "path-is-absolute@^1.0.0": "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "path-key@^3.1.0": "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375", + "prelude-ls@^1.2.1": "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396", + "prettier-linter-helpers@^1.0.0": "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b", + "prettier@^2.7.1": "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da", + "punycode@^2.1.0": "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5", + "queue-microtask@^1.2.2": "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243", + "resolve-from@^4.0.0": "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6", + "reusify@^1.0.4": "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76", + "rimraf@^3.0.2": "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a", + "run-parallel@^1.1.9": "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee", + "shebang-command@^2.0.0": "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea", + "shebang-regex@^3.0.0": "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172", + "strip-ansi@^6.0.1": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9", + "strip-json-comments@^3.1.1": "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006", + "supports-color@^7.1.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da", + "text-table@^0.2.0": "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4", + "tr46@~0.0.3": "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a", + "tunnel@0.0.6": "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c", + "tunnel@^0.0.6": "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c", + "type-check@^0.4.0": "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1", + "type-check@~0.4.0": "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1", + "type-fest@^0.20.2": "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4", + "undici@^5.25.4": "https://registry.yarnpkg.com/undici/-/undici-5.28.2.tgz#fea200eac65fc7ecaff80a023d1a0543423b4c91", + "universal-user-agent@^6.0.0": "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.1.tgz#15f20f55da3c930c57bddbf1734c6654d5fd35aa", + "uri-js@^4.2.2": "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e", + "uuid@^8.3.2": "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2", + "webidl-conversions@^3.0.0": "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871", + "whatwg-url@^5.0.0": "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d", + "which@^2.0.1": "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1", + "wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", + "yaml@^2.2.2": "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2", + "yocto-queue@^0.1.0": "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + }, + "files": [], + "artifacts": {} +} \ No newline at end of file diff --git a/node_modules/@eslint-community/eslint-utils/node_modules/.bin/eslint b/node_modules/@eslint-community/eslint-utils/node_modules/.bin/eslint new file mode 120000 index 0000000..da97b4e --- /dev/null +++ b/node_modules/@eslint-community/eslint-utils/node_modules/.bin/eslint @@ -0,0 +1 @@ +../../../../eslint/bin/eslint.js \ No newline at end of file diff --git a/node_modules/acorn-jsx/node_modules/.bin/acorn b/node_modules/acorn-jsx/node_modules/.bin/acorn new file mode 120000 index 0000000..fa65fee --- /dev/null +++ b/node_modules/acorn-jsx/node_modules/.bin/acorn @@ -0,0 +1 @@ +../../../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/cross-spawn/node_modules/.bin/node-which b/node_modules/cross-spawn/node_modules/.bin/node-which new file mode 120000 index 0000000..c7bc814 --- /dev/null +++ b/node_modules/cross-spawn/node_modules/.bin/node-which @@ -0,0 +1 @@ +../../../which/bin/node-which \ No newline at end of file diff --git a/node_modules/docker-compose/CHANGELOG.md b/node_modules/docker-compose/CHANGELOG.md index 671250f..c1e89a1 100644 --- a/node_modules/docker-compose/CHANGELOG.md +++ b/node_modules/docker-compose/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.24.3](https://github.com/PDMLab/docker-compose/compare/v0.24.2...v0.24.3) (2023-10-30) + + +### Features + +* ps supports json format ([4498eb4](https://github.com/PDMLab/docker-compose/commit/4498eb481c52f852247342b495ff66c5b465f895)) + +### [0.24.2](https://github.com/PDMLab/docker-compose/compare/v0.24.1...v0.24.2) (2023-07-27) + + +### Bug Fixes + +* **ci:** shadow ci command using yarn ([bf0d1b6](https://github.com/PDMLab/docker-compose/commit/bf0d1b6a7ebc80b0ac158bbffc277b3c118545df)) + ### [0.24.1](https://github.com/PDMLab/docker-compose/compare/v0.24.0...v0.24.1) (2023-05-14) diff --git a/node_modules/docker-compose/community-samples/readme.md b/node_modules/docker-compose/community-samples/readme.md deleted file mode 100644 index 9b3699f..0000000 --- a/node_modules/docker-compose/community-samples/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# Community Samples - -This file refers to the community samples for the usage of this module in CI/CD environments like GitLab CI, Jenkins, Azure DevOps and so on. - -If you want to contribute your use case, please see [#44][i44] for further details. - -## CI/CD environments - -### Azure DevOps -- - -### CircleCI -- - -### GitLab CI -- - -### Jenkins -- - - -[i44]: https://github.com/PDMLab/docker-compose/issues/44 diff --git a/node_modules/docker-compose/dist/src/index.d.ts b/node_modules/docker-compose/dist/src/index.d.ts deleted file mode 100644 index 93255d6..0000000 --- a/node_modules/docker-compose/dist/src/index.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -/// -export interface IDockerComposeOptions { - cwd?: string; - executablePath?: string; - config?: string | string[]; - configAsString?: string; - log?: boolean; - composeOptions?: string[] | (string | string[])[]; - commandOptions?: string[] | (string | string[])[]; - env?: NodeJS.ProcessEnv; - callback?: (chunk: Buffer, streamSource?: 'stdout' | 'stderr') => void; -} -export type DockerComposePortResult = { - address: string; - port: number; -}; -export type DockerComposeVersionResult = { - version: string; -}; -export type DockerComposeConfigResult = { - config: { - version: Record; - services: Record>; - volumes: Record; - }; -}; -export type DockerComposeConfigServicesResult = { - services: string[]; -}; -export type DockerComposeConfigVolumesResult = { - volumes: string[]; -}; -export interface IDockerComposeLogOptions extends IDockerComposeOptions { - follow?: boolean; -} -export interface IDockerComposeBuildOptions extends IDockerComposeOptions { - parallel?: boolean; -} -export interface IDockerComposePushOptions extends IDockerComposeOptions { - ignorePushFailures?: boolean; -} -export interface IDockerComposeResult { - exitCode: number | null; - out: string; - err: string; -} -export type TypedDockerComposeResult = { - exitCode: number | null; - out: string; - err: string; - data: T; -}; -export type DockerComposePsResult = { - services: Array<{ - name: string; - command: string; - state: string; - ports: Array<{ - mapped?: { - address: string; - port: number; - }; - exposed: { - port: number; - protocol: string; - }; - }>; - }>; -}; -export declare const mapPsOutput: (output: string, options?: IDockerComposeOptions) => DockerComposePsResult; -/** - * Executes docker-compose command with common options - */ -export declare const execCompose: (command: any, args: any, options?: IDockerComposeOptions) => Promise; -export declare const upAll: (options?: IDockerComposeOptions) => Promise; -export declare const upMany: (services: string[], options?: IDockerComposeOptions) => Promise; -export declare const upOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const down: (options?: IDockerComposeOptions) => Promise; -export declare const stop: (options?: IDockerComposeOptions) => Promise; -export declare const stopOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const stopMany: (options?: IDockerComposeOptions, ...services: string[]) => Promise; -export declare const pauseOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const unpauseOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const kill: (options?: IDockerComposeOptions) => Promise; -export declare const rm: (options?: IDockerComposeOptions, ...services: string[]) => Promise; -export declare const exec: (container: string, command: string | string[], options?: IDockerComposeOptions) => Promise; -export declare const run: (container: string, command: string | string[], options?: IDockerComposeOptions) => Promise; -export declare const buildAll: (options?: IDockerComposeBuildOptions) => Promise; -export declare const buildMany: (services: string[], options?: IDockerComposeBuildOptions) => Promise; -export declare const buildOne: (service: string, options?: IDockerComposeBuildOptions) => Promise; -export declare const pullAll: (options?: IDockerComposeOptions) => Promise; -export declare const pullMany: (services: string[], options?: IDockerComposeOptions) => Promise; -export declare const pullOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const config: (options?: IDockerComposeOptions) => Promise>; -export declare const configServices: (options?: IDockerComposeOptions) => Promise>; -export declare const configVolumes: (options?: IDockerComposeOptions) => Promise>; -export declare const ps: (options?: IDockerComposeOptions) => Promise>; -export declare const push: (options?: IDockerComposePushOptions) => Promise; -export declare const restartAll: (options?: IDockerComposeOptions) => Promise; -export declare const restartMany: (services: string[], options?: IDockerComposeOptions) => Promise; -export declare const restartOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const logs: (services: string | string[], options?: IDockerComposeLogOptions) => Promise; -export declare const port: (service: string, containerPort: string | number, options?: IDockerComposeOptions) => Promise>; -export declare const version: (options?: IDockerComposeOptions) => Promise>; -declare const _default: { - upAll: (options?: IDockerComposeOptions | undefined) => Promise; - upMany: (services: string[], options?: IDockerComposeOptions | undefined) => Promise; - upOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - down: (options?: IDockerComposeOptions | undefined) => Promise; - stop: (options?: IDockerComposeOptions | undefined) => Promise; - stopOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - stopMany: (options?: IDockerComposeOptions | undefined, ...services: string[]) => Promise; - pauseOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - unpauseOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - kill: (options?: IDockerComposeOptions | undefined) => Promise; - rm: (options?: IDockerComposeOptions | undefined, ...services: string[]) => Promise; - exec: (container: string, command: string | string[], options?: IDockerComposeOptions | undefined) => Promise; - run: (container: string, command: string | string[], options?: IDockerComposeOptions | undefined) => Promise; - buildAll: (options?: IDockerComposeBuildOptions) => Promise; - buildMany: (services: string[], options?: IDockerComposeBuildOptions) => Promise; - buildOne: (service: string, options?: IDockerComposeBuildOptions | undefined) => Promise; - pullAll: (options?: IDockerComposeOptions) => Promise; - pullMany: (services: string[], options?: IDockerComposeOptions) => Promise; - pullOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - config: (options?: IDockerComposeOptions | undefined) => Promise>; - configServices: (options?: IDockerComposeOptions | undefined) => Promise>; - configVolumes: (options?: IDockerComposeOptions | undefined) => Promise>; - ps: (options?: IDockerComposeOptions | undefined) => Promise>; - push: (options?: IDockerComposePushOptions) => Promise; - restartAll: (options?: IDockerComposeOptions | undefined) => Promise; - restartMany: (services: string[], options?: IDockerComposeOptions | undefined) => Promise; - restartOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - logs: (services: string | string[], options?: IDockerComposeLogOptions) => Promise; - port: (service: string, containerPort: string | number, options?: IDockerComposeOptions | undefined) => Promise>; - version: (options?: IDockerComposeOptions | undefined) => Promise>; -}; -export default _default; diff --git a/node_modules/docker-compose/dist/src/index.js b/node_modules/docker-compose/dist/src/index.js deleted file mode 100644 index 98529c8..0000000 --- a/node_modules/docker-compose/dist/src/index.js +++ /dev/null @@ -1,488 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.version = exports.port = exports.logs = exports.restartOne = exports.restartMany = exports.restartAll = exports.push = exports.ps = exports.configVolumes = exports.configServices = exports.config = exports.pullOne = exports.pullMany = exports.pullAll = exports.buildOne = exports.buildMany = exports.buildAll = exports.run = exports.exec = exports.rm = exports.kill = exports.unpauseOne = exports.pauseOne = exports.stopMany = exports.stopOne = exports.stop = exports.down = exports.upOne = exports.upMany = exports.upAll = exports.execCompose = exports.mapPsOutput = void 0; -var child_process_1 = __importDefault(require("child_process")); -var yaml_1 = __importDefault(require("yaml")); -var map_ports_1 = __importDefault(require("./map-ports")); -var nonEmptyString = function (v) { return v !== ''; }; -var mapPsOutput = function (output, options) { - var isQuiet = false; - if (options === null || options === void 0 ? void 0 : options.commandOptions) { - isQuiet = - options.commandOptions.includes('-q') || - options.commandOptions.includes('--quiet') || - options.commandOptions.includes('--services'); - } - var services = output - .split("\n") - .filter(nonEmptyString) - .filter(function (_, index) { return isQuiet || index > 1; }) - .map(function (line) { - var _a; - var nameFragment = line; - var commandFragment = ''; - var stateFragment = ''; - var untypedPortsFragment = ''; - if (!isQuiet) { - ; - _a = line.split(/\s{3,}/), nameFragment = _a[0], commandFragment = _a[1], stateFragment = _a[2], untypedPortsFragment = _a[3]; - } - return { - name: nameFragment.trim(), - command: commandFragment.trim(), - state: stateFragment.trim(), - ports: (0, map_ports_1.default)(untypedPortsFragment.trim()) - }; - }); - return { services: services }; -}; -exports.mapPsOutput = mapPsOutput; -/** - * Converts supplied yml files to cli arguments - * https://docs.docker.com/compose/reference/overview/#use--f-to-specify-name-and-path-of-one-or-more-compose-files - */ -var configToArgs = function (config) { - if (typeof config === 'undefined') { - return []; - } - else if (typeof config === 'string') { - return ['-f', config]; - } - else if (config instanceof Array) { - return config.reduce(function (args, item) { return args.concat(['-f', item]); }, []); - } - throw new Error("Invalid argument supplied: ".concat(config)); -}; -/** - * Converts docker-compose commandline options to cli arguments - */ -var composeOptionsToArgs = function (composeOptions) { - var composeArgs = []; - composeOptions.forEach(function (option) { - if (option instanceof Array) { - composeArgs = composeArgs.concat(option); - } - if (typeof option === 'string') { - composeArgs = composeArgs.concat([option]); - } - }); - return composeArgs; -}; -/** - * Executes docker-compose command with common options - */ -var execCompose = function (command, args, options) { - if (options === void 0) { options = {}; } - return new Promise(function (resolve, reject) { - var composeOptions = options.composeOptions || []; - var commandOptions = options.commandOptions || []; - var composeArgs = composeOptionsToArgs(composeOptions); - var isConfigProvidedAsString = !!options.configAsString; - var configArgs = isConfigProvidedAsString - ? ['-f', '-'] - : configToArgs(options.config); - composeArgs = composeArgs.concat(configArgs.concat([command].concat(composeOptionsToArgs(commandOptions), args))); - var cwd = options.cwd; - var env = options.env || undefined; - var executablePath = options.executablePath || 'docker-compose'; - var childProc = child_process_1.default.spawn(executablePath, composeArgs, { - cwd: cwd, - env: env - }); - childProc.on('error', function (err) { - reject(err); - }); - var result = { - exitCode: null, - err: '', - out: '' - }; - childProc.stdout.on('data', function (chunk) { - var _a; - result.out += chunk.toString(); - (_a = options.callback) === null || _a === void 0 ? void 0 : _a.call(options, chunk, 'stdout'); - }); - childProc.stderr.on('data', function (chunk) { - var _a; - result.err += chunk.toString(); - (_a = options.callback) === null || _a === void 0 ? void 0 : _a.call(options, chunk, 'stderr'); - }); - childProc.on('exit', function (exitCode) { - result.exitCode = exitCode; - if (exitCode === 0) { - resolve(result); - } - else { - reject(result); - } - }); - if (isConfigProvidedAsString) { - childProc.stdin.write(options.configAsString); - childProc.stdin.end(); - } - if (options.log) { - childProc.stdout.pipe(process.stdout); - childProc.stderr.pipe(process.stderr); - } - }); -}; -exports.execCompose = execCompose; -/** - * Determines whether or not to use the default non-interactive flag -d for up commands - */ -var shouldUseDefaultNonInteractiveFlag = function (options) { - if (options === void 0) { options = {}; } - var commandOptions = options.commandOptions || []; - var containsOtherNonInteractiveFlag = commandOptions.reduce(function (memo, item) { - return (memo && - !item.includes('--abort-on-container-exit') && - !item.includes('--no-start')); - }, true); - return containsOtherNonInteractiveFlag; -}; -var upAll = function (options) { - var args = shouldUseDefaultNonInteractiveFlag(options) ? ['-d'] : []; - return (0, exports.execCompose)('up', args, options); -}; -exports.upAll = upAll; -var upMany = function (services, options) { - var args = shouldUseDefaultNonInteractiveFlag(options) - ? ['-d'].concat(services) - : services; - return (0, exports.execCompose)('up', args, options); -}; -exports.upMany = upMany; -var upOne = function (service, options) { - var args = shouldUseDefaultNonInteractiveFlag(options) - ? ['-d', service] - : [service]; - return (0, exports.execCompose)('up', args, options); -}; -exports.upOne = upOne; -var down = function (options) { - return (0, exports.execCompose)('down', [], options); -}; -exports.down = down; -var stop = function (options) { - return (0, exports.execCompose)('stop', [], options); -}; -exports.stop = stop; -var stopOne = function (service, options) { - return (0, exports.execCompose)('stop', [service], options); -}; -exports.stopOne = stopOne; -var stopMany = function (options) { - var services = []; - for (var _i = 1; _i < arguments.length; _i++) { - services[_i - 1] = arguments[_i]; - } - return (0, exports.execCompose)('stop', __spreadArray([], services, true), options); -}; -exports.stopMany = stopMany; -var pauseOne = function (service, options) { - return (0, exports.execCompose)('pause', [service], options); -}; -exports.pauseOne = pauseOne; -var unpauseOne = function (service, options) { - return (0, exports.execCompose)('unpause', [service], options); -}; -exports.unpauseOne = unpauseOne; -var kill = function (options) { - return (0, exports.execCompose)('kill', [], options); -}; -exports.kill = kill; -var rm = function (options) { - var services = []; - for (var _i = 1; _i < arguments.length; _i++) { - services[_i - 1] = arguments[_i]; - } - return (0, exports.execCompose)('rm', __spreadArray(['-f'], services, true), options); -}; -exports.rm = rm; -var exec = function (container, command, options) { - var args = Array.isArray(command) ? command : command.split(/\s+/); - return (0, exports.execCompose)('exec', ['-T', container].concat(args), options); -}; -exports.exec = exec; -var run = function (container, command, options) { - var args = Array.isArray(command) ? command : command.split(/\s+/); - return (0, exports.execCompose)('run', ['-T', container].concat(args), options); -}; -exports.run = run; -var buildAll = function (options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('build', options.parallel ? ['--parallel'] : [], options); -}; -exports.buildAll = buildAll; -var buildMany = function (services, options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('build', options.parallel ? ['--parallel'].concat(services) : services, options); -}; -exports.buildMany = buildMany; -var buildOne = function (service, options) { - return (0, exports.execCompose)('build', [service], options); -}; -exports.buildOne = buildOne; -var pullAll = function (options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('pull', [], options); -}; -exports.pullAll = pullAll; -var pullMany = function (services, options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('pull', services, options); -}; -exports.pullMany = pullMany; -var pullOne = function (service, options) { - return (0, exports.execCompose)('pull', [service], options); -}; -exports.pullOne = pullOne; -var config = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, config_1, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('config', [], options)]; - case 1: - result = _a.sent(); - config_1 = yaml_1.default.parse(result.out); - return [2 /*return*/, __assign(__assign({}, result), { data: { config: config_1 } })]; - case 2: - error_1 = _a.sent(); - return [2 /*return*/, Promise.reject(error_1)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.config = config; -var configServices = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, services, error_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('config', ['--services'], options)]; - case 1: - result = _a.sent(); - services = result.out.split('\n').filter(nonEmptyString); - return [2 /*return*/, __assign(__assign({}, result), { data: { services: services } })]; - case 2: - error_2 = _a.sent(); - return [2 /*return*/, Promise.reject(error_2)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.configServices = configServices; -var configVolumes = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, volumes, error_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('config', ['--volumes'], options)]; - case 1: - result = _a.sent(); - volumes = result.out.split('\n').filter(nonEmptyString); - return [2 /*return*/, __assign(__assign({}, result), { data: { volumes: volumes } })]; - case 2: - error_3 = _a.sent(); - return [2 /*return*/, Promise.reject(error_3)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.configVolumes = configVolumes; -var ps = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, data, error_4; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('ps', [], options)]; - case 1: - result = _a.sent(); - data = (0, exports.mapPsOutput)(result.out, options); - return [2 /*return*/, __assign(__assign({}, result), { data: data })]; - case 2: - error_4 = _a.sent(); - return [2 /*return*/, Promise.reject(error_4)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.ps = ps; -var push = function (options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('push', options.ignorePushFailures ? ['--ignore-push-failures'] : [], options); -}; -exports.push = push; -var restartAll = function (options) { - return (0, exports.execCompose)('restart', [], options); -}; -exports.restartAll = restartAll; -var restartMany = function (services, options) { - return (0, exports.execCompose)('restart', services, options); -}; -exports.restartMany = restartMany; -var restartOne = function (service, options) { - return (0, exports.restartMany)([service], options); -}; -exports.restartOne = restartOne; -var logs = function (services, options) { - if (options === void 0) { options = {}; } - var args = Array.isArray(services) ? services : [services]; - if (options.follow) { - args = __spreadArray(['--follow'], args, true); - } - return (0, exports.execCompose)('logs', args, options); -}; -exports.logs = logs; -var port = function (service, containerPort, options) { - return __awaiter(this, void 0, void 0, function () { - var args, result, _a, address, port_1, error_5; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - args = [service, containerPort]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, (0, exports.execCompose)('port', args, options)]; - case 2: - result = _b.sent(); - _a = result.out.split(':'), address = _a[0], port_1 = _a[1]; - return [2 /*return*/, __assign(__assign({}, result), { data: { - address: address, - port: Number(port_1) - } })]; - case 3: - error_5 = _b.sent(); - return [2 /*return*/, Promise.reject(error_5)]; - case 4: return [2 /*return*/]; - } - }); - }); -}; -exports.port = port; -var version = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, version_1, error_6; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('version', ['--short'], options)]; - case 1: - result = _a.sent(); - version_1 = result.out.replace('\n', '').trim(); - return [2 /*return*/, __assign(__assign({}, result), { data: { version: version_1 } })]; - case 2: - error_6 = _a.sent(); - return [2 /*return*/, Promise.reject(error_6)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.version = version; -exports.default = { - upAll: exports.upAll, - upMany: exports.upMany, - upOne: exports.upOne, - down: exports.down, - stop: exports.stop, - stopOne: exports.stopOne, - stopMany: exports.stopMany, - pauseOne: exports.pauseOne, - unpauseOne: exports.unpauseOne, - kill: exports.kill, - rm: exports.rm, - exec: exports.exec, - run: exports.run, - buildAll: exports.buildAll, - buildMany: exports.buildMany, - buildOne: exports.buildOne, - pullAll: exports.pullAll, - pullMany: exports.pullMany, - pullOne: exports.pullOne, - config: exports.config, - configServices: exports.configServices, - configVolumes: exports.configVolumes, - ps: exports.ps, - push: exports.push, - restartAll: exports.restartAll, - restartMany: exports.restartMany, - restartOne: exports.restartOne, - logs: exports.logs, - port: exports.port, - version: exports.version -}; diff --git a/node_modules/docker-compose/dist/src/map-ports.d.ts b/node_modules/docker-compose/dist/src/map-ports.d.ts deleted file mode 100644 index e21db0f..0000000 --- a/node_modules/docker-compose/dist/src/map-ports.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare const mapPorts: (ports: string) => Array<{ - mapped?: { - address: string; - port: number; - }; - exposed: { - port: number; - protocol: string; - }; -}>; -export default mapPorts; diff --git a/node_modules/docker-compose/dist/src/map-ports.js b/node_modules/docker-compose/dist/src/map-ports.js deleted file mode 100644 index 252aef7..0000000 --- a/node_modules/docker-compose/dist/src/map-ports.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var mapPorts = function (ports) { - if (!ports) { - return []; - } - return ports.split(',').map(function (untypedPort) { - var exposedFragments = untypedPort.trim().split('->'); - var _a = exposedFragments.length === 1 - ? exposedFragments[0].split('/') - : exposedFragments[1].split('/'), port = _a[0], protocol = _a[1]; - var mapped = exposedFragments[0]; - var lastDoubleColon = mapped.lastIndexOf(':'); - if (lastDoubleColon === -1) { - return { - exposed: { port: Number(port), protocol: protocol } - }; - } - var address = mapped.substr(0, lastDoubleColon); - var mappedPort = mapped.substr(lastDoubleColon + 1); - return { - exposed: { port: Number(port), protocol: protocol }, - mapped: { port: Number(mappedPort), address: address } - }; - }); -}; -exports.default = mapPorts; diff --git a/node_modules/docker-compose/dist/src/v2-map-ports.d.ts b/node_modules/docker-compose/dist/src/v2-map-ports.d.ts deleted file mode 100644 index e21db0f..0000000 --- a/node_modules/docker-compose/dist/src/v2-map-ports.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare const mapPorts: (ports: string) => Array<{ - mapped?: { - address: string; - port: number; - }; - exposed: { - port: number; - protocol: string; - }; -}>; -export default mapPorts; diff --git a/node_modules/docker-compose/dist/src/v2-map-ports.js b/node_modules/docker-compose/dist/src/v2-map-ports.js deleted file mode 100644 index 252aef7..0000000 --- a/node_modules/docker-compose/dist/src/v2-map-ports.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var mapPorts = function (ports) { - if (!ports) { - return []; - } - return ports.split(',').map(function (untypedPort) { - var exposedFragments = untypedPort.trim().split('->'); - var _a = exposedFragments.length === 1 - ? exposedFragments[0].split('/') - : exposedFragments[1].split('/'), port = _a[0], protocol = _a[1]; - var mapped = exposedFragments[0]; - var lastDoubleColon = mapped.lastIndexOf(':'); - if (lastDoubleColon === -1) { - return { - exposed: { port: Number(port), protocol: protocol } - }; - } - var address = mapped.substr(0, lastDoubleColon); - var mappedPort = mapped.substr(lastDoubleColon + 1); - return { - exposed: { port: Number(port), protocol: protocol }, - mapped: { port: Number(mappedPort), address: address } - }; - }); -}; -exports.default = mapPorts; diff --git a/node_modules/docker-compose/dist/src/v2.d.ts b/node_modules/docker-compose/dist/src/v2.d.ts deleted file mode 100644 index 1d05ac1..0000000 --- a/node_modules/docker-compose/dist/src/v2.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -/// -export interface IDockerComposeOptions { - cwd?: string; - executablePath?: string; - config?: string | string[]; - configAsString?: string; - log?: boolean; - composeOptions?: string[] | (string | string[])[]; - commandOptions?: string[] | (string | string[])[]; - env?: NodeJS.ProcessEnv; - callback?: (chunk: Buffer, streamSource?: 'stdout' | 'stderr') => void; -} -export type DockerComposePortResult = { - address: string; - port: number; -}; -export type DockerComposeVersionResult = { - version: string; -}; -export type DockerComposeConfigResult = { - config: { - version: Record; - services: Record>; - volumes: Record; - }; -}; -export type DockerComposeConfigServicesResult = { - services: string[]; -}; -export type DockerComposeConfigVolumesResult = { - volumes: string[]; -}; -export interface IDockerComposeLogOptions extends IDockerComposeOptions { - follow?: boolean; -} -export interface IDockerComposeBuildOptions extends IDockerComposeOptions { - parallel?: boolean; -} -export interface IDockerComposePushOptions extends IDockerComposeOptions { - ignorePushFailures?: boolean; -} -export interface IDockerComposeResult { - exitCode: number | null; - out: string; - err: string; -} -export type TypedDockerComposeResult = { - exitCode: number | null; - out: string; - err: string; - data: T; -}; -export type DockerComposePsResult = { - services: Array<{ - name: string; - command: string; - state: string; - ports: Array<{ - mapped?: { - address: string; - port: number; - }; - exposed: { - port: number; - protocol: string; - }; - }>; - }>; -}; -export declare const mapPsOutput: (output: string, options?: IDockerComposeOptions) => DockerComposePsResult; -/** - * Executes docker compose command with common options - */ -export declare const execCompose: (command: any, args: any, options?: IDockerComposeOptions) => Promise; -export declare const upAll: (options?: IDockerComposeOptions) => Promise; -export declare const upMany: (services: string[], options?: IDockerComposeOptions) => Promise; -export declare const upOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const down: (options?: IDockerComposeOptions) => Promise; -export declare const stop: (options?: IDockerComposeOptions) => Promise; -export declare const stopOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const stopMany: (options?: IDockerComposeOptions, ...services: string[]) => Promise; -export declare const pauseOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const unpauseOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const kill: (options?: IDockerComposeOptions) => Promise; -export declare const rm: (options?: IDockerComposeOptions, ...services: string[]) => Promise; -export declare const exec: (container: string, command: string | string[], options?: IDockerComposeOptions) => Promise; -export declare const run: (container: string, command: string | string[], options?: IDockerComposeOptions) => Promise; -export declare const buildAll: (options?: IDockerComposeBuildOptions) => Promise; -export declare const buildMany: (services: string[], options?: IDockerComposeBuildOptions) => Promise; -export declare const buildOne: (service: string, options?: IDockerComposeBuildOptions) => Promise; -export declare const pullAll: (options?: IDockerComposeOptions) => Promise; -export declare const pullMany: (services: string[], options?: IDockerComposeOptions) => Promise; -export declare const pullOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const config: (options?: IDockerComposeOptions) => Promise>; -export declare const configServices: (options?: IDockerComposeOptions) => Promise>; -export declare const configVolumes: (options?: IDockerComposeOptions) => Promise>; -export declare const ps: (options?: IDockerComposeOptions) => Promise>; -export declare const push: (options?: IDockerComposePushOptions) => Promise; -export declare const restartAll: (options?: IDockerComposeOptions) => Promise; -export declare const restartMany: (services: string[], options?: IDockerComposeOptions) => Promise; -export declare const restartOne: (service: string, options?: IDockerComposeOptions) => Promise; -export declare const logs: (services: string | string[], options?: IDockerComposeLogOptions) => Promise; -export declare const port: (service: string, containerPort: string | number, options?: IDockerComposeOptions) => Promise>; -export declare const version: (options?: IDockerComposeOptions) => Promise>; -declare const _default: { - upAll: (options?: IDockerComposeOptions | undefined) => Promise; - upMany: (services: string[], options?: IDockerComposeOptions | undefined) => Promise; - upOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - down: (options?: IDockerComposeOptions | undefined) => Promise; - stop: (options?: IDockerComposeOptions | undefined) => Promise; - stopOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - stopMany: (options?: IDockerComposeOptions | undefined, ...services: string[]) => Promise; - pauseOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - unpauseOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - kill: (options?: IDockerComposeOptions | undefined) => Promise; - rm: (options?: IDockerComposeOptions | undefined, ...services: string[]) => Promise; - exec: (container: string, command: string | string[], options?: IDockerComposeOptions | undefined) => Promise; - run: (container: string, command: string | string[], options?: IDockerComposeOptions | undefined) => Promise; - buildAll: (options?: IDockerComposeBuildOptions) => Promise; - buildMany: (services: string[], options?: IDockerComposeBuildOptions) => Promise; - buildOne: (service: string, options?: IDockerComposeBuildOptions | undefined) => Promise; - pullAll: (options?: IDockerComposeOptions) => Promise; - pullMany: (services: string[], options?: IDockerComposeOptions) => Promise; - pullOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - config: (options?: IDockerComposeOptions | undefined) => Promise>; - configServices: (options?: IDockerComposeOptions | undefined) => Promise>; - configVolumes: (options?: IDockerComposeOptions | undefined) => Promise>; - ps: (options?: IDockerComposeOptions | undefined) => Promise>; - push: (options?: IDockerComposePushOptions) => Promise; - restartAll: (options?: IDockerComposeOptions | undefined) => Promise; - restartMany: (services: string[], options?: IDockerComposeOptions | undefined) => Promise; - restartOne: (service: string, options?: IDockerComposeOptions | undefined) => Promise; - logs: (services: string | string[], options?: IDockerComposeLogOptions) => Promise; - port: (service: string, containerPort: string | number, options?: IDockerComposeOptions | undefined) => Promise>; - version: (options?: IDockerComposeOptions | undefined) => Promise>; -}; -export default _default; diff --git a/node_modules/docker-compose/dist/src/v2.js b/node_modules/docker-compose/dist/src/v2.js deleted file mode 100644 index da43cc7..0000000 --- a/node_modules/docker-compose/dist/src/v2.js +++ /dev/null @@ -1,494 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.version = exports.port = exports.logs = exports.restartOne = exports.restartMany = exports.restartAll = exports.push = exports.ps = exports.configVolumes = exports.configServices = exports.config = exports.pullOne = exports.pullMany = exports.pullAll = exports.buildOne = exports.buildMany = exports.buildAll = exports.run = exports.exec = exports.rm = exports.kill = exports.unpauseOne = exports.pauseOne = exports.stopMany = exports.stopOne = exports.stop = exports.down = exports.upOne = exports.upMany = exports.upAll = exports.execCompose = exports.mapPsOutput = void 0; -var child_process_1 = __importDefault(require("child_process")); -var yaml_1 = __importDefault(require("yaml")); -var v2_map_ports_1 = __importDefault(require("./v2-map-ports")); -var nonEmptyString = function (v) { return v !== ''; }; -var mapPsOutput = function (output, options) { - var isQuiet = false; - if (options === null || options === void 0 ? void 0 : options.commandOptions) { - isQuiet = - options.commandOptions.includes('-q') || - options.commandOptions.includes('--quiet') || - options.commandOptions.includes('--services'); - } - var services = output - .split("\n") - .filter(nonEmptyString) - .filter(function (_, index) { return isQuiet || index >= 1; }) - .map(function (line) { - var _a; - var nameFragment = line; - var commandFragment = ''; - var imageFragment = ''; - var serviceFragment = ''; - var createdFragment = ''; - var stateFragment = ''; - var untypedPortsFragment = ''; - if (!isQuiet) { - ; - _a = line.split(/\s{3,}/), nameFragment = _a[0], imageFragment = _a[1], commandFragment = _a[2], serviceFragment = _a[3], createdFragment = _a[4], stateFragment = _a[5], untypedPortsFragment = _a[6]; - } - return { - name: nameFragment.trim(), - command: commandFragment.trim(), - state: stateFragment.trim(), - ports: (0, v2_map_ports_1.default)(untypedPortsFragment.trim()) - }; - }); - return { services: services }; -}; -exports.mapPsOutput = mapPsOutput; -/** - * Converts supplied yml files to cli arguments - * https://docs.docker.com/compose/reference/overview/#use--f-to-specify-name-and-path-of-one-or-more-compose-files - */ -var configToArgs = function (config) { - if (typeof config === 'undefined') { - return []; - } - else if (typeof config === 'string') { - return ['-f', config]; - } - else if (config instanceof Array) { - return config.reduce(function (args, item) { return args.concat(['-f', item]); }, []); - } - throw new Error("Invalid argument supplied: ".concat(config)); -}; -/** - * Converts docker compose commandline options to cli arguments - */ -var composeOptionsToArgs = function (composeOptions) { - var composeArgs = []; - composeOptions.forEach(function (option) { - if (option instanceof Array) { - composeArgs = composeArgs.concat(option); - } - if (typeof option === 'string') { - composeArgs = composeArgs.concat([option]); - } - }); - return composeArgs; -}; -/** - * Executes docker compose command with common options - */ -var execCompose = function (command, args, options) { - if (options === void 0) { options = {}; } - return new Promise(function (resolve, reject) { - var composeOptions = options.composeOptions || []; - var commandOptions = options.commandOptions || []; - var composeArgs = composeOptionsToArgs(composeOptions); - var isConfigProvidedAsString = !!options.configAsString; - var configArgs = isConfigProvidedAsString - ? ['-f', '-'] - : configToArgs(options.config); - composeArgs = composeArgs.concat(configArgs.concat([command].concat(composeOptionsToArgs(commandOptions), args))); - var cwd = options.cwd; - var env = options.env || undefined; - var executablePath = options.executablePath || 'docker'; - var childProc = child_process_1.default.spawn(executablePath, __spreadArray(['compose'], composeArgs, true), { - cwd: cwd, - env: env - }); - childProc.on('error', function (err) { - reject(err); - }); - var result = { - exitCode: null, - err: '', - out: '' - }; - childProc.stdout.on('data', function (chunk) { - var _a; - result.out += chunk.toString(); - (_a = options.callback) === null || _a === void 0 ? void 0 : _a.call(options, chunk, 'stdout'); - }); - childProc.stderr.on('data', function (chunk) { - var _a; - result.err += chunk.toString(); - (_a = options.callback) === null || _a === void 0 ? void 0 : _a.call(options, chunk, 'stderr'); - }); - childProc.on('exit', function (exitCode) { - result.exitCode = exitCode; - console.log("exiting command ".concat(command)); - setTimeout(function () { - if (exitCode === 0) { - resolve(result); - } - else { - reject(result); - } - }, 500); - }); - if (isConfigProvidedAsString) { - childProc.stdin.write(options.configAsString); - childProc.stdin.end(); - } - if (options.log) { - childProc.stdout.pipe(process.stdout); - childProc.stderr.pipe(process.stderr); - } - }); -}; -exports.execCompose = execCompose; -/** - * Determines whether or not to use the default non-interactive flag -d for up commands - */ -var shouldUseDefaultNonInteractiveFlag = function (options) { - if (options === void 0) { options = {}; } - var commandOptions = options.commandOptions || []; - var containsOtherNonInteractiveFlag = commandOptions.reduce(function (memo, item) { - return (memo && - !item.includes('--abort-on-container-exit') && - !item.includes('--no-start')); - }, true); - return containsOtherNonInteractiveFlag; -}; -var upAll = function (options) { - var args = shouldUseDefaultNonInteractiveFlag(options) ? ['-d'] : []; - return (0, exports.execCompose)('up', args, options); -}; -exports.upAll = upAll; -var upMany = function (services, options) { - var args = shouldUseDefaultNonInteractiveFlag(options) - ? ['-d'].concat(services) - : services; - return (0, exports.execCompose)('up', args, options); -}; -exports.upMany = upMany; -var upOne = function (service, options) { - var args = shouldUseDefaultNonInteractiveFlag(options) - ? ['-d', service] - : [service]; - return (0, exports.execCompose)('up', args, options); -}; -exports.upOne = upOne; -var down = function (options) { - return (0, exports.execCompose)('down', [], options); -}; -exports.down = down; -var stop = function (options) { - return (0, exports.execCompose)('stop', [], options); -}; -exports.stop = stop; -var stopOne = function (service, options) { - return (0, exports.execCompose)('stop', [service], options); -}; -exports.stopOne = stopOne; -var stopMany = function (options) { - var services = []; - for (var _i = 1; _i < arguments.length; _i++) { - services[_i - 1] = arguments[_i]; - } - return (0, exports.execCompose)('stop', __spreadArray([], services, true), options); -}; -exports.stopMany = stopMany; -var pauseOne = function (service, options) { - return (0, exports.execCompose)('pause', [service], options); -}; -exports.pauseOne = pauseOne; -var unpauseOne = function (service, options) { - return (0, exports.execCompose)('unpause', [service], options); -}; -exports.unpauseOne = unpauseOne; -var kill = function (options) { - return (0, exports.execCompose)('kill', [], options); -}; -exports.kill = kill; -var rm = function (options) { - var services = []; - for (var _i = 1; _i < arguments.length; _i++) { - services[_i - 1] = arguments[_i]; - } - return (0, exports.execCompose)('rm', __spreadArray(['-f'], services, true), options); -}; -exports.rm = rm; -var exec = function (container, command, options) { - var args = Array.isArray(command) ? command : command.split(/\s+/); - return (0, exports.execCompose)('exec', ['-T', container].concat(args), options); -}; -exports.exec = exec; -var run = function (container, command, options) { - var args = Array.isArray(command) ? command : command.split(/\s+/); - return (0, exports.execCompose)('run', ['-T', container].concat(args), options); -}; -exports.run = run; -var buildAll = function (options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('build', options.parallel ? ['--parallel'] : [], options); -}; -exports.buildAll = buildAll; -var buildMany = function (services, options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('build', options.parallel ? ['--parallel'].concat(services) : services, options); -}; -exports.buildMany = buildMany; -var buildOne = function (service, options) { - return (0, exports.execCompose)('build', [service], options); -}; -exports.buildOne = buildOne; -var pullAll = function (options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('pull', [], options); -}; -exports.pullAll = pullAll; -var pullMany = function (services, options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('pull', services, options); -}; -exports.pullMany = pullMany; -var pullOne = function (service, options) { - return (0, exports.execCompose)('pull', [service], options); -}; -exports.pullOne = pullOne; -var config = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, config_1, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('config', [], options)]; - case 1: - result = _a.sent(); - config_1 = yaml_1.default.parse(result.out); - return [2 /*return*/, __assign(__assign({}, result), { data: { config: config_1 } })]; - case 2: - error_1 = _a.sent(); - return [2 /*return*/, Promise.reject(error_1)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.config = config; -var configServices = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, services, error_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('config', ['--services'], options)]; - case 1: - result = _a.sent(); - services = result.out.split('\n').filter(nonEmptyString); - return [2 /*return*/, __assign(__assign({}, result), { data: { services: services } })]; - case 2: - error_2 = _a.sent(); - return [2 /*return*/, Promise.reject(error_2)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.configServices = configServices; -var configVolumes = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, volumes, error_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('config', ['--volumes'], options)]; - case 1: - result = _a.sent(); - volumes = result.out.split('\n').filter(nonEmptyString); - return [2 /*return*/, __assign(__assign({}, result), { data: { volumes: volumes } })]; - case 2: - error_3 = _a.sent(); - return [2 /*return*/, Promise.reject(error_3)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.configVolumes = configVolumes; -var ps = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, data, error_4; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('ps', [], options)]; - case 1: - result = _a.sent(); - data = (0, exports.mapPsOutput)(result.out, options); - return [2 /*return*/, __assign(__assign({}, result), { data: data })]; - case 2: - error_4 = _a.sent(); - return [2 /*return*/, Promise.reject(error_4)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.ps = ps; -var push = function (options) { - if (options === void 0) { options = {}; } - return (0, exports.execCompose)('push', options.ignorePushFailures ? ['--ignore-push-failures'] : [], options); -}; -exports.push = push; -var restartAll = function (options) { - return (0, exports.execCompose)('restart', [], options); -}; -exports.restartAll = restartAll; -var restartMany = function (services, options) { - return (0, exports.execCompose)('restart', services, options); -}; -exports.restartMany = restartMany; -var restartOne = function (service, options) { - return (0, exports.restartMany)([service], options); -}; -exports.restartOne = restartOne; -var logs = function (services, options) { - if (options === void 0) { options = {}; } - var args = Array.isArray(services) ? services : [services]; - if (options.follow) { - args = __spreadArray(['--follow'], args, true); - } - return (0, exports.execCompose)('logs', args, options); -}; -exports.logs = logs; -var port = function (service, containerPort, options) { - return __awaiter(this, void 0, void 0, function () { - var args, result, _a, address, port_1, error_5; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - args = [service, containerPort]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, (0, exports.execCompose)('port', args, options)]; - case 2: - result = _b.sent(); - _a = result.out.split(':'), address = _a[0], port_1 = _a[1]; - return [2 /*return*/, __assign(__assign({}, result), { data: { - address: address, - port: Number(port_1) - } })]; - case 3: - error_5 = _b.sent(); - return [2 /*return*/, Promise.reject(error_5)]; - case 4: return [2 /*return*/]; - } - }); - }); -}; -exports.port = port; -var version = function (options) { - return __awaiter(this, void 0, void 0, function () { - var result, version_1, error_6; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, exports.execCompose)('version', ['--short'], options)]; - case 1: - result = _a.sent(); - version_1 = result.out.replace('\n', '').trim(); - return [2 /*return*/, __assign(__assign({}, result), { data: { version: version_1 } })]; - case 2: - error_6 = _a.sent(); - return [2 /*return*/, Promise.reject(error_6)]; - case 3: return [2 /*return*/]; - } - }); - }); -}; -exports.version = version; -exports.default = { - upAll: exports.upAll, - upMany: exports.upMany, - upOne: exports.upOne, - down: exports.down, - stop: exports.stop, - stopOne: exports.stopOne, - stopMany: exports.stopMany, - pauseOne: exports.pauseOne, - unpauseOne: exports.unpauseOne, - kill: exports.kill, - rm: exports.rm, - exec: exports.exec, - run: exports.run, - buildAll: exports.buildAll, - buildMany: exports.buildMany, - buildOne: exports.buildOne, - pullAll: exports.pullAll, - pullMany: exports.pullMany, - pullOne: exports.pullOne, - config: exports.config, - configServices: exports.configServices, - configVolumes: exports.configVolumes, - ps: exports.ps, - push: exports.push, - restartAll: exports.restartAll, - restartMany: exports.restartMany, - restartOne: exports.restartOne, - logs: exports.logs, - port: exports.port, - version: exports.version -}; diff --git a/node_modules/docker-compose/dist/v2.d.ts b/node_modules/docker-compose/dist/v2.d.ts index 1d05ac1..247426c 100644 --- a/node_modules/docker-compose/dist/v2.d.ts +++ b/node_modules/docker-compose/dist/v2.d.ts @@ -50,23 +50,24 @@ export type TypedDockerComposeResult = { err: string; data: T; }; -export type DockerComposePsResult = { - services: Array<{ - name: string; - command: string; - state: string; - ports: Array<{ - mapped?: { - address: string; - port: number; - }; - exposed: { - port: number; - protocol: string; - }; - }>; +export type DockerComposePsResultService = { + name: string; + command: string; + state: string; + ports: Array<{ + mapped?: { + address: string; + port: number; + }; + exposed: { + port: number; + protocol: string; + }; }>; }; +export type DockerComposePsResult = { + services: Array; +}; export declare const mapPsOutput: (output: string, options?: IDockerComposeOptions) => DockerComposePsResult; /** * Executes docker compose command with common options diff --git a/node_modules/docker-compose/dist/v2.js b/node_modules/docker-compose/dist/v2.js index fe936e1..a6b9c04 100644 --- a/node_modules/docker-compose/dist/v2.js +++ b/node_modules/docker-compose/dist/v2.js @@ -64,30 +64,50 @@ var child_process_1 = __importDefault(require("child_process")); var yaml_1 = __importDefault(require("yaml")); var v2_map_ports_1 = __importDefault(require("./v2-map-ports")); var nonEmptyString = function (v) { return v !== ''; }; +var arrayIncludesTuple = function (arr, tuple) { + return arr.some(function (subArray) { + return Array.isArray(subArray) && + subArray.length === tuple.length && + subArray.every(function (value, index) { return value === tuple[index]; }); + }); +}; var mapPsOutput = function (output, options) { var isQuiet = false; + var isJson = false; if (options === null || options === void 0 ? void 0 : options.commandOptions) { isQuiet = options.commandOptions.includes('-q') || options.commandOptions.includes('--quiet') || options.commandOptions.includes('--services'); + isJson = arrayIncludesTuple(options.commandOptions, ['--format', 'json']); } var services = output .split("\n") .filter(nonEmptyString) - .filter(function (_, index) { return isQuiet || index >= 1; }) + .filter(function (_, index) { return isQuiet || isJson || index >= 1; }) .map(function (line) { - var _a; var nameFragment = line; var commandFragment = ''; - var imageFragment = ''; - var serviceFragment = ''; - var createdFragment = ''; var stateFragment = ''; var untypedPortsFragment = ''; if (!isQuiet) { - ; - _a = line.split(/\s{3,}/), nameFragment = _a[0], imageFragment = _a[1], commandFragment = _a[2], serviceFragment = _a[3], createdFragment = _a[4], stateFragment = _a[5], untypedPortsFragment = _a[6]; + if (isJson) { + var serviceLine = JSON.parse(line); + nameFragment = serviceLine.Name; + commandFragment = serviceLine.Command; + stateFragment = serviceLine.State; + untypedPortsFragment = serviceLine.Ports; + } + else { + var lineColumns = line.split(/\s{3,}/); + // the line has the columns in the following order: + // NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS + // @see https://docs.docker.com/engine/reference/commandline/compose_ps/#description + nameFragment = lineColumns[0]; + commandFragment = lineColumns[2]; + stateFragment = lineColumns[5]; + untypedPortsFragment = lineColumns[6]; + } } return { name: nameFragment.trim(), diff --git a/node_modules/docker-compose/package.json b/node_modules/docker-compose/package.json index 0464ddc..3081aa1 100644 --- a/node_modules/docker-compose/package.json +++ b/node_modules/docker-compose/package.json @@ -1,22 +1,25 @@ { "name": "docker-compose", - "version": "0.24.1", + "version": "0.24.3", "main": "dist/index.js", "typings": "dist/index.d.ts", "types": "dist/index.d.ts", "scripts": { + "ci": "yarn install --frozen-lockfile", "test-v1": "npx vitest --dir test/v1 --test-timeout=30000", "test-v2": "npx vitest --dir test/v2 --test-timeout=30000", "lint": "eslint src/**/*.ts test/**/*.ts", "build": "tsc", "prepublishOnly": "tsc", "release": "yarn build && standard-version", - "docs:dev": "vuepress dev docs", - "docs:build": "vuepress build docs" + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs" }, "repository": { "url": "git@github.com:PDMLab/docker-compose.git" }, + "homepage": "https://pdmlab.github.io/docker-compose/", "keywords": [ "devops", "devops-tools", @@ -98,8 +101,8 @@ "prettier": "^2.2.1", "standard-version": "9.3.1", "typescript": "^4.9.5", - "vitest": "^0.30.1", - "vuepress": "^2.0.0-beta.7" + "vitepress": "^1.0.0-alpha.76", + "vitest": "^0.30.1" }, "engines": { "node": ">= 6.0.0" diff --git a/node_modules/docker-compose/readme.md b/node_modules/docker-compose/readme.md index f78d1de..1f46169 100644 --- a/node_modules/docker-compose/readme.md +++ b/node_modules/docker-compose/readme.md @@ -1,5 +1,5 @@ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) -[![Discord](https://img.shields.io/discord/1070453198000767076)](https://discord.gg/dKWyyv6M) +[![Discord](https://img.shields.io/discord/1070453198000767076)](https://discord.gg/pR6duvNHtV) @@ -84,6 +84,26 @@ To execute command inside a running container compose.exec('node', 'npm install', { cwd: path.join(__dirname) }) ``` +To list the containers for a compose project + +```javascript +const result = await compose.ps({ cwd: path.join(__dirname) }) +result.data.services.forEach((service) => { + console.log(service.name, service.command, service.state, service.ports) + // state is e.g. 'Up 2 hours' +}) +``` + +The docker-compose v2 version also support the `--format json` command option to get a better state support: + +```javascript +const result = await compose.ps({ cwd: path.join(__dirname), commandOptions: [["--format", "json"]] }) +result.data.services.forEach((service) => { + console.log(service.name, service.command, service.state, service.ports) + // state is one of the defined states: paused | restarting | removing | running | dead | created | exited +}) +``` + ## Known issues with v2 support * During testing we noticed that `docker compose` seems to send it's exit code also commands don't seem to have finished. This doesn't occur for all commands, but for example with `stop` or `down`. We had the option to wait for stopped / removed containers using third party libraries but this would make bootstrapping `docker-compose` much more complicated for the users. So we decided to use a `setTimeout(500)` workaround. We're aware this is not perfect but it seems to be the most appropriate solution for now. Details can be found in the [v2 PR discussion](https://github.com/PDMLab/docker-compose/pull/228#issuecomment-1422895821) (we're happy to get help here). diff --git a/node_modules/docker-compose/src/index.ts b/node_modules/docker-compose/src/index.ts deleted file mode 100644 index 04ddd69..0000000 --- a/node_modules/docker-compose/src/index.ts +++ /dev/null @@ -1,565 +0,0 @@ -import childProcess from 'child_process' -import yaml from 'yaml' -import mapPorts from './map-ports' - -export interface IDockerComposeOptions { - cwd?: string - executablePath?: string - config?: string | string[] - configAsString?: string - log?: boolean - composeOptions?: string[] | (string | string[])[] - commandOptions?: string[] | (string | string[])[] - env?: NodeJS.ProcessEnv - callback?: (chunk: Buffer, streamSource?: 'stdout' | 'stderr') => void -} - -export type DockerComposePortResult = { - address: string - port: number -} - -export type DockerComposeVersionResult = { - version: string -} - -export type DockerComposeConfigResult = { - config: { - version: Record - services: Record> - volumes: Record - } -} - -export type DockerComposeConfigServicesResult = { - services: string[] -} - -export type DockerComposeConfigVolumesResult = { - volumes: string[] -} - -export interface IDockerComposeLogOptions extends IDockerComposeOptions { - follow?: boolean -} - -export interface IDockerComposeBuildOptions extends IDockerComposeOptions { - parallel?: boolean -} - -export interface IDockerComposePushOptions extends IDockerComposeOptions { - ignorePushFailures?: boolean -} - -export interface IDockerComposeResult { - exitCode: number | null - out: string - err: string -} - -export type TypedDockerComposeResult = { - exitCode: number | null - out: string - err: string - data: T -} - -const nonEmptyString = (v: string) => v !== '' - -export type DockerComposePsResult = { - services: Array<{ - name: string - command: string - state: string - ports: Array<{ - mapped?: { address: string; port: number } - exposed: { port: number; protocol: string } - }> - }> -} - -export const mapPsOutput = ( - output: string, - options?: IDockerComposeOptions -): DockerComposePsResult => { - let isQuiet = false - if (options?.commandOptions) { - isQuiet = - options.commandOptions.includes('-q') || - options.commandOptions.includes('--quiet') || - options.commandOptions.includes('--services') - } - const services = output - .split(`\n`) - .filter(nonEmptyString) - .filter((_, index) => isQuiet || index > 1) - .map((line) => { - let nameFragment = line - let commandFragment = '' - let stateFragment = '' - let untypedPortsFragment = '' - if (!isQuiet) { - ;[ - nameFragment, - commandFragment, - stateFragment, - untypedPortsFragment - ] = line.split(/\s{3,}/) - } - return { - name: nameFragment.trim(), - command: commandFragment.trim(), - state: stateFragment.trim(), - ports: mapPorts(untypedPortsFragment.trim()) - } - }) - return { services } -} - -/** - * Converts supplied yml files to cli arguments - * https://docs.docker.com/compose/reference/overview/#use--f-to-specify-name-and-path-of-one-or-more-compose-files - */ -const configToArgs = (config): string[] => { - if (typeof config === 'undefined') { - return [] - } else if (typeof config === 'string') { - return ['-f', config] - } else if (config instanceof Array) { - return config.reduce( - (args, item): string[] => args.concat(['-f', item]), - [] - ) - } - throw new Error(`Invalid argument supplied: ${config}`) -} - -/** - * Converts docker-compose commandline options to cli arguments - */ -const composeOptionsToArgs = (composeOptions): string[] => { - let composeArgs: string[] = [] - - composeOptions.forEach((option: string[] | string): void => { - if (option instanceof Array) { - composeArgs = composeArgs.concat(option) - } - if (typeof option === 'string') { - composeArgs = composeArgs.concat([option]) - } - }) - - return composeArgs -} - -/** - * Executes docker-compose command with common options - */ -export const execCompose = ( - command, - args, - options: IDockerComposeOptions = {} -): Promise => - new Promise((resolve, reject): void => { - const composeOptions = options.composeOptions || [] - const commandOptions = options.commandOptions || [] - let composeArgs = composeOptionsToArgs(composeOptions) - const isConfigProvidedAsString = !!options.configAsString - - const configArgs = isConfigProvidedAsString - ? ['-f', '-'] - : configToArgs(options.config) - - composeArgs = composeArgs.concat( - configArgs.concat( - [command].concat(composeOptionsToArgs(commandOptions), args) - ) - ) - - const cwd = options.cwd - const env = options.env || undefined - const executablePath = options.executablePath || 'docker-compose' - - const childProc = childProcess.spawn(executablePath, composeArgs, { - cwd, - env - }) - - childProc.on('error', (err): void => { - reject(err) - }) - - const result: IDockerComposeResult = { - exitCode: null, - err: '', - out: '' - } - - childProc.stdout.on('data', (chunk): void => { - result.out += chunk.toString() - options.callback?.(chunk, 'stdout') - }) - - childProc.stderr.on('data', (chunk): void => { - result.err += chunk.toString() - options.callback?.(chunk, 'stderr') - }) - - childProc.on('exit', (exitCode): void => { - result.exitCode = exitCode - if (exitCode === 0) { - resolve(result) - } else { - reject(result) - } - }) - - if (isConfigProvidedAsString) { - childProc.stdin.write(options.configAsString) - childProc.stdin.end() - } - - if (options.log) { - childProc.stdout.pipe(process.stdout) - childProc.stderr.pipe(process.stderr) - } - }) - -/** - * Determines whether or not to use the default non-interactive flag -d for up commands - */ -const shouldUseDefaultNonInteractiveFlag = function ( - options: IDockerComposeOptions = {} -): boolean { - const commandOptions = options.commandOptions || [] - const containsOtherNonInteractiveFlag = commandOptions.reduce( - (memo: boolean, item: string | string[]) => { - return ( - memo && - !item.includes('--abort-on-container-exit') && - !item.includes('--no-start') - ) - }, - true - ) - return containsOtherNonInteractiveFlag -} - -export const upAll = function ( - options?: IDockerComposeOptions -): Promise { - const args = shouldUseDefaultNonInteractiveFlag(options) ? ['-d'] : [] - return execCompose('up', args, options) -} - -export const upMany = function ( - services: string[], - options?: IDockerComposeOptions -): Promise { - const args = shouldUseDefaultNonInteractiveFlag(options) - ? ['-d'].concat(services) - : services - return execCompose('up', args, options) -} - -export const upOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - const args = shouldUseDefaultNonInteractiveFlag(options) - ? ['-d', service] - : [service] - return execCompose('up', args, options) -} - -export const down = function ( - options?: IDockerComposeOptions -): Promise { - return execCompose('down', [], options) -} - -export const stop = function ( - options?: IDockerComposeOptions -): Promise { - return execCompose('stop', [], options) -} - -export const stopOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return execCompose('stop', [service], options) -} - -export const stopMany = function ( - options?: IDockerComposeOptions, - ...services: string[] -): Promise { - return execCompose('stop', [...services], options) -} - -export const pauseOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return execCompose('pause', [service], options) -} - -export const unpauseOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return execCompose('unpause', [service], options) -} - -export const kill = function ( - options?: IDockerComposeOptions -): Promise { - return execCompose('kill', [], options) -} - -export const rm = function ( - options?: IDockerComposeOptions, - ...services: string[] -): Promise { - return execCompose('rm', ['-f', ...services], options) -} - -export const exec = function ( - container: string, - command: string | string[], - options?: IDockerComposeOptions -): Promise { - const args = Array.isArray(command) ? command : command.split(/\s+/) - - return execCompose('exec', ['-T', container].concat(args), options) -} - -export const run = function ( - container: string, - command: string | string[], - options?: IDockerComposeOptions -): Promise { - const args = Array.isArray(command) ? command : command.split(/\s+/) - - return execCompose('run', ['-T', container].concat(args), options) -} - -export const buildAll = function ( - options: IDockerComposeBuildOptions = {} -): Promise { - return execCompose('build', options.parallel ? ['--parallel'] : [], options) -} - -export const buildMany = function ( - services: string[], - options: IDockerComposeBuildOptions = {} -): Promise { - return execCompose( - 'build', - options.parallel ? ['--parallel'].concat(services) : services, - options - ) -} - -export const buildOne = function ( - service: string, - options?: IDockerComposeBuildOptions -): Promise { - return execCompose('build', [service], options) -} - -export const pullAll = function ( - options: IDockerComposeOptions = {} -): Promise { - return execCompose('pull', [], options) -} - -export const pullMany = function ( - services: string[], - options: IDockerComposeOptions = {} -): Promise { - return execCompose('pull', services, options) -} - -export const pullOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return execCompose('pull', [service], options) -} - -export const config = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('config', [], options) - const config = yaml.parse(result.out) - return { - ...result, - data: { config } - } - } catch (error) { - return Promise.reject(error) - } -} - -export const configServices = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('config', ['--services'], options) - const services = result.out.split('\n').filter(nonEmptyString) - return { - ...result, - data: { services } - } - } catch (error) { - return Promise.reject(error) - } -} - -export const configVolumes = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('config', ['--volumes'], options) - const volumes = result.out.split('\n').filter(nonEmptyString) - return { - ...result, - data: { volumes } - } - } catch (error) { - return Promise.reject(error) - } -} - -export const ps = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('ps', [], options) - const data = mapPsOutput(result.out, options) - return { - ...result, - data - } - } catch (error) { - return Promise.reject(error) - } -} - -export const push = function ( - options: IDockerComposePushOptions = {} -): Promise { - return execCompose( - 'push', - options.ignorePushFailures ? ['--ignore-push-failures'] : [], - options - ) -} - -export const restartAll = function ( - options?: IDockerComposeOptions -): Promise { - return execCompose('restart', [], options) -} - -export const restartMany = function ( - services: string[], - options?: IDockerComposeOptions -): Promise { - return execCompose('restart', services, options) -} - -export const restartOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return restartMany([service], options) -} - -export const logs = function ( - services: string | string[], - options: IDockerComposeLogOptions = {} -): Promise { - let args = Array.isArray(services) ? services : [services] - - if (options.follow) { - args = ['--follow', ...args] - } - - return execCompose('logs', args, options) -} - -export const port = async function ( - service: string, - containerPort: string | number, - options?: IDockerComposeOptions -): Promise> { - const args = [service, containerPort] - - try { - const result = await execCompose('port', args, options) - const [address, port] = result.out.split(':') - return { - ...result, - data: { - address, - port: Number(port) - } - } - } catch (error) { - return Promise.reject(error) - } -} - -export const version = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('version', ['--short'], options) - const version = result.out.replace('\n', '').trim() - return { - ...result, - data: { version } - } - } catch (error) { - return Promise.reject(error) - } -} - -export default { - upAll, - upMany, - upOne, - down, - stop, - stopOne, - stopMany, - pauseOne, - unpauseOne, - kill, - rm, - exec, - run, - buildAll, - buildMany, - buildOne, - pullAll, - pullMany, - pullOne, - config, - configServices, - configVolumes, - ps, - push, - restartAll, - restartMany, - restartOne, - logs, - port, - version -} - -export * as v2 from './v2' diff --git a/node_modules/docker-compose/src/map-ports.ts b/node_modules/docker-compose/src/map-ports.ts deleted file mode 100644 index 417169c..0000000 --- a/node_modules/docker-compose/src/map-ports.ts +++ /dev/null @@ -1,38 +0,0 @@ -const mapPorts = ( - ports: string -): Array<{ - mapped?: { address: string; port: number } - exposed: { port: number; protocol: string } -}> => { - if (!ports) { - return [] - } - - return ports.split(',').map((untypedPort) => { - const exposedFragments = untypedPort.trim().split('->') - - const [port, protocol] = - exposedFragments.length === 1 - ? exposedFragments[0].split('/') - : exposedFragments[1].split('/') - - const mapped = exposedFragments[0] - const lastDoubleColon = mapped.lastIndexOf(':') - - if (lastDoubleColon === -1) { - return { - exposed: { port: Number(port), protocol } - } - } - - const address = mapped.substr(0, lastDoubleColon) - const mappedPort = mapped.substr(lastDoubleColon + 1) - - return { - exposed: { port: Number(port), protocol }, - mapped: { port: Number(mappedPort), address } - } - }) -} - -export default mapPorts diff --git a/node_modules/docker-compose/src/v2-map-ports.ts b/node_modules/docker-compose/src/v2-map-ports.ts deleted file mode 100644 index 417169c..0000000 --- a/node_modules/docker-compose/src/v2-map-ports.ts +++ /dev/null @@ -1,38 +0,0 @@ -const mapPorts = ( - ports: string -): Array<{ - mapped?: { address: string; port: number } - exposed: { port: number; protocol: string } -}> => { - if (!ports) { - return [] - } - - return ports.split(',').map((untypedPort) => { - const exposedFragments = untypedPort.trim().split('->') - - const [port, protocol] = - exposedFragments.length === 1 - ? exposedFragments[0].split('/') - : exposedFragments[1].split('/') - - const mapped = exposedFragments[0] - const lastDoubleColon = mapped.lastIndexOf(':') - - if (lastDoubleColon === -1) { - return { - exposed: { port: Number(port), protocol } - } - } - - const address = mapped.substr(0, lastDoubleColon) - const mappedPort = mapped.substr(lastDoubleColon + 1) - - return { - exposed: { port: Number(port), protocol }, - mapped: { port: Number(mappedPort), address } - } - }) -} - -export default mapPorts diff --git a/node_modules/docker-compose/src/v2.ts b/node_modules/docker-compose/src/v2.ts deleted file mode 100644 index 48fd670..0000000 --- a/node_modules/docker-compose/src/v2.ts +++ /dev/null @@ -1,575 +0,0 @@ -import childProcess from 'child_process' -import yaml from 'yaml' -import mapPorts from './v2-map-ports' - -export interface IDockerComposeOptions { - cwd?: string - executablePath?: string - config?: string | string[] - configAsString?: string - log?: boolean - composeOptions?: string[] | (string | string[])[] - commandOptions?: string[] | (string | string[])[] - env?: NodeJS.ProcessEnv - callback?: (chunk: Buffer, streamSource?: 'stdout' | 'stderr') => void -} - -export type DockerComposePortResult = { - address: string - port: number -} - -export type DockerComposeVersionResult = { - version: string -} - -export type DockerComposeConfigResult = { - config: { - version: Record - services: Record> - volumes: Record - } -} - -export type DockerComposeConfigServicesResult = { - services: string[] -} - -export type DockerComposeConfigVolumesResult = { - volumes: string[] -} - -export interface IDockerComposeLogOptions extends IDockerComposeOptions { - follow?: boolean -} - -export interface IDockerComposeBuildOptions extends IDockerComposeOptions { - parallel?: boolean -} - -export interface IDockerComposePushOptions extends IDockerComposeOptions { - ignorePushFailures?: boolean -} - -export interface IDockerComposeResult { - exitCode: number | null - out: string - err: string -} - -export type TypedDockerComposeResult = { - exitCode: number | null - out: string - err: string - data: T -} - -const nonEmptyString = (v: string) => v !== '' - -export type DockerComposePsResult = { - services: Array<{ - name: string - command: string - state: string - ports: Array<{ - mapped?: { address: string; port: number } - exposed: { port: number; protocol: string } - }> - }> -} - -export const mapPsOutput = ( - output: string, - options?: IDockerComposeOptions -): DockerComposePsResult => { - let isQuiet = false - if (options?.commandOptions) { - isQuiet = - options.commandOptions.includes('-q') || - options.commandOptions.includes('--quiet') || - options.commandOptions.includes('--services') - } - const services = output - .split(`\n`) - .filter(nonEmptyString) - .filter((_, index) => isQuiet || index >= 1) - .map((line) => { - let nameFragment = line - let commandFragment = '' - let imageFragment = '' - let serviceFragment = '' - let createdFragment = '' - let stateFragment = '' - let untypedPortsFragment = '' - if (!isQuiet) { - ;[ - nameFragment, - imageFragment, - commandFragment, - serviceFragment, - createdFragment, - stateFragment, - untypedPortsFragment - ] = line.split(/\s{3,}/) - } - return { - name: nameFragment.trim(), - command: commandFragment.trim(), - state: stateFragment.trim(), - ports: mapPorts(untypedPortsFragment.trim()) - } - }) - return { services } -} - -/** - * Converts supplied yml files to cli arguments - * https://docs.docker.com/compose/reference/overview/#use--f-to-specify-name-and-path-of-one-or-more-compose-files - */ -const configToArgs = (config): string[] => { - if (typeof config === 'undefined') { - return [] - } else if (typeof config === 'string') { - return ['-f', config] - } else if (config instanceof Array) { - return config.reduce( - (args, item): string[] => args.concat(['-f', item]), - [] - ) - } - throw new Error(`Invalid argument supplied: ${config}`) -} - -/** - * Converts docker compose commandline options to cli arguments - */ -const composeOptionsToArgs = (composeOptions): string[] => { - let composeArgs: string[] = [] - - composeOptions.forEach((option: string[] | string): void => { - if (option instanceof Array) { - composeArgs = composeArgs.concat(option) - } - if (typeof option === 'string') { - composeArgs = composeArgs.concat([option]) - } - }) - - return composeArgs -} - -/** - * Executes docker compose command with common options - */ -export const execCompose = ( - command, - args, - options: IDockerComposeOptions = {} -): Promise => - new Promise((resolve, reject): void => { - const composeOptions = options.composeOptions || [] - const commandOptions = options.commandOptions || [] - let composeArgs = composeOptionsToArgs(composeOptions) - const isConfigProvidedAsString = !!options.configAsString - - const configArgs = isConfigProvidedAsString - ? ['-f', '-'] - : configToArgs(options.config) - - composeArgs = composeArgs.concat( - configArgs.concat( - [command].concat(composeOptionsToArgs(commandOptions), args) - ) - ) - - const cwd = options.cwd - const env = options.env || undefined - const executablePath = options.executablePath || 'docker' - - const childProc = childProcess.spawn( - executablePath, - ['compose', ...composeArgs], - { - cwd, - env - } - ) - - childProc.on('error', (err): void => { - reject(err) - }) - - const result: IDockerComposeResult = { - exitCode: null, - err: '', - out: '' - } - - childProc.stdout.on('data', (chunk): void => { - result.out += chunk.toString() - options.callback?.(chunk, 'stdout') - }) - - childProc.stderr.on('data', (chunk): void => { - result.err += chunk.toString() - options.callback?.(chunk, 'stderr') - }) - - childProc.on('exit', (exitCode): void => { - result.exitCode = exitCode - setTimeout(() => { - if (exitCode === 0) { - resolve(result) - } else { - reject(result) - } - }, 500) - }) - - if (isConfigProvidedAsString) { - childProc.stdin.write(options.configAsString) - childProc.stdin.end() - } - - if (options.log) { - childProc.stdout.pipe(process.stdout) - childProc.stderr.pipe(process.stderr) - } - }) - -/** - * Determines whether or not to use the default non-interactive flag -d for up commands - */ -const shouldUseDefaultNonInteractiveFlag = function ( - options: IDockerComposeOptions = {} -): boolean { - const commandOptions = options.commandOptions || [] - const containsOtherNonInteractiveFlag = commandOptions.reduce( - (memo: boolean, item: string | string[]) => { - return ( - memo && - !item.includes('--abort-on-container-exit') && - !item.includes('--no-start') - ) - }, - true - ) - return containsOtherNonInteractiveFlag -} - -export const upAll = function ( - options?: IDockerComposeOptions -): Promise { - const args = shouldUseDefaultNonInteractiveFlag(options) ? ['-d'] : [] - return execCompose('up', args, options) -} - -export const upMany = function ( - services: string[], - options?: IDockerComposeOptions -): Promise { - const args = shouldUseDefaultNonInteractiveFlag(options) - ? ['-d'].concat(services) - : services - return execCompose('up', args, options) -} - -export const upOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - const args = shouldUseDefaultNonInteractiveFlag(options) - ? ['-d', service] - : [service] - return execCompose('up', args, options) -} - -export const down = function ( - options?: IDockerComposeOptions -): Promise { - return execCompose('down', [], options) -} - -export const stop = function ( - options?: IDockerComposeOptions -): Promise { - return execCompose('stop', [], options) -} - -export const stopOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return execCompose('stop', [service], options) -} - -export const stopMany = function ( - options?: IDockerComposeOptions, - ...services: string[] -): Promise { - return execCompose('stop', [...services], options) -} - -export const pauseOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return execCompose('pause', [service], options) -} - -export const unpauseOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return execCompose('unpause', [service], options) -} - -export const kill = function ( - options?: IDockerComposeOptions -): Promise { - return execCompose('kill', [], options) -} - -export const rm = function ( - options?: IDockerComposeOptions, - ...services: string[] -): Promise { - return execCompose('rm', ['-f', ...services], options) -} - -export const exec = function ( - container: string, - command: string | string[], - options?: IDockerComposeOptions -): Promise { - const args = Array.isArray(command) ? command : command.split(/\s+/) - - return execCompose('exec', ['-T', container].concat(args), options) -} - -export const run = function ( - container: string, - command: string | string[], - options?: IDockerComposeOptions -): Promise { - const args = Array.isArray(command) ? command : command.split(/\s+/) - - return execCompose('run', ['-T', container].concat(args), options) -} - -export const buildAll = function ( - options: IDockerComposeBuildOptions = {} -): Promise { - return execCompose('build', options.parallel ? ['--parallel'] : [], options) -} - -export const buildMany = function ( - services: string[], - options: IDockerComposeBuildOptions = {} -): Promise { - return execCompose( - 'build', - options.parallel ? ['--parallel'].concat(services) : services, - options - ) -} - -export const buildOne = function ( - service: string, - options?: IDockerComposeBuildOptions -): Promise { - return execCompose('build', [service], options) -} - -export const pullAll = function ( - options: IDockerComposeOptions = {} -): Promise { - return execCompose('pull', [], options) -} - -export const pullMany = function ( - services: string[], - options: IDockerComposeOptions = {} -): Promise { - return execCompose('pull', services, options) -} - -export const pullOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return execCompose('pull', [service], options) -} - -export const config = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('config', [], options) - const config = yaml.parse(result.out) - return { - ...result, - data: { config } - } - } catch (error) { - return Promise.reject(error) - } -} - -export const configServices = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('config', ['--services'], options) - const services = result.out.split('\n').filter(nonEmptyString) - return { - ...result, - data: { services } - } - } catch (error) { - return Promise.reject(error) - } -} - -export const configVolumes = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('config', ['--volumes'], options) - const volumes = result.out.split('\n').filter(nonEmptyString) - return { - ...result, - data: { volumes } - } - } catch (error) { - return Promise.reject(error) - } -} - -export const ps = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('ps', [], options) - const data = mapPsOutput(result.out, options) - return { - ...result, - data - } - } catch (error) { - return Promise.reject(error) - } -} - -export const push = function ( - options: IDockerComposePushOptions = {} -): Promise { - return execCompose( - 'push', - options.ignorePushFailures ? ['--ignore-push-failures'] : [], - options - ) -} - -export const restartAll = function ( - options?: IDockerComposeOptions -): Promise { - return execCompose('restart', [], options) -} - -export const restartMany = function ( - services: string[], - options?: IDockerComposeOptions -): Promise { - return execCompose('restart', services, options) -} - -export const restartOne = function ( - service: string, - options?: IDockerComposeOptions -): Promise { - return restartMany([service], options) -} - -export const logs = function ( - services: string | string[], - options: IDockerComposeLogOptions = {} -): Promise { - let args = Array.isArray(services) ? services : [services] - - if (options.follow) { - args = ['--follow', ...args] - } - - return execCompose('logs', args, options) -} - -export const port = async function ( - service: string, - containerPort: string | number, - options?: IDockerComposeOptions -): Promise> { - const args = [service, containerPort] - - try { - const result = await execCompose('port', args, options) - const [address, port] = result.out.split(':') - return { - ...result, - data: { - address, - port: Number(port) - } - } - } catch (error) { - return Promise.reject(error) - } -} - -export const version = async function ( - options?: IDockerComposeOptions -): Promise> { - try { - const result = await execCompose('version', ['--short'], options) - const version = result.out.replace('\n', '').trim() - return { - ...result, - data: { version } - } - } catch (error) { - return Promise.reject(error) - } -} - -export default { - upAll, - upMany, - upOne, - down, - stop, - stopOne, - stopMany, - pauseOne, - unpauseOne, - kill, - rm, - exec, - run, - buildAll, - buildMany, - buildOne, - pullAll, - pullMany, - pullOne, - config, - configServices, - configVolumes, - ps, - push, - restartAll, - restartMany, - restartOne, - logs, - port, - version -} diff --git a/node_modules/docker-compose/tsconfig.json b/node_modules/docker-compose/tsconfig.json index 93838df..429cbf3 100644 --- a/node_modules/docker-compose/tsconfig.json +++ b/node_modules/docker-compose/tsconfig.json @@ -5,7 +5,8 @@ "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, "lib": [ - "es2015" + "es2015", + "dom" ] /* Specify library files to be included in the compilation. */, // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ diff --git a/node_modules/eslint-plugin-prettier/node_modules/.bin/eslint b/node_modules/eslint-plugin-prettier/node_modules/.bin/eslint new file mode 120000 index 0000000..fad93f5 --- /dev/null +++ b/node_modules/eslint-plugin-prettier/node_modules/.bin/eslint @@ -0,0 +1 @@ +../../../eslint/bin/eslint.js \ No newline at end of file diff --git a/node_modules/eslint-plugin-prettier/node_modules/.bin/prettier b/node_modules/eslint-plugin-prettier/node_modules/.bin/prettier new file mode 120000 index 0000000..60fde4f --- /dev/null +++ b/node_modules/eslint-plugin-prettier/node_modules/.bin/prettier @@ -0,0 +1 @@ +../../../prettier/bin-prettier.js \ No newline at end of file diff --git a/node_modules/espree/node_modules/.bin/acorn b/node_modules/espree/node_modules/.bin/acorn new file mode 120000 index 0000000..fa65fee --- /dev/null +++ b/node_modules/espree/node_modules/.bin/acorn @@ -0,0 +1 @@ +../../../acorn/bin/acorn \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4bdd541..3722f8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@actions/core": "^1.8.2", "@actions/github": "^4.0.0", - "docker-compose": "^0.24.0" + "docker-compose": "^0.24.3" }, "devDependencies": { "eslint": "^8.24.0", @@ -470,9 +470,9 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, "node_modules/docker-compose": { - "version": "0.24.1", - "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.24.1.tgz", - "integrity": "sha512-CVphzCi0Hmw/0CHlAzgiwhLsJjFRqnvpBYMYbf63bz6MON69ElgrfrgQTmgPtEjbifjgaptu3+Gea62vI+9jiA==", + "version": "0.24.3", + "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.24.3.tgz", + "integrity": "sha512-x3/QN3AIOMe7j2c8f/jcycizMft7dl8MluoB9OGPAYCyKHHiPUFqI9GjCcsU0kYy24vYKMCcfR6+5ZaEyQlrxg==", "dependencies": { "yaml": "^2.2.2" }, @@ -1777,9 +1777,9 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, "docker-compose": { - "version": "0.24.1", - "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.24.1.tgz", - "integrity": "sha512-CVphzCi0Hmw/0CHlAzgiwhLsJjFRqnvpBYMYbf63bz6MON69ElgrfrgQTmgPtEjbifjgaptu3+Gea62vI+9jiA==", + "version": "0.24.3", + "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.24.3.tgz", + "integrity": "sha512-x3/QN3AIOMe7j2c8f/jcycizMft7dl8MluoB9OGPAYCyKHHiPUFqI9GjCcsU0kYy24vYKMCcfR6+5ZaEyQlrxg==", "requires": { "yaml": "^2.2.2" } diff --git a/package.json b/package.json index debc4b0..70ecf13 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "dependencies": { "@actions/core": "^1.8.2", "@actions/github": "^4.0.0", - "docker-compose": "^0.24.0" + "docker-compose": "^0.24.3" }, "devDependencies": { "eslint": "^8.24.0", diff --git a/post.js b/post.js index 0720c9a..a7e5774 100644 --- a/post.js +++ b/post.js @@ -18,6 +18,7 @@ try { const options = { config: composeFiles, + cwd: core.getInput("cwd"), log: true, composeOptions: utils.parseFlags(core.getInput("compose-flags")), commandOptions: utils.parseFlags(core.getInput("down-flags")), diff --git a/utils.js b/utils.js index 83d7afd..4715f5c 100644 --- a/utils.js +++ b/utils.js @@ -15,7 +15,7 @@ module.exports.parseComposeFiles = (composeFiles) => { } if (!fs.existsSync(composeFile)) { - console.log(`${composeFile} not exists`); + console.log(`${composeFile} does not exist`); return false; }