Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !6609

[ci][cli] Allow invoking generate-samples.sh with single file + args

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jim Schubert requested to merge github/fork/jimschubert/generate-samples-allow-generate into master Jun 10, 2020
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 4

Based on some feedback in #6509, this PR allows users to run ./bin/generate-samples.sh with a single config and additional arguments similar to how individual bash scripts previously worked.

See also #6608 which updates docs for Windows users to execute through GitBash or equivalent.

Examples are embedded in the script as a header/preamble so users will always be presented these options without the need to --help.

For example:

# START SCRIPT: ./bin/utils/ensure-up-to-date
IMPORTANT: this script should be run by the CI (e.g. Shippable) to ensure that the 'samples/' folder is up to date.

# START SCRIPT: /Users/jim/projects/openapi-generator/bin/generate-samples.sh
This script generates all configs under bin/configs by default.
You may generate a targeted script or set of scripts using glob patterns.

For example:
    /Users/jim/projects/openapi-generator/bin/generate-samples.sh bin/configs/java-*

You may generate a single config with additional options if you use -- to
separate the single config file from the generator arguments.

For example:
    /Users/jim/projects/openapi-generator/bin/generate-samples.sh bin/configs/java-vertx.yaml -- --global-property debugModels=true


Please press CTRL+C to stop or the script will continue in 5 seconds.

This should have little or no impact on users following our docs, which describe running the generate command from the jar directly.

cc @OpenAPITools/generator-core-team

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/config/java*.
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/jimschubert/generate-samples-allow-generate