Skip to content

Commit 9d40bde

Browse files
committed
Update Dockerfile, GitHub actions and docs
1 parent 147e77d commit 9d40bde

5 files changed

Lines changed: 38 additions & 3 deletions

File tree

.github/workflows/deployment-checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
cp config/secrets.github.yml config/secrets.yml
4949
cp config/ingestion.example.yml config/ingestion.yml
5050
bundle exec rake db:setup
51+
- run: yarn install
52+
name: Install JS dependencies
5153
- run: bundle exec rake assets:precompile
5254
name: Run asset compilation
5355
- run: bundle exec whenever --update-crontab --set environment="$ENV"

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,7 @@ jobs:
5353
cp config/secrets.github.yml config/secrets.yml
5454
cp config/ingestion.example.yml config/ingestion.yml
5555
bundle exec rake db:test:prepare
56+
- run: yarn install
57+
name: Install JS dependencies
5658
- run: bundle exec rails test
5759
name: Run tests

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ WORKDIR /code
88

99
# install dependencies
1010
RUN apt-get update \
11-
&& apt-get install build-essential curl file git gnupg2 imagemagick libpq-dev libyaml-dev nodejs -y \
11+
&& apt-get install build-essential curl file git gnupg2 imagemagick libpq-dev libyaml-dev nodejs npm -y \
1212
&& apt-get clean
1313

14+
# install yarn to manage JS dependencies
15+
RUN npm install --global yarn
1416

1517
# install supercronic - a cron alternative
1618
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64 \
@@ -41,6 +43,12 @@ COPY Gemfile Gemfile.lock ./
4143
# install gems
4244
RUN bundle check || bundle install
4345

46+
# copy package file
47+
COPY package.json yarn.lock ./
48+
49+
# install js dependencies
50+
RUN yarn install
51+
4452
# copy code
4553
COPY . .
4654

docs/install.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ TeSS requires the following system packages to be installed:
1616
- ImageMagick
1717
- A Java runtime
1818
- A JavaScript runtime
19+
- npm (and yarn)
1920
- Redis
2021

2122
To install these under an Ubuntu-like OS using apt:
2223

23-
sudo apt-get install git postgresql libpq-dev imagemagick nodejs redis-server openjdk-11-jdk
24+
sudo apt-get install git postgresql libpq-dev imagemagick nodejs npm redis-server openjdk-11-jdk
2425

2526
For Mac OS X:
2627

@@ -67,6 +68,18 @@ Once you have Ruby, RVM and bundler installed, from the root folder of the app d
6768

6869
This will install Rails, as well as any other gem that the TeSS app needs as specified in Gemfile (located in the root folder of the TeSS app).
6970

71+
## JS
72+
73+
TeSS uses yarn to manage JS dependencies.
74+
75+
Install it using npm:
76+
77+
npm install --global yarn
78+
79+
and install JS dependencies using (from the app's root directory):
80+
81+
yarn install
82+
7083
## PostgreSQL
7184

7285
Install postgres and add a postgres user called 'tess_user' for the use by the TeSS app (you can name the user any way you like).

docs/production.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This page contains some extra notes about setting up TeSS for production on an U
44

55
## System Dependencies
66

7-
sudo apt-get install git postgresql libpq-dev imagemagick nodejs openjdk-11-jdk apache2 gnupg2
7+
sudo apt-get install git postgresql libpq-dev imagemagick nodejs npm openjdk-11-jdk apache2 gnupg2
88

99
To install a recent version of Redis (6.2+), use the official Redis APT repo:
1010

@@ -184,6 +184,16 @@ _Note: Ensure you have started Solr before running this command!_
184184

185185
RAILS_ENV=production bundle exec rake db:setup
186186

187+
## Install yarn & install JS dependencies
188+
189+
Install yarn globally via npm:
190+
191+
npm install --global yarn
192+
193+
Install JS dependencies:
194+
195+
yarn install
196+
187197
## Compile assets
188198

189199
Assets - such as images, javascript and stylesheets, need to be precompiled -

0 commit comments

Comments
 (0)