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

Add missing ctx values #184

Merged
merged 2 commits into from
Jun 22, 2021
Merged

Conversation

tkushnir
Copy link
Contributor

No description provided.

@tkushnir
Copy link
Contributor Author

@bradrydzewski ?

@tkushnir tkushnir force-pushed the add-missing-ctx-values branch from dc186b9 to a5065fd Compare June 17, 2021 04:12
@eoinmcafee00
Copy link
Contributor

Hey @tkushnir
Thank you for your PR. Can you provide some context/description of the change you've made and why please.
Cheers,
Eoin

@tkushnir
Copy link
Contributor Author

tkushnir commented Jun 22, 2021

Hello @eoinmcafee00

I'm trying to use ctx.build.link and ctx.build.environment in my .drone.star file. The build is working fine, but I can not check the file with drone-cli on my PC. So these values are needed in drone-cli to check the .drone.star file before it is pushed.

Here is the part of my .drone.star:

def main(ctx):
  deploy = False
  release = False
  if (ctx.build.event == "promote" or ctx.build.event == "rollback") and (ctx.build.branch == "master" or ctx.build.ref.rpartition("/")[0] == "refs/tags") and ctx.build.environment in servers.keys():
    deploy = True
  if ctx.build.event == "tag":
    gitea_url = ctx.build.link[:ctx.build.link.find("/", 8)]
    version = ctx.build.ref.rpartition("/")[2].lstrip("v")
    release = True

@tkushnir
Copy link
Contributor Author

tkushnir commented Jun 22, 2021

@eoinmcafee00
By the way, may I include in this PR the new value ctx.build.debug, as it is already added by you to drone/drone today?

@eoinmcafee00 eoinmcafee00 merged commit 691e2de into harness:master Jun 22, 2021
@tkushnir tkushnir deleted the add-missing-ctx-values branch June 23, 2021 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants