mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-22 21:03:31 +00:00
Remove deprecated grunt code (#9506)
GitOrigin-RevId: 2b19d73c593545aaa9f6eb88143d08c5df39a1be
This commit is contained in:
parent
7ce229be0c
commit
c41c14c697
8 changed files with 6 additions and 176 deletions
|
@ -2,6 +2,7 @@
|
|||
# Thin wrapper on old grunt tasks to ease migrating.
|
||||
|
||||
set -e
|
||||
set -x
|
||||
TASK="$1"
|
||||
shift 1
|
||||
|
||||
|
@ -9,18 +10,22 @@ cd /overleaf/services/web
|
|||
|
||||
case "$TASK" in
|
||||
user:create-admin)
|
||||
echo "The grunt command is deprecated, run the create-user script using node instead"
|
||||
node modules/server-ce-scripts/scripts/create-user --admin "$@"
|
||||
;;
|
||||
|
||||
user:delete)
|
||||
echo "The grunt command is deprecated, run the delete-user script using node instead"
|
||||
node modules/server-ce-scripts/scripts/delete-user "$@"
|
||||
;;
|
||||
|
||||
check:mongo)
|
||||
echo "The grunt command is deprecated, run the check-mongodb script using node instead"
|
||||
node modules/server-ce-scripts/scripts/check-mongodb
|
||||
;;
|
||||
|
||||
check:redis)
|
||||
echo "The grunt command is deprecated, run the check-redis script using node instead"
|
||||
node modules/server-ce-scripts/scripts/check-redis
|
||||
;;
|
||||
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/bash -x
|
||||
|
||||
export SHARELATEX_CONFIG=`pwd`/test/acceptance/scripts/settings.test.js
|
||||
|
||||
echo ">> Starting server..."
|
||||
|
||||
grunt --no-color >server.log 2>&1 &
|
||||
|
||||
echo ">> Server started"
|
||||
|
||||
sleep 5
|
||||
|
||||
echo ">> Running acceptance tests..."
|
||||
grunt --no-color mochaTest:acceptance
|
||||
_test_exit_code=$?
|
||||
|
||||
echo ">> Killing server"
|
||||
|
||||
kill %1
|
||||
|
||||
echo ">> Done"
|
||||
|
||||
exit $_test_exit_code
|
|
@ -1,49 +0,0 @@
|
|||
const Path = require('path')
|
||||
|
||||
module.exports = {
|
||||
path: {
|
||||
compilesDir: Path.join(__dirname, '../../../compiles'),
|
||||
clsiCacheDir: Path.join(__dirname, '../../../cache'),
|
||||
// synctexBaseDir: (project_id) -> Path.join(@compilesDir, project_id)
|
||||
synctexBaseDir() {
|
||||
return '/compile'
|
||||
},
|
||||
sandboxedCompilesHostDir: process.env.SANDBOXED_COMPILES_HOST_DIR,
|
||||
},
|
||||
|
||||
clsi: {
|
||||
// strace: true
|
||||
// archive_logs: true
|
||||
commandRunner: 'docker-runner-sharelatex',
|
||||
latexmkCommandPrefix: ['/usr/bin/time', '-v'], // on Linux
|
||||
docker: {
|
||||
image: process.env.TEXLIVE_IMAGE || 'texlive-full:2017.1-opt',
|
||||
env: {
|
||||
PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/texlive/2017/bin/x86_64-linux/',
|
||||
HOME: '/tmp',
|
||||
},
|
||||
modem: {
|
||||
socketPath: false,
|
||||
},
|
||||
user: process.env.SIBLING_CONTAINER_USER || '111',
|
||||
},
|
||||
},
|
||||
|
||||
internal: {
|
||||
clsi: {
|
||||
port: 3013,
|
||||
load_port: 3044,
|
||||
host: 'localhost',
|
||||
},
|
||||
},
|
||||
|
||||
apis: {
|
||||
clsi: {
|
||||
url: 'http://localhost:3013',
|
||||
},
|
||||
},
|
||||
|
||||
smokeTest: false,
|
||||
project_cache_length_ms: 1000 * 60 * 60 * 24,
|
||||
parallelFileDownloads: 1,
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# npm rebuild
|
||||
|
||||
echo ">> Starting server..."
|
||||
|
||||
grunt --no-color forever:app:start
|
||||
|
||||
echo ">> Server started"
|
||||
|
||||
sleep 20
|
||||
|
||||
echo ">> Running acceptance tests..."
|
||||
grunt --no-color mochaTest:acceptance
|
||||
_test_exit_code=$?
|
||||
|
||||
echo ">> Killing server"
|
||||
|
||||
grunt --no-color forever:app:stop
|
||||
|
||||
echo ">> Done"
|
||||
|
||||
exit $_test_exit_code
|
|
@ -1,23 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# npm rebuild
|
||||
|
||||
echo ">> Starting server..."
|
||||
|
||||
grunt --no-color forever:app:start
|
||||
|
||||
echo ">> Server started"
|
||||
|
||||
sleep 5
|
||||
|
||||
echo ">> Running acceptance tests..."
|
||||
grunt --no-color mochaTest:acceptance
|
||||
_test_exit_code=$?
|
||||
|
||||
echo ">> Killing server"
|
||||
|
||||
grunt --no-color forever:app:stop
|
||||
|
||||
echo ">> Done"
|
||||
|
||||
exit $_test_exit_code
|
|
@ -10,19 +10,6 @@ a lot of logic around creating and editing projects, and account management.
|
|||
The rest of the Overleaf stack, along with information about contributing can be found in the
|
||||
[overleaf/overleaf](https://github.com/overleaf/overleaf) repository.
|
||||
|
||||
Build process
|
||||
----------------
|
||||
|
||||
overleaf/web uses [Grunt](http://gruntjs.com/) to build its front-end related assets.
|
||||
|
||||
Image processing tasks are commented out in the gruntfile and the needed packages aren't presently in the project's `package.json`. If the images need to be processed again (minified and sprited), start by fetching the packages (`npm install grunt-contrib-imagemin grunt-sprity`), then *decomment* the tasks in `Gruntfile.coffee`. After this, the tasks can be called (explicitly, via `grunt imagemin` and `grunt sprity`).
|
||||
|
||||
New Docker-based build process
|
||||
------------------------------
|
||||
|
||||
Note that the Grunt workflow from above should still work, but we are transitioning to a
|
||||
Docker based testing workflow, which is documented below:
|
||||
|
||||
### Running the app
|
||||
|
||||
The app runs natively using npm and Node on the local system:
|
||||
|
@ -32,8 +19,6 @@ $ npm install
|
|||
$ npm run start
|
||||
```
|
||||
|
||||
*Ideally the app would run in Docker like the tests below, but with host networking not supported in OS X, we need to run it natively until all services are Dockerised.*
|
||||
|
||||
### Running Tests
|
||||
|
||||
To run all tests run:
|
||||
|
|
|
@ -486,9 +486,7 @@ module.exports = {
|
|||
? process.env.PRECOMPILE_PUG_TEMPLATES_AT_BOOT_TIME === 'true'
|
||||
: process.env.NODE_ENV === 'production',
|
||||
|
||||
// Should javascript assets be served minified or not. Note that you will
|
||||
// need to run `grunt compile:minify` within the web-sharelatex directory
|
||||
// to generate these.
|
||||
// Should javascript assets be served minified or not.
|
||||
useMinifiedJs: process.env.MINIFIED_JS === 'true' || false,
|
||||
|
||||
// Should static assets be sent with a header to tell the browser to cache
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# If you're running on OS X, you probably need to rebuild
|
||||
# some dependencies in the docker container, before it will start.
|
||||
#
|
||||
#npm rebuild --update-binary
|
||||
|
||||
echo ">> Starting server..."
|
||||
|
||||
grunt --no-color forever:app:start
|
||||
|
||||
echo ">> Waiting for Server"
|
||||
|
||||
count=1
|
||||
max_wait=60
|
||||
|
||||
while [ $count -le $max_wait ]
|
||||
do
|
||||
if nc -z localhost 3000
|
||||
then
|
||||
echo ">> Server Started"
|
||||
|
||||
echo ">> Running acceptance tests..."
|
||||
grunt --no-color mochaTest:acceptance
|
||||
_test_exit_code=$?
|
||||
|
||||
echo ">> Killing server"
|
||||
|
||||
grunt --no-color forever:app:stop
|
||||
|
||||
echo ">> Done"
|
||||
|
||||
exit $_test_exit_code
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
echo -n "."
|
||||
count=$((count+1))
|
||||
done
|
||||
exit 1
|
Loading…
Reference in a new issue