Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
env
flag for external parameters of docker build and regular …
…build (#226) tested docker build cases: 1. no command in manifest via `--env` cli flags [sample_no_workspace](https://github.com/dj8yfo/sample_no_workspace/blob/7a9793727ddd6f8be5482944130a9235f62aa1e9/Cargo.toml) => <details> <summary>sample-crate-88.testnet</summary><p> ```json { "build_info": { "build_command": [ "cargo", "near", "build", "--env", "GOOGLE_QUERY=https://www.google.com/search?q=google+translate&sca_esv=3c150c50f502bc5d", "--env", "KEY=VALUE" ], "build_environment": "dj8yfo/sourcescan:0.x.x-dev-pr-226@sha256:a33c44bc06ae8411458fb23cf57b6d760f51592481276f66f5bc292ed6b80378", "contract_path": "", "source_code_snapshot": "git+https://github.com/dj8yfo/sample_no_workspace?rev=7a9793727ddd6f8be5482944130a9235f62aa1e9" }, "link": "https://github.com/dj8yfo/sample_no_workspace/tree/7a9793727ddd6f8be5482944130a9235f62aa1e9", "standards": [ { "standard": "nep330", "version": "1.2.0" } ], "version": "0.7.7" } ``` </p></details> 2. via `passed_env` in manifest and exported env [sample_no_workspace](https://github.com/dj8yfo/sample_no_workspace/blob/485c69441acc449078b1157b812bb69b744c870d/Cargo.toml) <details> <summary>sample-crate-90.testnet</summary><p> ```json { "build_info": { "build_command": [ "cargo", "near", "build", "--env", "KEY=VALUE", "--env", "GOOGLE_QUERY=https://www.google.com/search?q=google+translate&sca_esv=3c150c50f502bc5d" ], "build_environment": "dj8yfo/sourcescan:0.x.x-dev-pr-226@sha256:a33c44bc06ae8411458fb23cf57b6d760f51592481276f66f5bc292ed6b80378", "contract_path": "", "source_code_snapshot": "git+https://github.com/dj8yfo/sample_no_workspace?rev=485c69441acc449078b1157b812bb69b744c870d" }, "link": "https://github.com/dj8yfo/sample_no_workspace/tree/485c69441acc449078b1157b812bb69b744c870d", "standards": [ { "standard": "nep330", "version": "1.2.0" } ], "version": "0.7.7" } ``` </p></details> 3. no command in manifest via `--env` cli flags [neardevhub-contract](https://github.com/dj8yfo/neardevhub-contract/blob/bba6a9b63c00dcf5399e1eb2bf8bf18d6d8d2c4e/discussions/Cargo.toml) <details> <summary>discussions.gothamuniquehandle3.community.devhub-test-4.testnet</summary><p> ```json { "build_info": { "build_command": [ "cargo", "near", "build", "--env", "KEY=VALUE", "--env", "GOOGLE_QUERY=https://www.google.com/search?q=google+translate&sca_esv=3c150c50f502bc5d" ], "build_environment": "dj8yfo/sourcescan:0.x.x-dev-pr-226@sha256:a33c44bc06ae8411458fb23cf57b6d760f51592481276f66f5bc292ed6b80378", "contract_path": "discussions", "source_code_snapshot": "git+https://github.com/dj8yfo/neardevhub-contract?rev=bba6a9b63c00dcf5399e1eb2bf8bf18d6d8d2c4e" }, "link": "https://github.com/dj8yfo/neardevhub-contract/tree/bba6a9b63c00dcf5399e1eb2bf8bf18d6d8d2c4e", "standards": [ { "standard": "nep330", "version": "1.2.0" } ], "version": "0.1.0" } ``` </p></details> ```bash d673dee7ff8e9e5534796a67154e7d43db27b6e57934c33e2848d6b1b5ebf892 community.devhub-test-4.testnet.wasm e6ddea282b05a29aae383e46ba7fc26c127caa4de18a8283190a3d86256e70ac devhub-test-4.testnet.wasm 836a14c755f567a331f9e4ad9f3e99fe696c992525df7c55f8acb18973218c6d discussions.gothamuniquehandle3.community.devhub-test-4.testnet.wasm 85b3054c02e74e8dbf5eab526e8ee867dce1cc3768aa11b32b4d4110fdc78757 gothamuniquehandle3.community.devhub-test-4.testnet.wasm 85b3054c02e74e8dbf5eab526e8ee867dce1cc3768aa11b32b4d4110fdc78757 standalone-devhub-community-4.testnet.wasm 836a14c755f567a331f9e4ad9f3e99fe696c992525df7c55f8acb18973218c6d standalone-devhub-discussions-4.testnet.wasm ``` 4. via `passed_env` in manifest and exported env ; following cases are deployed from the same source-code [neardevhub](https://github.com/dj8yfo/neardevhub-contract/blob/d05268b3583b8273540d94871f897efa120eb0a5/discussions/Cargo.toml) - no variables exports <details> <summary>discussions.uniquehandle.community.devhub-no-vars.testnet</summary><p> ```json { "build_info": { "build_command": [ "cargo", "near", "build" ], "build_environment": "dj8yfo/sourcescan:0.x.x-dev-pr-226@sha256:a33c44bc06ae8411458fb23cf57b6d760f51592481276f66f5bc292ed6b80378", "contract_path": "discussions", "source_code_snapshot": "git+https://github.com/dj8yfo/neardevhub-contract?rev=d05268b3583b8273540d94871f897efa120eb0a5" }, "link": "https://github.com/dj8yfo/neardevhub-contract/tree/d05268b3583b8273540d94871f897efa120eb0a5", "standards": [ { "standard": "nep330", "version": "1.2.0" } ], "version": "0.1.0" } ``` </p></details> ```bash e8fbe501978ac5458a71913ff2fe7ebc1a72573b615ca3fa346f32677d7ca7fc community.devhub-no-vars.testnet.wasm df5992c0f3df6c28b3fa439fdb965cd8ecb8fdec37d65f632affc8de901e0092 devhub-no-vars.testnet.wasm 4382ba6c1e1e004e8b69d98efc0e7652c2c4cf3c16ae9e2dd4d441e85719523f discussions.uniquehandle.community.devhub-no-vars.testnet.wasm 175ae0c5719a21dfab545d418050f91807c858e68983434f4f60ec75cf99f92c standalone-devhub-community-no-vars.testnet.wasm 4382ba6c1e1e004e8b69d98efc0e7652c2c4cf3c16ae9e2dd4d441e85719523f standalone-devhub-discussions-no-vars.testnet.wasm 175ae0c5719a21dfab545d418050f91807c858e68983434f4f60ec75cf99f92c uniquehandle.community.devhub-no-vars.testnet.wasm ``` - one variable export <details> <summary>discussions.uniquehandle.community.devhub-one-var.testnet</summary><p> ```json { "build_info": { "build_command": [ "cargo", "near", "build", "--env", "GOOGLE_QUERY=https://www.google.com/search?q=google+translate&sca_esv=3c150c50f502bc5d" ], "build_environment": "dj8yfo/sourcescan:0.x.x-dev-pr-226@sha256:a33c44bc06ae8411458fb23cf57b6d760f51592481276f66f5bc292ed6b80378", "contract_path": "discussions", "source_code_snapshot": "git+https://github.com/dj8yfo/neardevhub-contract?rev=d05268b3583b8273540d94871f897efa120eb0a5" }, "link": "https://github.com/dj8yfo/neardevhub-contract/tree/d05268b3583b8273540d94871f897efa120eb0a5", "standards": [ { "standard": "nep330", "version": "1.2.0" } ], "version": "0.1.0" } ``` </p></details> ```bash 1787219b148d4298ed56cad04ae430c40d92779c6163e6165b88e5207549f41f community.devhub-one-var.testnet.wasm 87ecd58d10df0718f599af334601674ffe11f203134358add7b993441a943e19 devhub-one-var.testnet.wasm 18fc865aaa2990d80175033e93ecd471f954bf269b340d700885c427476d6e9c discussions.uniquehandle.community.devhub-one-var.testnet.wasm ad3b3a4a26618f32c1fde9958dbd4209b7364ff49e20ab3fc515cff6fcb31ca5 standalone-devhub-community-one-var.testnet.wasm 18fc865aaa2990d80175033e93ecd471f954bf269b340d700885c427476d6e9c standalone-devhub-discussions-one-var.testnet.wasm ad3b3a4a26618f32c1fde9958dbd4209b7364ff49e20ab3fc515cff6fcb31ca5 uniquehandle.community.devhub-one-var.testnet.wasm ``` - two variables export <details> <summary>discussions.uniquehandle.community.devhub-two-var.testnet</summary><p> ```json { "build_info": { "build_command": [ "cargo", "near", "build", "--env", "KEY=VALUE", "--env", "GOOGLE_QUERY=https://www.google.com/search?q=google+translate&sca_esv=3c150c50f502bc5d" ], "build_environment": "dj8yfo/sourcescan:0.x.x-dev-pr-226@sha256:a33c44bc06ae8411458fb23cf57b6d760f51592481276f66f5bc292ed6b80378", "contract_path": "discussions", "source_code_snapshot": "git+https://github.com/dj8yfo/neardevhub-contract?rev=d05268b3583b8273540d94871f897efa120eb0a5" }, "link": "https://github.com/dj8yfo/neardevhub-contract/tree/d05268b3583b8273540d94871f897efa120eb0a5", "standards": [ { "standard": "nep330", "version": "1.2.0" } ], "version": "0.1.0" } ``` </p></details> ```bash cda103ad337d322341f2d8ce442c7cac2b57f945f7c37de814c3951f499967f5 community.devhub-two-var.testnet.wasm 79dc0629f9dde96eb16a823110afd9bcfa6b0e5d7f3b1256fbd3f5da887211b8 devhub-two-var.testnet.wasm 549d312421e600d583fb9847ddc8142909d6f6c5a75a3a44ef9a1e2198b08443 discussions.uniquehandle.community.devhub-two-var.testnet.wasm 804550e43cbfe5f463a8b866a4a5eb65ef845cb9b625af93f43a91ec96dd95a3 standalone-devhub-community-two-var.testnet.wasm 549d312421e600d583fb9847ddc8142909d6f6c5a75a3a44ef9a1e2198b08443 standalone-devhub-discussions-two-var.testnet.wasm 804550e43cbfe5f463a8b866a4a5eb65ef845cb9b625af93f43a91ec96dd95a3 uniquehandle.community.devhub-two-var.testnet.wasm ``` --------- Co-authored-by: dj8yf0μl <[email protected]>
- Loading branch information