Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: env flag for external parameters of docker build and regular build #226

Merged
merged 23 commits into from
Sep 24, 2024

Conversation

dj8yfo
Copy link
Collaborator

@dj8yfo dj8yfo commented Sep 19, 2024

tested docker build cases:

  1. no command in manifest via --env cli flags sample_no_workspace =>
sample-crate-88.testnet

{
  "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"
}

  1. via passed_env in manifest and exported env sample_no_workspace
sample-crate-90.testnet

{
  "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"
}

  1. no command in manifest via --env cli flags neardevhub-contract
discussions.gothamuniquehandle3.community.devhub-test-4.testnet

{
  "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"
}

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
  1. via passed_env in manifest and exported env ; following cases are deployed from the same source-code neardevhub
  • no variables exports

    discussions.uniquehandle.community.devhub-no-vars.testnet

    {
      "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"
    }

    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

    discussions.uniquehandle.community.devhub-one-var.testnet

    {
      "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"
    }

    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

    discussions.uniquehandle.community.devhub-two-var.testnet

    {
      "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"
    }

    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

@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Sep 20, 2024

@race-of-sloths ping

@dj8yfo dj8yfo marked this pull request as ready for review September 20, 2024 17:43
@race-of-sloths
Copy link

race-of-sloths commented Sep 20, 2024

@dj8yfo Thank you for your contribution! Your pull request is now a part of the Race of Sloths!

Shows profile picture for the author of the PR

Current status: executed
Reviewer Score
@frol 8

Your contribution is much appreciated with a final score of 8!
You have received 88 (80 base + 10% lifetime bonus) Sloth points for this contribution

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

Copy link
Contributor

@frol frol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to ignore nit comments, but there is one that is important

cargo-near-build/src/near/abi/generate/mod.rs Outdated Show resolved Hide resolved
cargo-near-build/src/near/abi/generate/mod.rs Outdated Show resolved Hide resolved
cargo-near-build/src/near/build/mod.rs Outdated Show resolved Hide resolved
cargo-near-build/src/types/near/build/input/mod.rs Outdated Show resolved Hide resolved
@dj8yfo dj8yfo marked this pull request as draft September 24, 2024 11:59
@dj8yfo dj8yfo marked this pull request as ready for review September 24, 2024 13:40
Copy link
Contributor

@frol frol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@race-of-sloths score 8

@frol frol merged commit b0e2996 into near:main Sep 24, 2024
17 checks passed
@frol frol mentioned this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants