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

Rultor fails to parse a valid yaml #1312

Open
Glusk opened this issue Oct 15, 2019 · 6 comments
Open

Rultor fails to parse a valid yaml #1312

Glusk opened this issue Oct 15, 2019 · 6 comments

Comments

@Glusk
Copy link
Contributor

Glusk commented Oct 15, 2019

This is the .rultor.yml file I am using:

architect:
  - Glusk2
docker:
  image: "mingc/android-build-box:1.12.0"
release:
  script:
    - "chmod +x gradlew"
    # Increment versionCode
    - "perl -i.orig -pe '/versionCode/ && s/([0-9]+)/$1+1 . $2/e' android/build.gradle"
    # Strip tag of the "v" prefix
    - "version=${tag#'v'}"
    # Bump project version
    - "./gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=$version -Prelease.newVersion=$version-SNAPSHOT"

The online parser classifies it as a valid yml and parses it successfully. YAMLlint also confirms that it is in fact a valid .yml file!

However, invoking rultor like this:

@rultor release, tag=v0.9.0

failed with this error message (full log):

/home/r/script.sh: line 9: unexpected EOF while looking for matching `}'
@0crat
Copy link
Collaborator

0crat commented Oct 15, 2019

@yegor256/z please, pay attention to this issue

@0crat
Copy link
Collaborator

0crat commented Oct 15, 2019

@glusk2/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!

@Glusk
Copy link
Contributor Author

Glusk commented Oct 20, 2019

@rultor config

@glusk2 This is how I understand the .rultor.yml file in the root directory of your base branch:

<?xml version="1.0" encoding="UTF-8"?>
<p>
   <entry key="architect">
      <item>Glusk2</item>
   </entry>
   <entry key="docker">
      <entry key="image">mingc/android-build-box:1.12.0</entry>
   </entry>
   <entry key="release">
      <entry key="script">
         <item>chmod +x gradlew</item>
         <item>perl -i.orig -pe '/versionCode/ &amp;&amp; s/([0-9]+)/$1+1 . $2/e' android/build.gradle</item>
         <item>version=${tag#'v'}</item>
         <item>./gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=$version -Prelease.newVersion=$version-SNAPSHOT</item>
      </entry>
   </entry>
</p>

This page explains how to configure it.

Originally posted by @rultor in Glusk/sprouts#163 (comment)


The following script line:

- "version=${tag#'v'}"

is successfully stored as an XML element in rultor store:

 <item>version=${tag#'v'}</item>

but on rultor execution it degenerates into:

version=${tag`#'\''\'\'''\''v'\''\'\'''\''}`

@yegor256
Copy link
Owner

@Glusk2 the problem still exists?

@Glusk
Copy link
Contributor Author

Glusk commented Dec 17, 2019

@yegor256
I have since migrated the project to another automated release solution.

But the issue is still present in rultor.


Minimal reproducible example

.rultor.yml:

architect:
  - Glusk2
release:
  script:
    - "version=${tag#'v'}"

Such configuration would fail upon invoking rultor like this:

@rultor release, tag=v1.0.0


It does seem futile to undo all the effort that was put into dealing with the comment lines and make significant changes to how rultor starts its builds (as suggested here)

But as it stands, the following commands will not work in .rultor.yml:

  • ${#parameter}
  • ${parameter#word}
  • ${parameter##word}

Resource: Shell Parameter Expansion

@Glusk
Copy link
Contributor Author

Glusk commented Dec 18, 2019

@yegor256

Unfortunately the information on the topic of this issue is scattered between several other issues.

Here is a list of my comments in related issues:

This is a full list of related issues:

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

No branches or pull requests

3 participants