[
https://issues.apache.org/jira/browse/CASSANDRA-16989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17419708#comment-17419708
]
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?
{quote}
Right, it's only an example. You can override any env var or, actually,
anything list entry with the sed pattern {{- $key:.*}}. For example:
{code:java}
.circleci/generate.sh -m \
-e DTEST_REPO=git://github.com/adelapena/cassandra-dtest.git \
-e DTEST_BRANCH=CASSANDRA-8272 \
-e REPEATED_DTEST_NAME=cqlsh_tests/test_cqlsh.py::TestCqlshSmoke \
-e REPEATED_DTEST_VNODES=true \
-e REPEATED_DTEST_COUNT=500
{code}
{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?
{quote}
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:
{code:java}
./generate.sh
./generate.sh: 45: Syntax error: "(" unexpected
{code}
{quote}
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 `generate.sh` with no args display the help whereas
it only does upon bad args atm iiuc
{quote}
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: https://issues.apache.org/jira/browse/CASSANDRA-16989
> 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}
> generate.sh -m \
> -e DTEST_REPO=git://github.com/adelapena/cassandra-dtest.git \
> -e DTEST_BRANCH=CASSANDRA-8272
> {code}
> Or we could set the test multiplexer for repeating a specific test with
> HIGHRES:
> {code}
> generate.sh -h \
> -e REPEATED_UTEST_TARGET=testsome \
> -e REPEATED_UTEST_CLASS=org.apache.cassandra.cql3.ViewTest \
> -e REPEATED_UTEST_METHODS=testCompoundPartitionKey,testStaticTable \
> -e REPEATED_UTEST_COUNT=100
> {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
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]