Skip to content

Commit

Permalink
chore(deps): bump versions, remove yarn usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Ageev committed Jan 30, 2024
1 parent 332c6e0 commit cbdbc29
Show file tree
Hide file tree
Showing 9 changed files with 10,117 additions and 6,256 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
!jest.config.js
!jsconfig.json
!package.json
!yarn.lock
!package-lock.json
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 20.6
node-version: 21.6

- name: yarn
run: yarn --frozen-lockfile
- name: npm install
run: npm ci

- name: test
run: yarn run test
run: npm run test

- name: test check should succeed
run: |
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
check_report
- name: 'lint configs'
run: yarn prettier -c 'data/*'
run: npm run prettier -- -c 'data/*'

- name: lint
run: yarn run lint
run: npm run lint
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
/storage_tmp/
.env
*.tgz
/yarn-error.log
docker-compose.override.yaml
9 changes: 3 additions & 6 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Vyacheslav Artemiev <[email protected]>
Alexei Kochetov <[email protected]>
Ruslan Burkhanov <[email protected]>
Daniil Mikhailov <[email protected]>
Konstantin Sergievskiy <[email protected]>
Aleksey Shirokih <[email protected]>
Lev Galaktionov <[email protected]>
Nikita Popov <[email protected]>
Pavel Ageev <[email protected]>
32 changes: 15 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
override APPLICATION_NAME=purr
override NODE_VERSION=20.6
override NODE_VERSION=21.6

DOCKER_IMAGE?=ghcr.io/semrush/purr
DOCKER_TAG?=latest
CHECK_NAME:=example-com
SUITE_NAME:=example-com-suite

.PHONY: yarn-install
yarn-install:
.PHONY: npm-install
npm-install:
rm -r ${CURDIR}/node_modules || true
docker run --rm \
-v ${CURDIR}:/app \
-w /app \
--entrypoint yarn \
node:${NODE_VERSION} \
install --frozen-lockfile
npm ci

.PHONY: yarn-lint
yarn-lint:
.PHONY: vendor
vendor: npm-install

.PHONY: npm-lint
npm-lint:
docker run --rm \
-v ${CURDIR}:/app \
-w /app \
--entrypoint yarn \
node:${NODE_VERSION} \
run lint
npm run lint

.PHONY: lint
lint: yarn-lint
lint: npm-lint

.PHONY: yarn-test
yarn-test:
.PHONY: npm-test
npm-test:
docker run --rm \
-v ${CURDIR}:/app \
-w /app \
-e PUPPETEER_SKIP_DOWNLOAD=true \
--entrypoint yarn \
node:${NODE_VERSION} \
run test --bail
npm run test

.PHONY: test
test: yarn-test
test: npm-test

.PHONY: docker-build
docker-build:
Expand All @@ -61,7 +60,6 @@ docker-compose-down:
run-check: docker-build
rm -r ${CURDIR}/storage/* || true
docker run --rm \
-v ${CURDIR}:/app \
--env-file ${CURDIR}/.env \
${DOCKER_IMAGE}:${DOCKER_TAG} \
check $(CHECK_NAME)
Expand Down
32 changes: 19 additions & 13 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
ARG NODE_VERSION=20.6
ARG NODE_VERSION=21.6

FROM node:${NODE_VERSION} as vendor

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

WORKDIR /app

COPY package.json /app
COPY yarn.lock /app
COPY package-lock.json /app

RUN yarn install --frozen-lockfile --production=true
RUN npm ci --omit dev

FROM node:${NODE_VERSION}

RUN apt-get update && \
apt-get install -y --no-install-recommends \
chromium \
chromium-sandbox && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* || true

ARG CHROMIUM_VERSION=121.0.6167.85-1~deb12u1
ENV CHROMIUM_VERSION=${CHROMIUM_VERSION}
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium

RUN apt update && \
apt install -y --no-install-recommends \
chromium=${CHROMIUM_VERSION} \
chromium-sandbox=${CHROMIUM_VERSION} && \
apt clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* || true

USER node
WORKDIR /app

COPY jsconfig.json /app
COPY package.json /app
COPY package-lock.json /app
COPY --chown=node:node src /app/src
COPY --chown=node:node data /app/data
RUN chown node:node /app
COPY --from=vendor --chown=node:node /app/node_modules /app/node_modules

COPY --from=vendor /app/node_modules /app/node_modules

USER node
ENTRYPOINT ["/app/src/cli.js"]
Loading

0 comments on commit cbdbc29

Please sign in to comment.