Skip to content

whereat/whereat-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Where@ Scripts

This is the entry point to the codebase. Inside this repo are a set of scripts that should get you set up and ready to contribute.

To set up GPG

Motivation: GPG (GNU Privacy Guard) is an implementation of public-private key encryption. This project currently uses GPG to sign commits to verify the identity of contributors and is exploring using it for credentials management.

  1. Check if GPG is installed

$ which gpg

  1. Install GPG (if needed)
  • MAC USERS $ brew install gpg
  • LINUX USERS use your favorite package manager on Linux to install gpg
  • You might also enjoy the silky smooth UX of GPG Tools
  1. Check if you have a PGP Key

    $ gpg -K

    If you see an entry with your email address: YAY! You have a PGP key. You can skip the following step.

  2. Generate a GPG key (for more information, see https://www.madboa.com/geek/gpg-quickstart/)

  • $ gpg --gen-key
  • when asked which type of key you want, choose option (1) [RSA/DSA]
  • when asked how many bits you would like, we recommend 4096
  • Remember your passphrase! (NO REALLY! If you forget this, it's REALLY SAD!)

To clone all repos

  1. Open the file located at ~/.bashrc and insert the following lines:

    export WHEREAT_KEY=<YOUR_PGP_KEY_ID>
    export WHEREAT_ROOT=<PATH_TO_YOUR_WHERAT_REPOS>
    

    Replace the text in angle brackets as follows:

    • To find <YOUR_PGP_KEY_ID>:

      1. $ gpg -K
      2. You should see a line that looks like:
      sec   2048R/1E4DFE5A 2015-10-06 [expires: 2017-07-19]
      

      1E4DFE5A is your PGP key

    • To find <PATH_TO_YOUR_WHERAT_REPOS>:

      1. cd into the directory in which you are keeping where@ repos
      2. $ pwd
      3. this should print out the full path to the directory, for example: /home/awesomecontributor/code/whereat/
    • Given the above examples, we would add the following lines to ~/.bashrc:

      export WHEREAT_KEY=1E4DFE5A
      export WHEREAT_ROOT=/home/awesomecontributor/code/whereat/
      
  2. Source the file where you put your environment variables

$ source ~/.bashrc

  1. Clone the scripts repo into $WHEREAT_ROOT

    $ cd $WHEREAT_ROOT
    $ git clone [email protected]:whereat/whereat-bash.git
    
  2. Add a WHEREAT_SCRIPTS environment variable to your .bashrc and source again

    $ cd whereat-bash
    $ echo "export WHEREAT_SCRIPTS=`pwd`" >> ~/.bashrc
    $ source ~/.bashrc
    
  3. Fork all needed repos to your personal Github account

  4. Clone all forked repos to $WHEREAT_ROOT

  5. Run add-gpg-to-all.sh to set up all repos to sign commits with gpg key.

$ ./src/git-config/add-gpg-to-all.sh

To install a Docker Container for the Location Server

  1. Get the rest of the environment variables from a project admin (email [email protected])
  2. Add the environment variables to a .env file in $WHEREAT_ROOT/whereat-location-server
  3. Set up the Docker environment
  • Linux: start the Docker daemon

    $ sudo service docker restart

    If this doesn't work, try installing docker-toolbox at https://docs.docker.com/engine/installation/linux/

  • Mac:

    1. If you don't already have Docker, download and install docker-toolbox from https://www.docker.com/products/docker-toolbox
    2. Create a default Docker machine if you don't have one already

    $ docker-machine create --driver virtualbox <docker machine name>

    1. Set which Docker machine (i.e. environment) all commands will be run in

    $ eval "$(docker-machine env <docker machine name>)"

  1. MAC USERS ONLY To configure port forwarding from the Docker machine to your mac machine

    $ docker-machine stop <docker machine name>
    $ VBoxManage modifyvm "<docker machine name>" --natpf1 "whereat,tcp,,5000,,5000"
    $ docker-machine start <docker machine name>
    
  2. Build the docker container in the Docker machine for the location server:

    $ ${WHEREAT_SCRIPTS}/src/docker/connect-to-location-server.sh

  3. This should open a docker container that you can use!!!

    • You should start off in a prompt inside the container
    • You can test whether the server works by running the following:
    $ cd whereat-location-server
    $ sbt run
    
    • Now, Your local version of the application code is mounted into the container
    • You can edit the code on your local machine and run it inside the container

About

scripts to help work with where@ repos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages