Skip to content

Commit 1fba39f

Browse files
committed
chore: remove unneeded caching
1 parent 47edb4e commit 1fba39f

File tree

2 files changed

+6
-84
lines changed

2 files changed

+6
-84
lines changed

.circleci/build-cli.sh

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
#! /bin/bash
22

3-
echo "Starting CLI build process"
3+
echo "Cloning CLI repo"
44
cd ~
5-
# If the CLI repo doesn't exist (due to caching), clone it
6-
if [ ! -d "cli" ]; then
7-
echo "Cloning CLI repo"
8-
git clone https://github.com/snyk/cli.git
9-
else
10-
echo "CLI repo already exists from cache"
11-
fi
12-
5+
git clone --depth 1 https://github.com/snyk/cli.git
136
cd cli
147
echo "Replacing snyk-docker-plugin dependency with SHA $CIRCLE_SHA1"
158
sed -iE "s/\"snyk-docker-plugin\": \".*\",/\"snyk-docker-plugin\": \"git:\/\/github.com\/snyk\/snyk-docker-plugin.git#$CIRCLE_SHA1\",/" package.json
16-
179
sudo npm i -g npm@7
18-
1910
echo "Running npm install"
2011
npm i
21-
2212
echo "Running build"
2313
npm run build
24-
25-
echo "Pruning git to save space"
26-
git gc --prune=now

.circleci/config.yml

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -188,57 +188,10 @@ jobs:
188188
- checkout
189189
- install_node_npm:
190190
node_version: << parameters.node_version >>
191-
192-
# Restore Docker images from cache early
193-
- restore_cache:
194-
keys:
195-
- v1-docker-images-{{ checksum "test/windows/plugin.spec.ts" }}
196-
- v1-docker-images- # Fallback to any docker cache
197-
198-
199-
200-
# Run npm ci and docker pull in parallel
201-
- run:
202-
name: Install dependencies and pull Docker images in parallel
203-
command: |
204-
# Start Docker operations in background
205-
echo "Starting Docker image pull in background..."
206-
(
207-
docker version
208-
.circleci/cache-python-docker.sh load
209-
echo $? > /tmp/docker-pull-exit-code
210-
) &
211-
DOCKER_PID=$!
212-
213-
# Run npm ci in foreground
214-
echo "Installing npm dependencies..."
215-
npm ci --loglevel verbose
216-
NPM_EXIT_CODE=$?
217-
218-
# Wait for Docker operations to complete
219-
echo "Waiting for Docker image pull to complete..."
220-
wait $DOCKER_PID
221-
222-
# Check exit codes
223-
DOCKER_EXIT_CODE=$(cat /tmp/docker-pull-exit-code 2>/dev/null || echo "1")
224-
rm -f /tmp/docker-pull-exit-code
225-
226-
if [ $NPM_EXIT_CODE -ne 0 ]; then
227-
echo "npm ci failed with exit code $NPM_EXIT_CODE"
228-
exit $NPM_EXIT_CODE
229-
fi
230-
231-
if [ $DOCKER_EXIT_CODE -ne 0 ]; then
232-
echo "Docker pull failed with exit code $DOCKER_EXIT_CODE"
233-
exit $DOCKER_EXIT_CODE
234-
fi
235-
236-
echo "Both npm ci and Docker pull completed successfully!"
237-
238-
- run:
239-
name: Pull Docker images if needed
240-
command: .circleci/cache-python-docker.sh pull
241191

192+
- setup_npm_user
193+
- run: npm ci --loglevel verbose
194+
# make docker appear to be broken.
242195
- run:
243196
name: Install JUnit coverage reporter
244197
command: npm install --no-save jest-junit
@@ -252,24 +205,14 @@ jobs:
252205
JEST_JUNIT_ADD_FILE_ATTRIBUTE: 'true' # We need this to make --split-by=timings work
253206
- store_test_results:
254207
path: reports
255-
256-
# Save Docker images to cache
257-
- run:
258-
name: Save Docker images to cache
259-
when: always
260-
command: .circleci/cache-python-docker.sh save
261-
262-
- save_cache:
263-
key: v1-docker-images-{{ checksum "test/windows/plugin.spec.ts" }}
264-
paths:
265-
- C:\docker-cache
266208
test_jest_windows_no_docker:
267209
<<: *windows_medium
268210
parallelism: 2 # Run tests across 2 containers
269211
steps:
270212
- checkout
271213
- install_node_npm:
272214
node_version: << parameters.node_version >>
215+
273216
- setup_npm_user
274217
- run: npm ci --loglevel verbose
275218
# make docker appear to be broken.
@@ -303,17 +246,9 @@ jobs:
303246
CLI_COMMIT_HASH=$(git ls-remote https://github.com/snyk/cli.git main | cut -f1)
304247
echo "CLI_COMMIT_HASH: $CLI_COMMIT_HASH"
305248
echo $CLI_COMMIT_HASH >> /tmp/cli-version
306-
- restore_cache:
307-
keys:
308-
- v1-cli-repo-{{ checksum "/tmp/cli-version" }}
309-
- v1-cli-repo-
310249
- run:
311250
name: Build Snyk CLI with latest changes
312251
command: ./.circleci/build-cli.sh
313-
- save_cache:
314-
key: v1-cli-repo-{{ checksum "/tmp/cli-version" }}
315-
paths:
316-
- ~/cli
317252
build_and_test_latest_go_binary:
318253
<<: *defaults
319254
resource_class: medium

0 commit comments

Comments
 (0)