Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:

doodle-node-cli

A collection of useful utilities for Doodlers :toolbox:

Install the CLI

via GitHub

npm install --global https://github.com/DoodleScheduling/doodle-node-cli.git

via NPM

npm install --global @doodle/doodle-node-cli

via Clone + Link

  1. Clone the repo: git clone git@github.com:DoodleScheduling/doodle-node-cli.git
  2. Change into the directory: cd doodle-node-cli
  3. Install Dependencies: yarn install
  4. Link this project so you can use it "globally": yarn link

:bulb: To "unlink" run $ yarn unlink in the doodle-node-cli root directory

:rainbow: That's it! Now you're ready to run the commands.

Usage

Once installed, you now have a doodle command in your terminal.

   Usage
    $ doodle <commands> [options]

  Commands

    pr             -p  Opens the current branch's pull request on GitHub
    jira           -j  Opens the current branch's ticket on JIRA
    add user       -a  Adds a new Keycloak user
    release        -r  Deploy a TagFlow project anywhere except production
    release ls         List the most recent tags for a TagFlow project
    repo           -s  Lookup and launch a DoodleScheduling repository
    itests             Build the command needed to run the web-integration-tests
    i18n           -i  Look for problems in the OneSky i18n files (React projects only)
    premium            Change a user's premium status
    jenkins            Launch the Jenkins job for the current repo:branch
    login          -l  Get a JWT token for a user
    trial          -t  Start a trial for a Doodle user
  
  Options

    If any of these options are set, the command will not prompt you to supply the
    information manually. 

    --email:            The email address to use
    --password:         The password to use
    --target:           The enviornment (staging, devbox, etc)
    --premium:          If set to 'true', make a premium subscription
    --subscriptionName: The subscription name (e.g., '25: Business 1 annual CHF')

  Examples
    $ doodle gh
    $ doodle pr
    $ doodle jira
    $ doodle daily
    $ doodle premium
    $ doodle trial --email=user@doodle-test.com

Lookup Doodle Repositories

Launch an interactive search for DoodleScheduling repositories (with auto-complete)

$ doodle repo

Updating the List of Repositories

If you want to update the list of DoodleScheduling repositories:

  1. Clone the repo
  2. Change (cd) into the doodle-node-cli directory you just cloned
  3. Run node cli.js repo --update
  4. Optional Commit the updated data/repos.json list to a new PR to share the :heart:

:bulb: If you are using the CLI by linking via npm link or yarn link, then you can also run doodle repo --update

Create New Doodle Users

Want to automate the creation of new user accounts? Of course you do!

Example

Assuming you have gone through the initial setup (instructions below), you just need to run either one of these commands:

$ doodle add user
$ doodle -a

Initial Setup

You will need to get your CLI setup to automatically create test users. This should only need to be done once:

  1. Make sure you have a @doodle-test.com email address (see the warning below)
  2. Run doodle init to setup the initial configuration
  3. When it asks you for a password, please enter the password you would like to use as the default password to use when new test accounts are created by the CLI. Naturally you can override the default with each new test account you create, but having the default password to use for new test accounts can speed up the workflow of creating new test accounts (note that this password will be stored in plaintext on your machine for the CLI to recall later)
  4. Now you are good to go! Try it out with: $ doodle add user

:warning: IMPORTANT! You will need to use an email address in the @doodle-test.com (GSuite) domain when creating test user accounts because these test accounts are required for logging in to our testing environments.

Release to Namespace

In order to deploy a repository to a namespace, you will need a PAT or Personal Access Token from Github. You can read about how to get one here.

Now type the following command in your terminal to get setup:

$ doodle init

After you have run the setup step, you should never need to do it again unless you want to change the information you provided. Then, to deploy a TagFlow-enabled frontend, simply type:

$ doodle release

and follow the on-screen instructions.

Create a Keycloak Client for a New Enviornment

If your environment does not have a doodle-node-cli keycloak client, then you can easily create one by importing the file config/keycloak-client.json into your Keycloak environment.

  1. Login to the Keycloak UI in your environment
  2. Click on the Clients tab and then click the Create button
  3. Import the file (config/keycloak-client.json)['config/keycloak-client.json'] and click Save
  4. Browse to the Service Account Roles Tab, and in the Client Roles choose realm-management and make sure that manage-users is one of the assigned roles. Without this you can't create new users with the CLI.
  5. Click on the Credentials tab and copy the client Secret to the clipboard
  6. Save your client secret in the appropriate vault path as keycloakClientSecret:
$ vault write secret/doodle/<ENVIORONMENT>/doodle-node-cli/secrets keycloakClientSecret=<CLIENT_SECRET>

:bulb: Use this Vault Login Helper to easily switch between your vault enviornments. If you are trying to connect the doodle-node-cli to a new devbox, then you will want to be logged in to vault using the devbox vault address.

:bulb: Don't forget to open a PR that adds your new devbox to the DOODLE_ENVS constant in the constants.js file.

Development

  1. Create a Personal Access Token (PAT) with read:packages and repo scopes
  2. Log in to Github's package repository using the personal access token
    $ npm login --scope=@doodlescheduling --registry=https://npm.pkg.github.com
    
    > Username: Github username
    > Password: Personal Github access token with `read:packages` and `repo` scopes
    > Email: Public email of Github account
    

Publishing

This library is published to the registry using Tagflow.

Publish release candidate

git tag pub.1.0.0-rc.0
git push origin pub.1.0.0-rc.0

Publish release

git tag pub.1.0.0
git push origin pub.1.0.0

:heart: :rainbow: :hamburger: