Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
add documentation and scripts to build / hack on firegrid
Browse files Browse the repository at this point in the history
  • Loading branch information
foliea committed Dec 3, 2017
1 parent e2f3b8e commit 1791aa7
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 7 deletions.
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing guidelines

Fork the repository and make changes on your fork in a feature branch:

If it's a bug fix branch, name it `XXXX-something` where `XXXX` is the number of the issue.
If it's a feature branch, create an enhancement issue to announce your intentions, and name it `XXXX-something` where
`XXXX` is the number of the issue.

Submit tests for your changes. Take a look at existing tests for inspiration.
Run the full test suite on your branch before submitting a pull request.

Write clean code. Universally formatted code promotes ease of writing, reading, and maintenance.

Pull requests descriptions should be as clear as possible and include a reference to all the issues that they address.

Code review comments may be added to your pull request. Discuss, then make the suggested modifications and push additional
commits to your feature branch. Be sure to post a comment after pushing. The new commits will show up in the pull request
automatically, but the reviewers will not be notified unless you comment.

Pull requests must be cleanly rebased on top of master without multiple branches mixed into the PR.

Commits that fix or close an issue should include a reference like `Closes #XXXX` or Fixes `#XXXX`, which will automatically close the issue
when merged.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN echo '[archlinuxfr]' >> /etc/pacman.conf && \
echo 'SigLevel = Never' >> /etc/pacman.conf && \
echo 'Server = http://repo.archlinux.fr/$arch' >> /etc/pacman.conf && \
pacman -Syu --noconfirm \
qt5 \
qt5-base \
xdotool \
wget \
crystal \
Expand All @@ -17,20 +17,19 @@ RUN wget https://github.com/crystal-lang/crystal/releases/download/$CRYSTAL_VERS
mv crystal-$CRYSTAL_VERSION-3 /crystal && \
rm crystal-$CRYSTAL_VERSION-3-linux-x86_64.tar.gz


COPY shard.yml $APP/
COPY shard.lock $APP/

RUN useradd --create-home --home-dir $HOME dev && \
RUN cd $APP && crystal deps install

COPY . $APP

RUN useradd --create-home --home-dir $HOME/dev dev && \
chown -R dev:dev $HOME && \
chown -R dev:dev $APP

USER dev

RUN cd $APP && crystal deps install

COPY . $APP

RUN ln -s $APP/config/firegrid.toml $HOME/.firegrid.toml

WORKDIR $APP
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,64 @@
## Firegrid
[![Build Status](https://travis-ci.org/foliea/firegrid.svg?branch=master)](https://travis-ci.org/foliea/firegrid)

Click anywhere with only a few keystrokes!

## Installation

### On Archlinux

Firegrid is available in the AUR: [firegrid](https://aur.archlinux.org/packages/firegrid)

You can install it using `makepkg` like this:

$ git clone https://aur.archlinux.org/firegrid.git
$ cd firegrid
$ makepkg -si
$ cd ..
$ rm -r firegrid

Or you could use an AUR helper:

$ yaourt -S firegrid

### Build from sources

To build firegrid from sources, you only need [Docker](https://www.docker.com).

Run the following command:

$ sh scripts/build.sh

You will then find the firegrid binary in the `bin` directory:

$ ./bin/firegrid

## Development

To hack on firegrid, you can run a [Docker](https://www.docker.com) container
with every dependency required to build, run the application and launch the test
suite:

$ sh scripts/hack.sh

> N.b: If you get the following error: `QXcbConnection: Could not connect to display`,
you need to install [xhost](https://www.x.org/archive/X11R6.8.1/doc/xhost.1.html) and run
the following command: `xhost +` before running the script.

Inside the container you can:
* Build the binary with: `make`
* Compile and run the application with: `make dev`
* Launch the test suite with: `make test`

## Contributing

Before sending a pull request, please checkout the contribution
[guidelines](/CONTRIBUTING.md).

## Authors
* [Adrien Folie](https://github.com/foliea) - Creator / Maintainer.

## Licensing

Firegrid is licensed under the MIT License. See [LICENSE](LICENSE) for full
license text.
11 changes: 11 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

image_name="firegrid-build"

docker build -t $image_name .
docker run -ti $image_name /bin/sh -c "make"

container_id=$(docker ps -l -q)

docker cp $container_id:/firegrid/bin/firegrid ./bin/
12 changes: 12 additions & 0 deletions scripts/hack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

image_name="firegrid-hack"

docker build -t $image_name .

docker run -ti \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $PWD:/firegrid \
-e DISPLAY=unix$DISPLAY \
$image_name

0 comments on commit 1791aa7

Please sign in to comment.