-
Notifications
You must be signed in to change notification settings - Fork 21
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
conditional environment? #15
Comments
It looks like you have a duplicated Either way, consolidating your tasks:
build_providers:
run:
- when:
os: osx
environment:
DRONE_ARCH: darwin/amd64
- command: mkdir -pv ${DRONE_ARCH}
- command: ./go_buildif.sh github.com/terraform-providers/terraform-provider-http |
I think that if you're looking for something like Terraform's run: ./my_script.py As for:
You can chuck regular old bash scripting into your tasks:
foo:
run:
- when:
command: test -z "${MY_ENV_VAR}"
environment:
MY_ENV_VAR: some_default_value |
The more I look at I'm leaning toward first-class support for environment variables in when:
environment:
MY_ENV_VAR_UNSET: ~ # This checks if not set
MY_ENV_VAR_EMPTY: "" # This makes sure it was set but empty
MY_ENV_VAR_STRING: regular_string Would that fit your use case? |
I added support for I'm going to close this, but let me know if this implementation doesn't meet your use case. |
alternatively, some kind of coalsece(ala tf) string list construct? or something to set a default if unset in the environment clause?
thought would be nice to have a tusk task that works in ci as well as local dev if you don't want to wrap in drone containers.
idk. i'm probably going to go back to original idea of breaking tasks and drone pipeline stage commands out into scripts instead. was original plan but thought tusk tasks seemed betterer.
probably is. it's not a build system or logic system, it's a task runner.
The text was updated successfully, but these errors were encountered: