Giter Site home page Giter Site logo

conditional-pipeline-execution's Introduction

Conditional Pipeline Execution

CircleCI

A Node API project with tests linting packages setup for the purpose of demonstrating the use of the Conditional Pipeline Execution feature within CircleCI.

Setting up the prject

Clone the repository:

run the following command on your terminal to clone the repository:

git clone [email protected]:mwaz/conditional-pipeline-execution.git

cd conditional-pipeline-execution

install the dependencies

Install the dependencies using the following command:

    npm install

Create Mongo Atlas Account

Since, we want to be able to distribute the data to multiple users and also execute the pipeline in CircleCI, we need to create an account on Mongo Atlas. Once we have an account, under Collections, we need to create a database and a collection. The database name is expressAPI and the collection name is posts. Once this is done, we need to copy the connection url and add it to our .env file and also as an environment variable to CircleCI. The variable name is DB_CONNECTION and the value is the connection url will be something like the following:

mongodb+srv://<dbUser>:<user_password>@cluster0.jigii.mongodb.net/expressAPI?retryWrites=true&w=majority

Note: You also need to grant explicit permissions to the database user being used to drop a database as this is not set up a default permission in the Mongo Atlas dashboard.

Once this has been added to the .env, we are good to go. You can test the connection by executing the tests.

Note: If you are not running CircleCI, you can skip this step and locally install Mongo on your machine and configure the DB_CONNECTION environment variable to your local mongo connection.

Running tests

npm test

Details

This repo is built following a tutorial published on CircleCI blog under the CircleCI Guest Writer Program.

About CircleCI Guest Writer Program

Join a team of freelance writers and write about your favorite technology topics for the CircleCI blog. Read more about the program here.

Reviewers: Ron Powell, Stanley Ndagi, Amos Omondi

conditional-pipeline-execution's People

Contributors

mwaz avatar

Watchers

 avatar

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.