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 download of openapi-generator script #204

Merged
merged 1 commit into from
Jul 14, 2020

Conversation

gmcculloug
Copy link
Contributor

@gmcculloug gmcculloug commented Jul 10, 2020

After spending some time with other travis scripts I started thinking it would be better to move the download of openapi-generator-cli to this common method instead of requiring each caller to have to download it separately as part of the .travis.yaml

It's not a big impact here (2 new lines), but the caller's .travis.yml file can be reduced to one line:

- - curl -L https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh
-   > ./openapi-generator-cli
- - chmod +x ./openapi-generator-cli
- - curl -L https://raw.githubusercontent.com/RedHatInsights/insights-api-common-rails/master/.travis_scripts/openapi-validator.sh
-   > ./openapi-validator.sh
- - chmod +x ./openapi-validator.sh
- - ./openapi-validator.sh
+ - curl -sSL https://raw.githubusercontent.com/gmcculloug/insights-api-common-rails/master/.travis_scripts/openapi-validator.sh | bash -s

If you like this approach it can be merged ahead of updating the callers to use the 1-line call.

@@ -2,6 +2,9 @@
set -eu
set -o pipefail

curl -L https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ./openapi-generator-cli
chmod +x ./openapi-generator-cli

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we add an echo here to indicate the curl download is completed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bzwei Added an echo. Is that what you were looking for?

@dippy-bot
Copy link

Checked commit b9a6e4e with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.35.0, and yamllint
0 files checked, 0 offenses detected
Everything looks fine. ⭐

@lindgrenj6
Copy link
Contributor

@gmcculloug does this need a new gem release? or is this script just downloaded from master in the child-repos?

Copy link
Contributor

@syncrou syncrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@gmcculloug
Copy link
Contributor Author

@lindgrenj6 No, the callers pull this file directly from the master branch during the travis test run.

Example: https://github.com/RedHatInsights/sources-api/pull/244/files

Copy link
Contributor

@lindgrenj6 lindgrenj6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmcculloug cool, LGTM then!

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

Successfully merging this pull request may close these issues.

None yet

6 participants