Giter Site home page Giter Site logo

idearium-lib's Introduction

idearium-lib

Codefresh build status

This repository contains idearium-lib, which is a Node.js shared library for Idearium applications running on Node.js. Any code that is used across multiple applications (or within multiple Docker containers) should live here.

The following documents the development environment, read idearium-lib/README.md for information on the library itself.

Requirements

To program, test and publish these libraries, you will need:

  • Vagrant.
  • VMWare Fusion (and Vagrant-VMware provider plugin) or Virtualbox.
  • Vagrant Host Manager plugin (execute vagrant plugin install vagrant-hostmanager to install).
  • Git.

Please note: this has only been tested on Mac OS X environments.

Getting started with development

Follow these steps to setup the VM:

  • [Host] cd into the directory containing this Git repository.
  • [Host] Execute vagrant up --provider=virtualbox to have Vagrant create a virtual machine.

With the VM started, update it to the latest setup (including a kernel update which is important for Docker):

  • [Host] vagrant ssh.
  • [Guest] sudo apt-get update to update the Aptitude repositories.
  • [Guest] sudo apt-get -y dist-upgrade (you might have to answer a few prompts).
  • [Guest] With everything updated reload the VM, type exit or CTRL + d.
  • [Host] ./reload.sh.

Everything should be updated and ready to go. Once the VM has restarted, continue with the process:

  • [Host] Execute vagrant ssh to be provided with a bash shell within the virtual machine.
  • [Guest] Get into the /vagrant directory, by executing cd /vagrant.
  • [Guest] Setup NPM the test environment with lib-test-setup.

Testing

This library is tested by Codefresh, which employs a Docker-driven test environment. As such, testing from the VM also follows this approach.

Using the lib-test-setup and lib-test scripts, Docker and Docker Compose are used to bring up an environment suitable for testing (one that includes RabbitMQ) and tests are run via npm test inside a running Docker image.

This repository has a complete test suite, which can be run by:

  • [Host] Execute vagrant ssh to be provided with a bash shell within the virtual machine.
  • [Guest] Get into the /vagrant directory, by executing cd /vagrant.
  • [Guest] If you've only just restarted the virtual machine, execute dc up -d.
  • [Guest] Then you can execute lib-test to run the tests, as many times as you need.

Online unit tests

Every commit and push of this repository is tested by Codefresh, https://g.codefresh.io/repositories/idearium/idearium-lib.

Accessing NPM

If you want to run any other NPM command within the context of the container:

  • [Host] Execute vagrant ssh to be provided with a bash shell within the virtual machine.
  • [Guest] Get into the /vagrant directory, by executing cd /vagrant.
  • [Guest] If you've only just restarted the virtual machine, execute dc up -d.
  • [Guest] Execute lib-test {npm-command} to run an NPM command. For example, lib-test whoami to run npm whoami within the context of ./idearium-lib within the container.

Logging into NPM

In order to publish this package to NPM, you need to log into NPM to provide authentication details. Follow these steps:

  • [Host] Execute vagrant ssh to be provided with a bash shell within the virtual machine.
  • [Guest] Get into the /vagrant directory, by executing cd /vagrant.
  • [Guest] Execute npm login and follow the prompts.

Each Idearium developer should have their own NPM account, that is a member of the @idearium organisation. Now you have everything required to start coding and testing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.