Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
128
Issues
128
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
36ba9be3
Commit
36ba9be3
authored
Dec 02, 2020
by
James Laver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document docker build
parent
c06cf421
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
36 deletions
+89
-36
Dockerfile.dev
Dockerfile.dev
+1
-0
README.md
README.md
+76
-31
docker-compose.yml
docker-compose.yml
+9
-5
env.sh
env.sh
+3
-0
No files found.
Dockerfile.dev
View file @
36ba9be3
...
...
@@ -10,4 +10,5 @@ RUN apt-get update && apt-get install -y yarn
RUN curl -L https://github.com/coot/zephyr/releases/download/v0.3.2/Linux.tar.gz | tar zx -C /usr/bin --strip-components=1 zephyr/zephyr
WORKDIR /opt/app
EXPOSE 5000/tcp
CMD ["bash"]
\ No newline at end of file
README.md
View file @
36ba9be3
...
...
@@ -14,14 +14,47 @@ granted access to a [backend](https://gitlab.iscpif.fr/gargantext/haskell-gargan
This software is free software, developed by the CNRS Complex Systems
Institute of Paris Île-de-France (ISC-PIF) and its partners.
## Dependencies
## Getting set up
There are two approaches to working with the build:
1.
Use our docker setup
2.
Install our dependencies yourself
The javascript ecosystem kind of assumes if you're on linux, you're
running on debian or ubuntu. I haven't yet managed to get garg to
build on alpine linux, for example. If you're on an oddball system, I
*strongly*
recommend you just use the docker setup.
### Docker setup
You will need docker and docker-compose installed.
First, Source our environment file:
```
shell
source
./env.sh
```
WARNING: you must
`source ./env.sh`
before using the docker
container. If you don't do that, the container will write files as
root and you'll need root powers to get ownership back!
Now build the docker image:
```
shell
docker-compose build frontend
```
That's it, skip ahead to "Development".
### Manual setup
The build requires the following system dependencies preinstalled:
*
NodeJS (11+)
*
Yarn (Recent)
### NodeJS
###
#
NodeJS
On debian testing, debian unstable or ubuntu:
...
...
@@ -55,7 +88,7 @@ brew install node
For other platforms, please refer to
[
the nodejs website
](
https://nodejs.org/en/download/
)
.
### Yarn (javascript package manager)
###
#
Yarn (javascript package manager)
On debian or ubuntu:
...
...
@@ -75,63 +108,89 @@ For other platforms, please refer to [the yarn website](https://www.yarnpkg.com/
## Development
Once you have node and yarn installed, you may install deps with:
### Docker environment
Are you using the docker setup? Run this:
```
shell
source
./env.sh
```
This enables the docker container to run as the current user so any
files it writes will be readable by you. It also creates a
`darn`
shell alias (short for
`docker yarn`
) for running yarn commands inside
the docker container.
### Basic tasks
Now we must install our javascript and purescript dependencies:
```
shell
yarn
install
-D
&&
yarn install-ps
darn
install
-D
&&
darn install-ps
# for docker setup
yarn
install
-D
&&
yarn install-ps
# for manual setup
```
You will likely want to check your work in a browser. We provide a
local development webserver that serves on port 5000 for this purpose:
```
shell
yarn server
darn server
# for docker setup
yarn server
# for manual setup
```
To generate a new browser bundle to test:
```
shell
yarn build
darn build
# for docker setup
yarn build
# for manual setup
```
If you are rapidly iterating and just want to type check your code:
```
shell
yarn compile
darn compile
# for docker setup
yarn compile
# for manual setup
```
You may access a purescript repl if you want to explore:
```
shell
yarn repl
darn repl
# for docker setup
yarn repl
# for manual setup
```
If you need to reinstall dependencies such as after a git pull or branch switch:
```
shell
yarn
install
-D
&&
yarn install-ps
# both javascript and purescript
darn
install
-D
&&
darn install-ps
# for docker setup
yarn
install
-D
&&
yarn install-ps
# for manual setup
```
If something goes wrong building after a deps update, you may clean
build artifacts and try again:
```
shell
yarn clean-js
# clean javascript, very useful
yarn clean-ps
# clean purescript, should never be required, possible purescript bug
yarn clean
# clean both purescript and javascript
# for docker setup
darn clean-js
# clean javascript, very useful
darn clean-ps
# clean purescript, should never be required, possible purescript bug
darn clean
# clean both purescript and javascript
# for manual setup
yarn clean-js
yarn clean-ps
yarn clean
```
If you edit the SASS, you'll need to rebuild the CSS:
```
shell
yarn sass
darn css
# for docker setup
yarn css
# for manual setup
```
<!-- A `purs ide` connection will be available on port 9002 while the -->
<!-- development server is running. -->
A guide to getting set up with the IDE integration is coming soon, I hope.
of this document.
### Note to contributors
...
...
@@ -139,20 +198,6 @@ Please follow CONTRIBUTING.md
### How do I?
#### Change which backend to connect to?
Edit
`Config.purs`
. Find the function
`endConfig'`
just after the
imports and edit
`back`
. The definitions are not far below, just after
the definitions of the various
`front`
options.
Example (using
`demo.gargantext.org`
as backend):
```
endConfig' :: ApiVersion -> EndConfig
endConfig' v = { front : frontRelative
, back : backDemo v }
```
#### Add a javascript dependency?
Add it to
`package.json`
, under
`dependencies`
if it is needed at
...
...
@@ -173,13 +218,13 @@ works. It's written in dhall, so you can use comments and such.
You will then need to rebuild the package set:
```
shell
yarn rebuild-set
yarn rebuild-set
# or darn rebuild-set
```
#### Upgrade the base package set local is based on to latest?
```
shell
yarn rebase-set
&&
yarn rebuild-set
yarn rebase-set
&&
yarn rebuild-set
# or darn rebase-set && darn rebuild-set
```
This will occasionally result in swearing when you go on to build.
...
...
docker-compose.yml
View file @
36ba9be3
...
...
@@ -4,9 +4,13 @@ services:
build
:
context
:
.
dockerfile
:
"
Dockerfile.dev"
stdin_open
:
true
tty
:
true
user
:
$UID:$GID
ports
:
-
5000:5000
volumes
:
-
type
:
bind
source
:
.
target
:
/opt/app
stdin_open
:
true
# like docker run -i
tty
:
true
# like docker run -t
-
.:/opt/app
-
/etc/group:/etc/group:ro
-
/etc/passwd:/etc/passwd:ro
-
/etc/shadow:/etc/shadow:ro
\ No newline at end of file
env.sh
0 → 100644
View file @
36ba9be3
export
UID
=
$(
id
-u
)
export
GID
=
$(
id
-g
)
alias
darn
=
"docker-compose run frontend yarn"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment