Skip to content
Snippets Groups Projects
Commit 8ce0cda4 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Switch from npm to yarn

We use yarn for the toolkit now and it makes sense to use the same
tool for all repos
parent 546765cf
Branches
No related tags found
No related merge requests found
Pipeline #12258 passed with warnings
...@@ -3,4 +3,5 @@ node_modules ...@@ -3,4 +3,5 @@ node_modules
.idea .idea
npm-debug.log npm-debug.log
.vscode .vscode
.cert .cert
\ No newline at end of file package-lock.json
\ No newline at end of file
image: registry.gitlab.tugraz.at/dbp/apps/signature/main:v2 image: registry.gitlab.tugraz.at/dbp/apps/signature/main:v3
before_script: before_script:
- "sed -i 's|git@gitlab.tugraz.at:dbp|../..|g' .gitmodules" - "sed -i 's|git@gitlab.tugraz.at:dbp|../..|g' .gitmodules"
...@@ -11,16 +11,16 @@ stages: ...@@ -11,16 +11,16 @@ stages:
test: test:
stage: test stage: test
script: script:
- npm install - yarn install
- npm run build-dev - yarn run build-dev
- npm run test-full - yarn run test-full
linting: linting:
stage: test stage: test
allow_failure: true allow_failure: true
script: script:
- npm install - yarn install
- npm run lint - yarn run lint
.deploy_defaults: &deploy_defaults .deploy_defaults: &deploy_defaults
except: except:
......
...@@ -14,9 +14,15 @@ RUN apt-get update && apt-get install -y \ ...@@ -14,9 +14,15 @@ RUN apt-get update && apt-get install -y \
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \ RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
nodejs \ nodejs \
yarn \
chromium \ chromium \
# libgbm1: newer chromium from puppeteer
libgbm1 \
firefox-esr \ firefox-esr \
composer \ composer \
php-zip \ php-zip \
......
#!/bin/bash #!/bin/bash
set -e set -e
TAG="registry.gitlab.tugraz.at/dbp/apps/signature/main:v2" TAG="registry.gitlab.tugraz.at/dbp/apps/signature/main:v3"
sudo docker build --tag "${TAG}" --file "Dockerfile" . sudo docker build --tag "${TAG}" --file "Dockerfile" .
sudo docker run --rm --security-opt label=disable \ sudo docker run --rm --security-opt label=disable \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \ --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
......
...@@ -10,17 +10,17 @@ git clone git@gitlab.tugraz.at:dbp/apps/Signature.git ...@@ -10,17 +10,17 @@ git clone git@gitlab.tugraz.at:dbp/apps/Signature.git
cd Signature cd Signature
git submodule update --init git submodule update --init
# install dependencies (make sure you have npm version 4+ installed, so symlinks to the git submodules are created automatically) # install dependencies
npm install yarn install
# constantly build dist/bundle.js and run a local web-server on port 8001 # constantly build dist/bundle.js and run a local web-server on port 8001
npm run watch yarn run watch
# same as watch, but with babel, terser, etc active -> very slow # same as watch, but with babel, terser, etc active -> very slow
npm run watch-full yarn run watch-full
# run tests # run tests
npm test yarn test
``` ```
Jump to <http://localhost:8001> and you should get a Single Sign On login page. Jump to <http://localhost:8001> and you should get a Single Sign On login page.
......
...@@ -44,20 +44,20 @@ host('production') ...@@ -44,20 +44,20 @@ host('production')
// Demo build task // Demo build task
task('build-demo', function () { task('build-demo', function () {
runLocally("npm install"); runLocally("yarn install");
runLocally("npm run build-demo"); runLocally("yarn run build-demo");
})->onStage('demo'); })->onStage('demo');
// Demo dev task // Demo dev task
task('build-development', function () { task('build-development', function () {
runLocally("npm install"); runLocally("yarn install");
runLocally("npm run build-dev"); runLocally("yarn run build-dev");
})->onStage('development'); })->onStage('development');
//Production task //Production task
task('build-production', function () { task('build-production', function () {
runLocally("npm install"); runLocally("yarn install");
runLocally("npm run build-prod"); runLocally("yarn run build-prod");
})->onStage('production'); })->onStage('production');
// Deploy task // Deploy task
......
This diff is collapsed.
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
"build-demo": "rollup -c --environment BUILD:demo", "build-demo": "rollup -c --environment BUILD:demo",
"i18next": "i18next-scanner", "i18next": "i18next-scanner",
"watch": "rollup -c --watch", "watch": "rollup -c --watch",
"watch-local": "npm run watch", "watch-local": "yarn run watch",
"watch-full": "rollup -c --watch --environment FORCE_FULL", "watch-full": "rollup -c --watch --environment FORCE_FULL",
"test": "rollup -c --environment BUILD:test && karma start --singleRun", "test": "rollup -c --environment BUILD:test && karma start --singleRun",
"test-full": "rollup -c --environment FORCE_FULL,BUILD:test && karma start --singleRun", "test-full": "rollup -c --environment FORCE_FULL,BUILD:test && karma start --singleRun",
......
yarn.lock 0 → 100644
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment