Sha256: eadac3b9dae75025db9a630101b7a39c1352dd5aaccccff2c9341a84739c1fd7

Contents?: true

Size: 1.78 KB

Versions: 2

Compression:

Stored size: 1.78 KB

Contents

#!/usr/bin/env bash

# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/ruby-client

set -e

DIR=$(cd `dirname $0` && pwd)
WORKING_DIR="/app/ruby"

if [[ -n "$GITHUB_ACTIONS" ]]; then
  printf "\nLogging in to docker.com ...\n"
  echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
fi

# cleanup
rm -f "${DIR}/lib/dropbox-sign/api/"*.rb
rm -f "${DIR}/lib/dropbox-sign/models/"*.rb

docker run --rm \
  -v "${DIR}/:/local" \
  openapitools/openapi-generator-cli:v7.8.0 generate \
    -i "/local/openapi-sdk.yaml" \
    -c "/local/openapi-config.yaml" \
    -t "/local/templates" \
    -o "/local/"

printf "Install Ruby dependencies ...\n"
bash "${DIR}/bin/ruby" bundle

printf "Formatting code ...\n"
bash "${DIR}/bin/ruby" bundle exec rubocop --autocorrect-all --display-only-fail-level-offenses lib spec examples

printf "\nInstalling composer dependencies ...\n"
mkdir -p "${DIR}/vendor"
bash "${DIR}/bin/php" composer install
printf "\n"

printf "Adding examples to Docs ...\n"
bash "${DIR}/bin/php" ./bin/generate-examples.php

printf "Replacing strings ...\n"
docker run --rm \
  -v "${DIR}:${WORKING_DIR}" \
  -w "${WORKING_DIR}" \
  perl bash ./bin/replace

printf "Scanning for prohibited keywords ...\n"
docker run --rm \
  -v "${DIR}:${WORKING_DIR}" \
  -w "${WORKING_DIR}" \
  perl bash ./bin/scan_for

# avoid docker messing with permissions
if [[ -z "$GITHUB_ACTIONS" ]]; then
  chmod 644 "${DIR}/README.md"
  find "${DIR}/docs/" -type f -exec chmod 644 {} \;
  find "${DIR}/examples/" -type f -exec chmod 644 {} \;
  find "${DIR}/test_fixtures/" -type f -exec chmod 644 {} \;
  find "${DIR}/lib/" -type f -exec chmod 644 {} \;
fi

printf "Running tests ...\n"
bash "${DIR}/bin/ruby" bundle exec rspec

printf "Success!\n"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dropbox-sign-1.8.0 run-build
dropbox-sign-1.7.0 run-build