cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andres de la Peña (Jira) <>
Subject [jira] [Commented] (CASSANDRA-16989) Add environment variables to CircleCI config generation script
Date Fri, 24 Sep 2021 10:16:00 GMT


Andres de la Peña commented on CASSANDRA-16989:

{quote}Am I correct that the implementation in the PR allows to specify any variable from
the config? And UTEST is just an example, right?
Right, it's only an example. You can override any env var or, actually, anything list entry
with the sed pattern {{- $key:.*}}. For example:
.circleci/ -m \
  -e DTEST_REPO=git:// \
  -e REPEATED_DTEST_NAME=cqlsh_tests/ \
{quote}As Ruslan said a `-e` option that constrains to a constrained set of allowed vars,
to avoid typos i.e., would be valuable imo. Then a `-f` (force?) that allows anything just
in case?
I don't know how much we want to complicate parsing for a dev tool. I guess we can add that
list of allowed vars, with the small drawback of having to maintain that list updated. I'll
give it a go.
{quote}get the following error:
./ 45: Syntax error: "(" unexpected
I think that's due to the shebang in the script. It points to {{/bin/sh}}. In my case {{sh}}
is {{zsh}}, and I suspect that for you it is pointing to {{dash}} (Ubuntu?). Unfortunately
dash doesn't support arrays like the one that I use for storing the {{-e}} arguments. I have
modified the shebang to point to bash. Bash supports arrays and I think it is widely available.
Otherwise we should implement a workaround to not use arrays.
{quote}I would make calling `` with no args display the help whereas it only does
upon bad args atm iiuc
We did that in CASSANDRA-16871 to keep compatibility with the previous behaviour, where calling
without arguments generated both the default config and the templates for other resource configs.
I guess we could modify that and require a flag to trigger the generate-all-the-things behaviour.
Maybe {{-a}}, for "all"? [~e.dimitrova] wdyt?

> Add environment variables to CircleCI config generation script
> --------------------------------------------------------------
>                 Key: CASSANDRA-16989
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CI
>            Reporter: Andres de la Peña
>            Assignee: Andres de la Peña
>            Priority: Normal
> The purpose of this ticket is adding arguments to the CircleCI config generation script
allowing to set the values specific environment variables such as {{DTEST_REPO}} or {{DTEST_BRANCH}}
in the generated {{.circleci/config.yml}} file. For example, we could generate a CircleCI
config file with MIDRES specifying a dtest repo and branch by running:
> {code}
> -m \
>   -e DTEST_REPO=git:// \
> {code}
> Or we could set the test multiplexer for repeating a specific test with HIGHRES:
> {code}
> -h \
>   -e REPEATED_UTEST_TARGET=testsome \
>   -e REPEATED_UTEST_CLASS=org.apache.cassandra.cql3.ViewTest \
>   -e REPEATED_UTEST_METHODS=testCompoundPartitionKey,testStaticTable \
> {code}
> This can be useful on its own so we don't have to manually edit the {{config-2_1.yml}}/{{config.yml}},
and it can also be useful for automation scripts manipulating these files.

This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message