forked from getredash/redash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Yarn instead of NPM (getredash#5541)
- Loading branch information
1 parent
5c6be1a
commit 1e24c00
Showing
15 changed files
with
28,225 additions
and
42,921 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
FROM cypress/browsers:node14.0.0-chrome84 | ||
FROM cypress/browsers:node14.17.0-chrome91-ff89 | ||
|
||
ENV APP /usr/src/app | ||
WORKDIR $APP | ||
|
||
COPY package.json package-lock.json $APP/ | ||
COPY package.json yarn.lock .yarnrc $APP/ | ||
COPY viz-lib $APP/viz-lib | ||
RUN npm ci > /dev/null | ||
RUN npm install [email protected] -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null | ||
|
||
COPY . $APP | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,17 @@ version: 2.0 | |
|
||
build-docker-image-job: &build-docker-image-job | ||
docker: | ||
- image: circleci/node:12 | ||
- image: circleci/node:14.17 | ||
steps: | ||
- setup_remote_docker | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
- checkout | ||
- run: sudo apt update | ||
- run: sudo apt install python3-pip | ||
- run: sudo pip3 install -r requirements_bundles.txt | ||
- run: .circleci/update_version | ||
- run: npm run bundle | ||
- run: sudo npm install --global --force [email protected] | ||
- run: yarn bundle | ||
- run: .circleci/docker_build | ||
jobs: | ||
backend-lint: | ||
|
@@ -27,7 +29,8 @@ jobs: | |
docker: | ||
- image: circleci/buildpack-deps:xenial | ||
steps: | ||
- setup_remote_docker | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
- checkout | ||
- run: | ||
name: Build Docker Images | ||
|
@@ -61,34 +64,36 @@ jobs: | |
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
docker: | ||
- image: circleci/node:12 | ||
- image: circleci/node:14.17 | ||
steps: | ||
- checkout | ||
- run: mkdir -p /tmp/test-results/eslint | ||
- run: npm ci | ||
- run: npm run lint:ci | ||
- run: sudo npm install --global --force [email protected] | ||
- run: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- run: yarn lint:ci | ||
- store_test_results: | ||
path: /tmp/test-results | ||
frontend-unit-tests: | ||
environment: | ||
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
docker: | ||
- image: circleci/node:12 | ||
- image: circleci/node:14.17 | ||
steps: | ||
- checkout | ||
- run: sudo apt update | ||
- run: sudo apt install python3-pip | ||
- run: sudo pip3 install -r requirements_bundles.txt | ||
- run: npm ci | ||
- run: npm run bundle | ||
- run: sudo npm install --global --force [email protected] | ||
- run: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- run: yarn bundle | ||
- run: | ||
name: Run App Tests | ||
command: npm test | ||
command: yarn test | ||
- run: | ||
name: Run Visualizations Tests | ||
command: (cd viz-lib && npm test) | ||
- run: npm run lint | ||
command: (cd viz-lib && yarn test) | ||
- run: yarn lint | ||
frontend-e2e-tests: | ||
environment: | ||
COMPOSE_FILE: .circleci/docker-compose.cypress.yml | ||
|
@@ -99,9 +104,10 @@ jobs: | |
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
docker: | ||
- image: circleci/node:12 | ||
- image: circleci/node:14.17 | ||
steps: | ||
- setup_remote_docker | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
- checkout | ||
- run: | ||
name: Enable Code Coverage report for master branch | ||
|
@@ -110,19 +116,19 @@ jobs: | |
echo 'export CODE_COVERAGE=true' >> $BASH_ENV | ||
source $BASH_ENV | ||
fi | ||
- run: sudo npm install --global --force [email protected] | ||
- run: | ||
name: Install npm dependencies | ||
command: | | ||
npm ci | ||
name: Install frontend dependencies | ||
command: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- run: | ||
name: Setup Redash server | ||
command: | | ||
npm run cypress build | ||
npm run cypress start -- --skip-db-seed | ||
docker-compose run cypress npm run cypress db-seed | ||
yarn cypress build | ||
yarn cypress start -- --skip-db-seed | ||
docker-compose run cypress yarn cypress db-seed | ||
- run: | ||
name: Execute Cypress tests | ||
command: npm run cypress run-ci | ||
command: yarn cypress run-ci | ||
- run: | ||
name: "Failure: output container logs to console" | ||
command: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v14.16.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
FROM node:12 as frontend-builder | ||
FROM node:14.17 as frontend-builder | ||
|
||
RUN npm install --global --force [email protected] | ||
|
||
# Controls whether to build the frontend assets | ||
ARG skip_frontend_build | ||
|
@@ -10,20 +12,20 @@ RUN useradd -m -d /frontend redash | |
USER redash | ||
|
||
WORKDIR /frontend | ||
COPY --chown=redash package.json package-lock.json /frontend/ | ||
COPY --chown=redash package.json yarn.lock .yarnrc /frontend/ | ||
COPY --chown=redash viz-lib /frontend/viz-lib | ||
|
||
# Controls whether to instrument code for coverage information | ||
ARG code_coverage | ||
ENV BABEL_ENV=${code_coverage:+test} | ||
|
||
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm ci --unsafe-perm; fi | ||
RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn --frozen-lockfile --network-concurrency 1; fi | ||
|
||
COPY --chown=redash client /frontend/client | ||
COPY --chown=redash webpack.config.js /frontend/ | ||
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm run build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi | ||
RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi | ||
|
||
FROM python:3.7-slim-buster | ||
FROM python:3.7-slim | ||
|
||
EXPOSE 5000 | ||
|
||
|
@@ -58,7 +60,7 @@ RUN apt-get update && \ | |
libsasl2-dev \ | ||
unzip \ | ||
libsasl2-modules-gssapi-mit && \ | ||
# MSSQL ODBC Driver: | ||
# MSSQL ODBC Driver: | ||
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ | ||
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ | ||
apt-get update && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
[build] | ||
base = "client" | ||
publish = "client/dist" | ||
command = "npm ci && npm run build" | ||
# Netlify doesn't seem to install Yarn even though NETLIFY_USE_YARN is set below | ||
# command = "cd ../ && npm i -g [email protected] && yarn --frozen-lockfile --force && cd viz-lib && yarn build:babel && cd .. && rm -r ./node_modules/@redash/viz && cp -r ./viz-lib/. ./node_modules/@redash/viz && yarn build && cd ./client" | ||
command = "cd ../ && npm i -g [email protected] && yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 && yarn build && cd ./client" | ||
|
||
[build.environment] | ||
NODE_VERSION = "12.18.4" | ||
NODE_VERSION = "14.16.1" | ||
NETLIFY_USE_YARN = "true" | ||
YARN_VERSION = "1.22.10" | ||
CYPRESS_INSTALL_BINARY = "0" | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = "1" | ||
|
||
|
Oops, something went wrong.