ibm-developer / generator-ibm-usecase-enablement

WARNING: This repository is no longer maintained

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WARNING: This repository is no longer maintained ⚠️

The functionality of this generator is now available in our Cloud Assets Generator

This repository will not be updated. The repository will be kept available in read-only mode.

IBM Usecase Enablement Yeoman Generator

IBM Cloud powered Travis Coveralls Codacy Version DownloadsMonthly DownloadsTotal License Conventional Commits

Introduction

This generator produces content from another source such as a Git repository. Also, existing files that already exist in the destination directory can be extended via partial files. The folder structure for the source repository should be like the following.

  src
  ├── java-liberty
  ├── java-spring
  ├── node-express
  ├── public
  ├── python-flask
  └── swift-kitura
  • Files are seperated by each language folder except public which is shared across all langauges. Currently, supported languages are java-liberty, java-spring, node-express, python-flask and swift-kitura

Pre-requisites

Install Yeoman

npm install -g yo

Installation

bash npm install -g generator-ibm-usecase-enablement

Usage

Following command line arguments are supported

  • --bluemix {stringified-json} - used by an internal microservice to supply project information. For an example of a bluemix.json look at the fallback_bluemix.js file.

Partial Files

Partial files such as manifest.yml.partial allows files to be extended if the file exist in the destination directory. For example, if a package.json file already exists it will add onto using package.json.partial.

The following partial file(s) are supported with examples.

Replacement Files

Replacement files are similar to partial files except that content is replaced instead of extended. The replacement files contains a single array of JSON objects. Each object has two key-value pairs: find and replace. The find key-value will search for any string that matches the exact substring and replace key-value will replace the content.

The following replacement file(s) are supported with examples.

Development

Clone this repository and link it via npm

git clone https://github.com/ibm-developer/generator-ibm-usecase-enablement
cd generator-ibm-usecase-enablement
npm link

In a separate directory invoke the generator via

yo ibm-usecase-enablement

Testing

To run the unit tests

npm test

To run integration tests

npm run integration

Note You will need to mock the credentials by adding a bluemix.int.json file. The file content should look something like the following:

{
  "cloudant": [
		{
			"url": "XXXX",
			"username": "XXXXX",
			"password": "XXXX",
			"serviceInfo": {
				"label": "cloudant-label",
				"name": "cloudant-name",
				"plan": "cloudant-plan"
			}
		}
	],

	"objectStorage": [
		{
			"auth_url": "XXXX",
			"domainId": "XXXXX",
			"domainName": "XXXX",
			"password": "XXXX",
			"project": "XXXXX",
			"projectId": "XXXX",
			"region": "dallas",
			"role": "admin",
			"userId": "XXXX",
			"username": "XXXX",
			"serviceInfo": {
				"label": "object-storage-label",
				"name": "object-storage-name",
				"plan": "object-storage-plan"
			}
		}
	]

}

Publishing Changes

In order to publish changes, you will need to fork the repository or ask to join the ibm-developer org and branch off the master branch.

Make sure to follow the conventional commit specification before contributing. To help you with commit a commit template is provide. Run config.sh to initialize the commit template to your .git/config or use commitizen

Once you are finished with your changes, run npm test to make sure all tests pass.

Do a pull request against master, make sure the build passes. A team member will review and merge your pull request. Once merged to master one pull request will be created against master. Make sure that the CHANGELOG.md and the package.json is correct before merging the auto generated pull request. After the autogenerated pull request has been merged to master the version will be bumped and published to npm.

About

WARNING: This repository is no longer maintained

License:Apache License 2.0


Languages

Language:JavaScript 98.3%Language:Swift 0.5%Language:Python 0.4%Language:Dockerfile 0.4%Language:Java 0.3%Language:HTML 0.1%