Skip to content

Commit 6b761d5

Browse files
authored
chore: remove centos7 dockerfile for image living in cypress dockerhub (cypress/centos7-builder) [run ci] (#29918)
1 parent 3df6bdb commit 6b761d5

File tree

2 files changed

+10
-61
lines changed

2 files changed

+10
-61
lines changed

.circleci/workflows.yml

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mainBuildFilters: &mainBuildFilters
3232
- 'update-v8-snapshot-cache-on-develop'
3333
- 'remove-json-lint'
3434
- 'publish-binary'
35-
- 'fix/webpack-batteries-included-for-yarn-pnp'
35+
- 'chore/use_build_docker_file_for_centos7'
3636

3737
# usually we don't build Mac app - it takes a long time
3838
# but sometimes we want to really confirm we are doing the right thing
@@ -54,7 +54,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
5454
- equal: [ develop, << pipeline.git.branch >> ]
5555
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
5656
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
57-
- equal: [ 'fix/webpack-batteries-included-for-yarn-pnp', << pipeline.git.branch >> ]
57+
- equal: [ 'chore/use_build_docker_file_for_centos7', << pipeline.git.branch >> ]
5858
- matches:
5959
pattern: /^release\/\d+\.\d+\.\d+$/
6060
value: << pipeline.git.branch >>
@@ -153,7 +153,7 @@ commands:
153153
name: Set environment variable to determine whether or not to persist artifacts
154154
command: |
155155
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
156-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "fix/webpack-batteries-included-for-yarn-pnp" ]]; then
156+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "chore/use_build_docker_file_for_centos7" ]]; then
157157
export SHOULD_PERSIST_ARTIFACTS=true
158158
fi' >> "$BASH_ENV"
159159
# You must run `setup_should_persist_artifacts` command and be using bash before running this command
@@ -362,7 +362,7 @@ commands:
362362
steps:
363363
- restore_cache:
364364
name: Restore cache state, to check for known modules cache existence
365-
key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-{{ checksum "centos7-builder.Dockerfile" }}
365+
key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-centos7
366366
- unless:
367367
condition: <<parameters.build-better-sqlite3>>
368368
steps:
@@ -421,7 +421,7 @@ commands:
421421
steps:
422422
- save_cache:
423423
name: Saving node-modules cache state key
424-
key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-{{ checksum "centos7-builder.Dockerfile" }}
424+
key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-centos7
425425
paths:
426426
- node_modules_installed
427427
- unless:
@@ -515,45 +515,22 @@ commands:
515515
echo "Google Chrome Version: `google-chrome-<<parameters.channel>> --version`"
516516
517517
# This code builds better-sqlite3 on CentOS 7. This is necessary because CentOS 7 has the oldest glibc version
518-
# that we support. The script checks for the existence of the Centos7-builder image tar file, and skips if it already
519-
# exists. If you want to rebuild the image, set the REBUILD_CENTOS_BUILDER_IMAGE environment variable to any value.
518+
# that we support. This job uses the cypress/centos7-builder https://hub.docker.com/repository/docker/cypress/centos7-builder/general
519+
# image to build better-sqlite3 against an older version of glibc (2.17).
520520
# Since this is running Docker remote, we need to copy the project into the container, and copy the built plugin out
521521
# of the container because the host running docker does not have access to the project directory so volume mounts are
522522
# not possible. The built plugin is copied to the project directory so it can be injected into the final binary.
523523
build-better-sqlite3:
524524
description: Build better-sqlite3 for CentOS 7
525525
steps:
526526
- setup_remote_docker
527-
- restore_cache:
528-
keys:
529-
- cypress-centos7-builder-{{ checksum "centos7-builder.Dockerfile" }}
530-
- restore_cache:
531-
keys:
532-
- better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-{{ checksum "centos7-builder.Dockerfile" }}
533527
- run:
534-
name: Build or load centos7-builder image
528+
name: Build better-sqlite3 for CentOS 7
535529
command: |
536530
if [[ ! -f better_sqlite3.node ]]; then
537531
set -x
538532
apt update && apt install -y docker.io
539-
if [[ ! -f centos7-builder.tar || -n $REBUILD_CENTOS_BUILDER_IMAGE ]]; then
540-
echo "*" > .dockerignore
541-
docker build -t centos7-builder -f centos7-builder.Dockerfile .
542-
docker save centos7-builder > centos7-builder.tar
543-
rm .dockerignore
544-
else
545-
docker load < centos7-builder.tar
546-
fi
547-
fi
548-
- save_cache:
549-
key: cypress-centos7-builder-{{ checksum "centos7-builder.Dockerfile" }}
550-
paths:
551-
- centos7-builder.tar
552-
- run:
553-
name: Build better-sqlite3 for CentOS 7
554-
command: |
555-
if [[ ! -f better_sqlite3.node ]]; then
556-
docker run -d --name centos7-builder centos7-builder /bin/bash -c "sleep 1000000000"
533+
docker run -d --name centos7-builder cypress/centos7-builder:latest /bin/bash -c "sleep 1000000000"
557534
docker cp ~/cypress/node_modules/better-sqlite3 centos7-builder:/better-sqlite3
558535
docker exec -it centos7-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 27.1.3 --include-regex 'better_sqlite3.node$'"
559536
docker cp centos7-builder:/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
@@ -563,7 +540,7 @@ commands:
563540
cp ~/cypress/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
564541
fi
565542
- save_cache:
566-
key: better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-{{ checksum "centos7-builder.Dockerfile" }}
543+
key: better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-centos7
567544
paths:
568545
- better_sqlite3.node
569546
- run:

centos7-builder.Dockerfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)