Code Monkey home page Code Monkey logo

payments-env's Introduction

This is the main development environment for working on Mozilla payments.

Circle CI

Requirements

Deployment / QA

The following instructions are for using pre-built containers for deployment or QA purposes.

  • git clone https://github.com/mozilla/payments-env.git

  • cd payments-env

  • docker-compose -f docker-compose-deploy.yml up -d

  • Find the IP address of your docker system.

    • On OS X using boot2docker you can find the address of a container by boot2docker ip
  • Edit your /etc/hosts file so that the host pay.dev resolves to your IP. For example, you might add this line to /etc/hosts:

      192.168.59.103  pay.dev
    
  • Run docker-compose up -d

  • Open the example site at http://pay.dev/

Development

Bootstrap your Payments environment by checking out this repository and running the bootstrap.py command. It will automatically check out all other repos into a directory next to your payments-env directory named mozilla-payments, download the appropriate Docker images, and start them.

The only things left will be output at the end of the bootstrap, naming changing your /etc/hosts file to map your Docker's IP to pay.dev and sourcing the created ENV file from your shell for the Braintree Environment variables.

Once you're done, open the example site at http://pay.dev/.

Now you're good to go!

Updating Your Environment

Run ./update-repos.sh to pull the latest version of the master branch on all repos, get new Docker images, and restart all Docker images.

To do this manually, run these commands:

  • Run git pull in each linked repository (or only in payments-env if you're using pre-built containers).
  • Run docker-compose stop to make sure all containers are not running.
  • Run docker-compose pull to get the latest images and rebuild if necessary.
  • Run docker-compose up -d to start the new containers.

Configurations

There are two docker configurations:

  • docker-compose.yml is for development purposes and requires the source to be checked out.
  • docker-compose-deploy.yml is for deployment purposes and contains the application source.

Updating images

If you update the nginx image, run the command build-and-push.sh. This will update the image and push it to docker hub.

CircleCI

Test are run on circle ci for payments-env. We need to figure out how to run them regularly.

payments-env's People

Contributors

andymckay-limited-access avatar jgmize avatar kumar303 avatar muffinresearch avatar tofumatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

payments-env's Issues

Stand up payments-env somewhere

We need somewhere we can stand up payments-env so we can run tests on it. Could be jenkins, circle-ci or anything really.

Can't be travis because at the moment you can't run docker on travis, without some serious hacks :(

Create a sample/default environment file for development

Instead of getting developers to add a bunch of files to their ~/.profile (or whatever it is on their system/shell), let's provide a file they can activate in their profile.

They would include:

# Include for Mozilla Payments
source ~/Projects/payments-env/development.env

and that file could include:

export BRAINTREE_MERCHANT_ID=tbb7hb44zx28jhsh
export BRAINTREE_PUBLIC_KEY=...
export BRAINTREE_PRIVATE_KEY=...

# etc...

pay.dev.mozaws.net is down

[ec2-user@ip-172-31-37-109 ~]$ source docker--bash: cannot create temp file for here-document: No space left on device
^C
[ec2-user@ip-172-31-37-109 ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       20G   20G   20K 100% /

Sigh.

Add accept-language rewriting to nginx

To be able to serve a localized version of payments-ui we need to add something to nginx to handle redirects based on accept-language headers.

See http://stackoverflow.com/questions/3657614/how-to-rewrite-location-in-nginx-depending-on-the-client-browsers-language

The benefit with the static route is it should be possible for someone to visit localized static content from the payments-ui tree and see it as it should be. Not to mention if running via pay.dev it should work with accept-language directly.

This looks like it might be worth a try https://github.com/fghibellini/nginx-http-accept-lang/blob/master/lang.lua

If doing it this way is a concern then we should probably look at some other solution e.g. some minimal additional service fronting the SPA.

Let's add in a .env file

Let's get a basic .env file that has all the base environment variables in so people can just alter a few key values.

Remove per month

per month is currently added to the purchase page, for one-off donations this may (or not make sense). lets for the moment remove that based no the product config.

docker-compose up -d nearly always has mysql issues first run.

If I stop all the docker containers and then run docker-compose up -d I nearly always see:

Got error: Lost connection to MySQL server at 'reading initial communication packet', system error: 104

...in the solitude logs. And login fails.

When I docker-compose stop and docker-compose up -d a second time everything is fine.

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.