Code Monkey home page Code Monkey logo

agility_deployment's Introduction

Agility

Documentation

Use http://editor.swagger.io

API documentation

What i need?

  1. Docker
  2. Docker-compose
  3. Node v9.8.0

How to run?

You will need configure your .env first file and go to huge. Bellow you will find how to get the refresh_token, client_id, client_secret and how to create your .env file

Production

docker-compose up -d

Developer

docker run -d -p 9000:27017 mongo
npm run debug_local

Bitbucket

API

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories

Create oauth configuration

Go to Bitbucket Settings > OAuth > Add Consumer

After creation save both key and secret

Authorization

Go to https://bitbucket.org/site/oauth2/authorize?response_type=code&client_id={key from oauth}

Give permission to access you account.

Recover code parameter from authorization response

Access Token

Encode your key and secret with base64 {key}:{secret}


curl -v POST https://bitbucket.org/site/oauth2/access_token -H'Authorization: Basic {key_and_scret_base64_encoded}' -d'grant_type=authorization_code' -d'code={code_from_authorization}'

Refresh Access Code

When you genenerate the access token you also get the refresh code. Save it so you can get another access code since it just last 1 hour.


curl -X POST -H'Authorization: Basic {key_and_scret_base64_encoded}' https://bitbucket.org/site/oauth2/access_token -d grant_type=refresh_token -d refresh_token={refresh_token}

Application

Configure Environment

To configure the environment you will need create the .env file in root folder

Type this command in your terminal:

touch .env

Copy the next text the paste in .env, replace for your respective keys

CLIENT_ID={YOUR ID FROM BITBUCKET API}
CLIENT_SECRET={YOUR KEY FROM BITBUCKET API}
REFRESH_TOKEN={YOUR REFRESH TOKEN FROM BITBUCKET API}
MONGODB=mongodb://mongodb/agility

Debug Mode

In package.json change the debug_local and debug_remote keys for your respective keys from bitbucket.

Sample:

...
"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "debug_local":"CLIENT_ID={CLIENT_ID} CLIENT_SECRET={CLIENT_SECRET} REFRESH_TOKEN={REFRESH_TOKEN} MONGODB=mongodb://{your_ip}:{mongodb_port}/agility nodemon index.js",
    "debug_remote":"CLIENT_ID={CLIENT_ID} CLIENT_SECRET={CLIENT_SECRET} REFRESH_TOKEN={REFRESH_TOKEN} MONGODB=mongodb://{your_ip}:{mongodb_port}/agility nodemon index.js",
    "start": "node index.js"
  },
...

agility_deployment's People

Watchers

 avatar  avatar  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.