From 3ac5f78f75a02ac974a806f95638e044e16f760e Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 15:33:11 -0500 Subject: [PATCH 01/20] Convert a custom clone command to checkout --- src/process/ProcessFile.ts | 9 +++++++++ src/test-tool/fixture/with-cache.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index 177e697b..f6ef4e89 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -134,6 +134,15 @@ export default class ProcessFile { }; } + const clonePattern = /git clone .* \$CIRCLE_REPOSITORY_URL/; + if ( + (typeof step?.run === 'string' && step.run.match(clonePattern)) || + (typeof step?.run !== 'string' && + step?.run?.command?.match(clonePattern)) + ) { + return 'checkout'; + } + return step; }); diff --git a/src/test-tool/fixture/with-cache.yml b/src/test-tool/fixture/with-cache.yml index f24813db..85d39525 100644 --- a/src/test-tool/fixture/with-cache.yml +++ b/src/test-tool/fixture/with-cache.yml @@ -9,7 +9,7 @@ jobs: set-up-dependencies: executor: default-executor steps: - - checkout + - run: git clone --depth 1 --verbose $CIRCLE_REPOSITORY_URL - restore_cache: keys: From 13d076de93e1a39cd577c5dfb71ab389ad50e118 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 15:43:26 -0500 Subject: [PATCH 02/20] Add a comment about isCustomClone() --- src/process/ProcessFile.ts | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index f6ef4e89..8698150f 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -134,12 +134,7 @@ export default class ProcessFile { }; } - const clonePattern = /git clone .* \$CIRCLE_REPOSITORY_URL/; - if ( - (typeof step?.run === 'string' && step.run.match(clonePattern)) || - (typeof step?.run !== 'string' && - step?.run?.command?.match(clonePattern)) - ) { + if (this.isCustomClone(step)) { return 'checkout'; } @@ -175,7 +170,7 @@ export default class ProcessFile { * * https://circleci.com/developer/orbs/orb/circleci/path-filtering#commands */ - private getOutputPath(steps: Job['steps']): string | undefined { + getOutputPath(steps: Job['steps']): string | undefined { if (!steps) { return; } @@ -192,7 +187,7 @@ export default class ProcessFile { } } - private getPersistToWorkspaceCommand(step: FullStep): string | undefined { + getPersistToWorkspaceCommand(step: FullStep): string | undefined { if (typeof step?.persist_to_workspace?.paths === 'string') { const pathToPersist = path.join( step?.persist_to_workspace?.root ?? '.', @@ -217,7 +212,7 @@ export default class ProcessFile { ); } - private getEnsureVolumeIsWritableStep() { + getEnsureVolumeIsWritableStep() { return { run: { name: 'Ensure volume is writable', @@ -228,4 +223,21 @@ export default class ProcessFile { }, }; } + + /** + * Gets whether there's a custom `git clone` command. + * + * Local CI doesn't work with that. + * The idea of Local CI is to use your local commits, not to git clone from the remote repo. + * So this will find if there's a custom `git clone` command, + * so it can replace it with `checkout`. + */ + isCustomClone(step: FullStep): boolean { + const clonePattern = /git clone[^\n]+\$CIRCLE_REPOSITORY_URL/; + return ( + (typeof step?.run === 'string' && !!step.run.match(clonePattern)) || + (typeof step?.run !== 'string' && + !!step?.run?.command?.match(clonePattern)) + ); + } } From d309bd40334993502d3786472ac89d7b01769c24 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 15:50:51 -0500 Subject: [PATCH 03/20] Add a comment that the CLI handles checkout well --- src/process/ProcessFile.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index 8698150f..8f512eb3 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -231,6 +231,7 @@ export default class ProcessFile { * The idea of Local CI is to use your local commits, not to git clone from the remote repo. * So this will find if there's a custom `git clone` command, * so it can replace it with `checkout`. + * The CLI handles `checkout` well. */ isCustomClone(step: FullStep): boolean { const clonePattern = /git clone[^\n]+\$CIRCLE_REPOSITORY_URL/; From 21b8872e375498ab384ac6ced123771926f0c861 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 15:52:54 -0500 Subject: [PATCH 04/20] Change the JSDoc block summary --- src/process/ProcessFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index 8f512eb3..45703a7d 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -225,7 +225,7 @@ export default class ProcessFile { } /** - * Gets whether there's a custom `git clone` command. + * Gets whether this is a custom `git clone` command. * * Local CI doesn't work with that. * The idea of Local CI is to use your local commits, not to git clone from the remote repo. From 4fdd0171d1515a32cc342b86d432a59fc748371f Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 18:16:34 -0500 Subject: [PATCH 05/20] Fix how this cleans up images Cleaning up at the end didn't work at all. --- src/script/cleanUpCommittedImages.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/script/cleanUpCommittedImages.sh b/src/script/cleanUpCommittedImages.sh index 3c013847..ec580959 100644 --- a/src/script/cleanUpCommittedImages.sh +++ b/src/script/cleanUpCommittedImages.sh @@ -2,21 +2,18 @@ # shellcheck disable=SC2154 lci_images=$(docker images -q "$lci_image_pattern") -echo "$local_ci_images" | while read -r image +echo "$lci_images" | while read -r image do - if [ "$lci_image_to_exclude" = "$image" ] + if [ ! "$image" ] || [ "$lci_image_to_exclude" = "$image" ] then continue fi lci_containers=$(docker ps --filter ancestor="$image" -q) - if [ -n "$lci_containers" ] + if [ "$lci_containers" ] then - docker stop "$lci_containers" - docker rm "$lci_containers" + echo "$lci_containers" | xargs docker stop + echo "$lci_containers" | xargs docker rm fi -done -if [ "$lci_images" ] - then - docker rmi "$lci_images" -fi + docker rmi "$image" +done From 1f36e00073a19f142da3344c36c1c5fbd2b7b2ab Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 19:17:26 -0500 Subject: [PATCH 06/20] Echo that this is persisting --- src/config/getAttachWorkspaceCommand.ts | 1 + src/process/ProcessFile.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config/getAttachWorkspaceCommand.ts b/src/config/getAttachWorkspaceCommand.ts index 708111cc..b0261f7c 100644 --- a/src/config/getAttachWorkspaceCommand.ts +++ b/src/config/getAttachWorkspaceCommand.ts @@ -16,6 +16,7 @@ export default function getAttachWorkspaceCommand(step: Step): string { then echo "Warning: tried to attach_workspace to ${CONTAINER_STORAGE_DIRECTORY}, but it's empty. It might require a job to run before it." else + echo "Attaching ${attachFrom}" cp -rn ${attachFrom} ${step?.attach_workspace?.at} || cp -ru ${attachFrom} ${step?.attach_workspace?.at} fi`; } diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index 45703a7d..bea2c028 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -195,7 +195,8 @@ export default class ProcessFile { ); // BusyBox doesn't have the -n option. - return `cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; + return `echo "Persisting ${pathToPersist}" + cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; } return step?.persist_to_workspace?.paths.reduce( @@ -206,7 +207,8 @@ export default class ProcessFile { ); // BusyBox doesn't have the -n option. - return `${accumulator} cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; + return `${accumulator} echo "Persisting ${pathToPersist}" + cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; }, '' ); From c975cfa053a9124563a1f8eb49dbf631f681de6f Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 19:36:34 -0500 Subject: [PATCH 07/20] Echo that this is persisting or attaching --- src/common/test/getAttachWorkspaceCommand.spec.ts | 1 + src/test-tool/expected/with-cache.yml | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/common/test/getAttachWorkspaceCommand.spec.ts b/src/common/test/getAttachWorkspaceCommand.spec.ts index 1429aeab..d0a15648 100644 --- a/src/common/test/getAttachWorkspaceCommand.spec.ts +++ b/src/common/test/getAttachWorkspaceCommand.spec.ts @@ -20,6 +20,7 @@ describe('getAttachWorkspaceCommand', () => { then echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else + echo "Attaching /tmp/local-ci/." cp -rn /tmp/local-ci/. /foo/baz || cp -ru /tmp/local-ci/. /foo/baz fi` ) diff --git a/src/test-tool/expected/with-cache.yml b/src/test-tool/expected/with-cache.yml index 6b571496..7cb63b99 100644 --- a/src/test-tool/expected/with-cache.yml +++ b/src/test-tool/expected/with-cache.yml @@ -79,7 +79,9 @@ jobs: fi - run: name: Persist to workspace - command: cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci + command: |- + echo "Persisting ." + cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci run-prettier: executor: default-executor steps: @@ -107,6 +109,7 @@ jobs: then echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else + echo "Attaching /tmp/local-ci/." cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: @@ -153,6 +156,7 @@ jobs: then echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else + echo "Attaching /tmp/local-ci/." cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: @@ -185,6 +189,7 @@ jobs: then echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else + echo "Attaching /tmp/local-ci/." cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: @@ -217,6 +222,7 @@ jobs: then echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else + echo "Attaching /tmp/local-ci/." cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: @@ -276,6 +282,7 @@ jobs: then echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else + echo "Attaching /tmp/local-ci/." cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: @@ -283,7 +290,9 @@ jobs: command: npm run build - run: name: Persist to workspace - command: cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci + command: |- + echo "Persisting ." + cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci verify-bundles-sizes: executor: default-executor steps: @@ -311,6 +320,7 @@ jobs: then echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else + echo "Attaching /tmp/local-ci/." cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: @@ -343,6 +353,7 @@ jobs: then echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else + echo "Attaching /tmp/local-ci/." cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: From 3765602335a3d5d3fbcee6706b2486662868d6e1 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 19:39:11 -0500 Subject: [PATCH 08/20] Don't run tests on out/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 923ac0b5..896565f9 100644 --- a/package.json +++ b/package.json @@ -271,7 +271,7 @@ "lint:js": "eslint src --ext ts", "lint:fix": "npm run lint:js -- --fix", "lint:sh": "shellcheck src/script/*.sh", - "test": "jest", + "test": "jest src", "test:watch": "jest --watch" }, "devDependencies": { From 0e43ca78653a9a10391b608ab63cd8e321cc01f4 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 21:13:53 -0500 Subject: [PATCH 09/20] Use rsync instead of cp -r --- src/cache/getSaveCacheCommand.ts | 2 +- src/cache/test/getRestoreCacheCommand.test.ts | 10 ++--- .../test/getAttachWorkspaceCommand.spec.ts | 2 +- src/config/getAttachWorkspaceCommand.ts | 2 +- src/process/ProcessFile.ts | 4 +- src/script/restoreCache.sh | 4 +- src/test-tool/expected/with-cache.yml | 42 +++++++++---------- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/cache/getSaveCacheCommand.ts b/src/cache/getSaveCacheCommand.ts index 5b5d9131..2abd4926 100644 --- a/src/cache/getSaveCacheCommand.ts +++ b/src/cache/getSaveCacheCommand.ts @@ -24,7 +24,7 @@ export default function getSaveCacheCommand( else echo "Saving ${directory} to the cache" mkdir -p ${destination} - cp -rn ${directory} ${destinationWhenCopied} || cp -ru ${directory} ${destinationWhenCopied} + rsync --copy-links ${directory} ${destinationWhenCopied} fi \n`; }, ''); } diff --git a/src/cache/test/getRestoreCacheCommand.test.ts b/src/cache/test/getRestoreCacheCommand.test.ts index 22f20444..81177837 100644 --- a/src/cache/test/getRestoreCacheCommand.test.ts +++ b/src/cache/test/getRestoreCacheCommand.test.ts @@ -32,7 +32,7 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -44,7 +44,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` @@ -83,7 +83,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -94,8 +94,8 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory; + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname; break; fi done` diff --git a/src/common/test/getAttachWorkspaceCommand.spec.ts b/src/common/test/getAttachWorkspaceCommand.spec.ts index d0a15648..65e0ec4e 100644 --- a/src/common/test/getAttachWorkspaceCommand.spec.ts +++ b/src/common/test/getAttachWorkspaceCommand.spec.ts @@ -21,7 +21,7 @@ describe('getAttachWorkspaceCommand', () => { echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. /foo/baz || cp -ru /tmp/local-ci/. /foo/baz + rsync --copy-links /tmp/local-ci/. /foo/baz fi` ) ); diff --git a/src/config/getAttachWorkspaceCommand.ts b/src/config/getAttachWorkspaceCommand.ts index b0261f7c..80117df4 100644 --- a/src/config/getAttachWorkspaceCommand.ts +++ b/src/config/getAttachWorkspaceCommand.ts @@ -17,6 +17,6 @@ export default function getAttachWorkspaceCommand(step: Step): string { echo "Warning: tried to attach_workspace to ${CONTAINER_STORAGE_DIRECTORY}, but it's empty. It might require a job to run before it." else echo "Attaching ${attachFrom}" - cp -rn ${attachFrom} ${step?.attach_workspace?.at} || cp -ru ${attachFrom} ${step?.attach_workspace?.at} + rsync --copy-links ${attachFrom} ${step?.attach_workspace?.at} fi`; } diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index bea2c028..da33ffd3 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -196,7 +196,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `echo "Persisting ${pathToPersist}" - cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; + rsync --copy-links ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; } return step?.persist_to_workspace?.paths.reduce( @@ -208,7 +208,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `${accumulator} echo "Persisting ${pathToPersist}" - cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; + rsync --copy-links ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; }, '' ); diff --git a/src/script/restoreCache.sh b/src/script/restoreCache.sh index 7c0ddd7c..c637ae63 100644 --- a/src/script/restoreCache.sh +++ b/src/script/restoreCache.sh @@ -6,8 +6,8 @@ for directory_candidate in $restore_from_directories if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" break; fi done diff --git a/src/test-tool/expected/with-cache.yml b/src/test-tool/expected/with-cache.yml index 7cb63b99..33717a4e 100644 --- a/src/test-tool/expected/with-cache.yml +++ b/src/test-tool/expected/with-cache.yml @@ -32,8 +32,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -44,9 +44,9 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; - break; + echo "Restoring cached directory $verified_directory" + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" + break fi done - run: @@ -64,7 +64,7 @@ jobs: else echo "Saving ~/.npm to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -rn ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -ru ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm + rsync --copy-links ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -ru ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm fi if [ -d /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache ] then @@ -75,13 +75,13 @@ jobs: else echo "Saving ~/.cache to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -rn ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -ru ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache + rsync --copy-links ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -ru ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache fi - run: name: Persist to workspace command: |- echo "Persisting ." - cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci + rsync --copy-links . /tmp/local-ci run-prettier: executor: default-executor steps: @@ -110,7 +110,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + rsync --copy-links /tmp/local-ci/. . fi - run: name: Run prettier check on project files @@ -127,7 +127,7 @@ jobs: else echo "Saving node_modules to the cache" mkdir -p /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -rn node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -ru node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules + rsync --copy-links node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -ru node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules fi run-linter: executor: default-executor @@ -157,7 +157,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + rsync --copy-links /tmp/local-ci/. . fi - run: name: Run linter @@ -190,7 +190,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + rsync --copy-links /tmp/local-ci/. . fi - run: name: Run unit tests @@ -223,7 +223,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + rsync --copy-links /tmp/local-ci/. . fi - run: name: Restore cache @@ -235,8 +235,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -247,8 +247,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -283,7 +283,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + rsync --copy-links /tmp/local-ci/. . fi - run: name: Build @@ -292,7 +292,7 @@ jobs: name: Persist to workspace command: |- echo "Persisting ." - cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci + rsync --copy-links . /tmp/local-ci verify-bundles-sizes: executor: default-executor steps: @@ -321,7 +321,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + rsync --copy-links /tmp/local-ci/. . fi - run: name: Check bundles sizes @@ -354,7 +354,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + rsync --copy-links /tmp/local-ci/. . fi - run: name: Firebase deploy From d1353fc8fbaa9ac75472f1a1b166b71887074977 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 21:14:06 -0500 Subject: [PATCH 10/20] Revert "Use rsync instead of cp -r" This reverts commit 0e43ca78653a9a10391b608ab63cd8e321cc01f4. --- src/cache/getSaveCacheCommand.ts | 2 +- src/cache/test/getRestoreCacheCommand.test.ts | 10 ++--- .../test/getAttachWorkspaceCommand.spec.ts | 2 +- src/config/getAttachWorkspaceCommand.ts | 2 +- src/process/ProcessFile.ts | 4 +- src/script/restoreCache.sh | 4 +- src/test-tool/expected/with-cache.yml | 42 +++++++++---------- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/cache/getSaveCacheCommand.ts b/src/cache/getSaveCacheCommand.ts index 2abd4926..5b5d9131 100644 --- a/src/cache/getSaveCacheCommand.ts +++ b/src/cache/getSaveCacheCommand.ts @@ -24,7 +24,7 @@ export default function getSaveCacheCommand( else echo "Saving ${directory} to the cache" mkdir -p ${destination} - rsync --copy-links ${directory} ${destinationWhenCopied} + cp -rn ${directory} ${destinationWhenCopied} || cp -ru ${directory} ${destinationWhenCopied} fi \n`; }, ''); } diff --git a/src/cache/test/getRestoreCacheCommand.test.ts b/src/cache/test/getRestoreCacheCommand.test.ts index 81177837..22f20444 100644 --- a/src/cache/test/getRestoreCacheCommand.test.ts +++ b/src/cache/test/getRestoreCacheCommand.test.ts @@ -32,7 +32,7 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -44,7 +44,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` @@ -83,7 +83,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -94,8 +94,8 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory; - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname; + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` diff --git a/src/common/test/getAttachWorkspaceCommand.spec.ts b/src/common/test/getAttachWorkspaceCommand.spec.ts index 65e0ec4e..d0a15648 100644 --- a/src/common/test/getAttachWorkspaceCommand.spec.ts +++ b/src/common/test/getAttachWorkspaceCommand.spec.ts @@ -21,7 +21,7 @@ describe('getAttachWorkspaceCommand', () => { echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - rsync --copy-links /tmp/local-ci/. /foo/baz + cp -rn /tmp/local-ci/. /foo/baz || cp -ru /tmp/local-ci/. /foo/baz fi` ) ); diff --git a/src/config/getAttachWorkspaceCommand.ts b/src/config/getAttachWorkspaceCommand.ts index 80117df4..b0261f7c 100644 --- a/src/config/getAttachWorkspaceCommand.ts +++ b/src/config/getAttachWorkspaceCommand.ts @@ -17,6 +17,6 @@ export default function getAttachWorkspaceCommand(step: Step): string { echo "Warning: tried to attach_workspace to ${CONTAINER_STORAGE_DIRECTORY}, but it's empty. It might require a job to run before it." else echo "Attaching ${attachFrom}" - rsync --copy-links ${attachFrom} ${step?.attach_workspace?.at} + cp -rn ${attachFrom} ${step?.attach_workspace?.at} || cp -ru ${attachFrom} ${step?.attach_workspace?.at} fi`; } diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index da33ffd3..bea2c028 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -196,7 +196,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `echo "Persisting ${pathToPersist}" - rsync --copy-links ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; + cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; } return step?.persist_to_workspace?.paths.reduce( @@ -208,7 +208,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `${accumulator} echo "Persisting ${pathToPersist}" - rsync --copy-links ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; + cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; }, '' ); diff --git a/src/script/restoreCache.sh b/src/script/restoreCache.sh index c637ae63..7c0ddd7c 100644 --- a/src/script/restoreCache.sh +++ b/src/script/restoreCache.sh @@ -6,8 +6,8 @@ for directory_candidate in $restore_from_directories if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done diff --git a/src/test-tool/expected/with-cache.yml b/src/test-tool/expected/with-cache.yml index 33717a4e..7cb63b99 100644 --- a/src/test-tool/expected/with-cache.yml +++ b/src/test-tool/expected/with-cache.yml @@ -32,8 +32,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -44,9 +44,9 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" - break + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + break; fi done - run: @@ -64,7 +64,7 @@ jobs: else echo "Saving ~/.npm to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - rsync --copy-links ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -ru ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm + cp -rn ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -ru ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm fi if [ -d /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache ] then @@ -75,13 +75,13 @@ jobs: else echo "Saving ~/.cache to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - rsync --copy-links ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -ru ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache + cp -rn ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -ru ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache fi - run: name: Persist to workspace command: |- echo "Persisting ." - rsync --copy-links . /tmp/local-ci + cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci run-prettier: executor: default-executor steps: @@ -110,7 +110,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - rsync --copy-links /tmp/local-ci/. . + cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: name: Run prettier check on project files @@ -127,7 +127,7 @@ jobs: else echo "Saving node_modules to the cache" mkdir -p /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - rsync --copy-links node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -ru node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules + cp -rn node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -ru node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules fi run-linter: executor: default-executor @@ -157,7 +157,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - rsync --copy-links /tmp/local-ci/. . + cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: name: Run linter @@ -190,7 +190,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - rsync --copy-links /tmp/local-ci/. . + cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: name: Run unit tests @@ -223,7 +223,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - rsync --copy-links /tmp/local-ci/. . + cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: name: Restore cache @@ -235,8 +235,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -247,8 +247,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - rsync --copy-links "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -283,7 +283,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - rsync --copy-links /tmp/local-ci/. . + cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: name: Build @@ -292,7 +292,7 @@ jobs: name: Persist to workspace command: |- echo "Persisting ." - rsync --copy-links . /tmp/local-ci + cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci verify-bundles-sizes: executor: default-executor steps: @@ -321,7 +321,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - rsync --copy-links /tmp/local-ci/. . + cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: name: Check bundles sizes @@ -354,7 +354,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - rsync --copy-links /tmp/local-ci/. . + cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . fi - run: name: Firebase deploy From 9e6f58a7c9a2ce584a3697edb3230c2705d9261b Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 21:16:23 -0500 Subject: [PATCH 11/20] Add -L to cp to copy files from symlink, not just the links --- src/cache/getSaveCacheCommand.ts | 2 +- src/cache/test/getRestoreCacheCommand.test.ts | 8 ++--- .../test/getAttachWorkspaceCommand.spec.ts | 2 +- src/config/getAttachWorkspaceCommand.ts | 2 +- src/process/ProcessFile.ts | 4 +-- src/script/restoreCache.sh | 2 +- src/test-tool/expected/with-cache.yml | 32 +++++++++---------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/cache/getSaveCacheCommand.ts b/src/cache/getSaveCacheCommand.ts index 5b5d9131..e5f7897b 100644 --- a/src/cache/getSaveCacheCommand.ts +++ b/src/cache/getSaveCacheCommand.ts @@ -24,7 +24,7 @@ export default function getSaveCacheCommand( else echo "Saving ${directory} to the cache" mkdir -p ${destination} - cp -rn ${directory} ${destinationWhenCopied} || cp -ru ${directory} ${destinationWhenCopied} + cp -Lrn ${directory} ${destinationWhenCopied} || cp -Lru ${directory} ${destinationWhenCopied} fi \n`; }, ''); } diff --git a/src/cache/test/getRestoreCacheCommand.test.ts b/src/cache/test/getRestoreCacheCommand.test.ts index 22f20444..8088730a 100644 --- a/src/cache/test/getRestoreCacheCommand.test.ts +++ b/src/cache/test/getRestoreCacheCommand.test.ts @@ -32,7 +32,7 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -44,7 +44,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` @@ -83,7 +83,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -95,7 +95,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` diff --git a/src/common/test/getAttachWorkspaceCommand.spec.ts b/src/common/test/getAttachWorkspaceCommand.spec.ts index d0a15648..54833f2f 100644 --- a/src/common/test/getAttachWorkspaceCommand.spec.ts +++ b/src/common/test/getAttachWorkspaceCommand.spec.ts @@ -21,7 +21,7 @@ describe('getAttachWorkspaceCommand', () => { echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. /foo/baz || cp -ru /tmp/local-ci/. /foo/baz + cp -Lrn /tmp/local-ci/. /foo/baz || cp -Lru /tmp/local-ci/. /foo/baz fi` ) ); diff --git a/src/config/getAttachWorkspaceCommand.ts b/src/config/getAttachWorkspaceCommand.ts index b0261f7c..2309afdd 100644 --- a/src/config/getAttachWorkspaceCommand.ts +++ b/src/config/getAttachWorkspaceCommand.ts @@ -17,6 +17,6 @@ export default function getAttachWorkspaceCommand(step: Step): string { echo "Warning: tried to attach_workspace to ${CONTAINER_STORAGE_DIRECTORY}, but it's empty. It might require a job to run before it." else echo "Attaching ${attachFrom}" - cp -rn ${attachFrom} ${step?.attach_workspace?.at} || cp -ru ${attachFrom} ${step?.attach_workspace?.at} + cp -Lrn ${attachFrom} ${step?.attach_workspace?.at} || cp -Lru ${attachFrom} ${step?.attach_workspace?.at} fi`; } diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index bea2c028..9471f5bd 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -196,7 +196,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `echo "Persisting ${pathToPersist}" - cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; + cp -Lrn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -Lru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; } return step?.persist_to_workspace?.paths.reduce( @@ -208,7 +208,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `${accumulator} echo "Persisting ${pathToPersist}" - cp -rn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -ru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; + cp -Lrn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -Lru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; }, '' ); diff --git a/src/script/restoreCache.sh b/src/script/restoreCache.sh index 7c0ddd7c..36d806f0 100644 --- a/src/script/restoreCache.sh +++ b/src/script/restoreCache.sh @@ -7,7 +7,7 @@ for directory_candidate in $restore_from_directories then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done diff --git a/src/test-tool/expected/with-cache.yml b/src/test-tool/expected/with-cache.yml index 7cb63b99..608103ee 100644 --- a/src/test-tool/expected/with-cache.yml +++ b/src/test-tool/expected/with-cache.yml @@ -33,7 +33,7 @@ jobs: then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -45,7 +45,7 @@ jobs: then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -64,7 +64,7 @@ jobs: else echo "Saving ~/.npm to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -rn ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -ru ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm + cp -Lrn ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -Lru ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm fi if [ -d /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache ] then @@ -75,13 +75,13 @@ jobs: else echo "Saving ~/.cache to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -rn ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -ru ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache + cp -Lrn ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -Lru ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache fi - run: name: Persist to workspace command: |- echo "Persisting ." - cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci + cp -Lrn . /tmp/local-ci || cp -Lru . /tmp/local-ci run-prettier: executor: default-executor steps: @@ -110,7 +110,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . fi - run: name: Run prettier check on project files @@ -127,7 +127,7 @@ jobs: else echo "Saving node_modules to the cache" mkdir -p /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -rn node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -ru node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules + cp -Lrn node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -Lru node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules fi run-linter: executor: default-executor @@ -157,7 +157,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . fi - run: name: Run linter @@ -190,7 +190,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . fi - run: name: Run unit tests @@ -223,7 +223,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . fi - run: name: Restore cache @@ -236,7 +236,7 @@ jobs: then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -248,7 +248,7 @@ jobs: then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -283,7 +283,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . fi - run: name: Build @@ -292,7 +292,7 @@ jobs: name: Persist to workspace command: |- echo "Persisting ." - cp -rn . /tmp/local-ci || cp -ru . /tmp/local-ci + cp -Lrn . /tmp/local-ci || cp -Lru . /tmp/local-ci verify-bundles-sizes: executor: default-executor steps: @@ -321,7 +321,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . fi - run: name: Check bundles sizes @@ -354,7 +354,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -rn /tmp/local-ci/. . || cp -ru /tmp/local-ci/. . + cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . fi - run: name: Firebase deploy From efb7b172e458c451e0165a87baa59a7ed3650894 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 21:40:27 -0500 Subject: [PATCH 12/20] Remove -u in cp -Lru --- src/cache/getSaveCacheCommand.ts | 2 +- src/cache/test/getRestoreCacheCommand.test.ts | 8 ++--- .../test/getAttachWorkspaceCommand.spec.ts | 2 +- src/config/getAttachWorkspaceCommand.ts | 2 +- src/process/ProcessFile.ts | 4 +-- src/script/restoreCache.sh | 2 +- src/test-tool/expected/with-cache.yml | 32 +++++++++---------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/cache/getSaveCacheCommand.ts b/src/cache/getSaveCacheCommand.ts index e5f7897b..dd6d59fc 100644 --- a/src/cache/getSaveCacheCommand.ts +++ b/src/cache/getSaveCacheCommand.ts @@ -24,7 +24,7 @@ export default function getSaveCacheCommand( else echo "Saving ${directory} to the cache" mkdir -p ${destination} - cp -Lrn ${directory} ${destinationWhenCopied} || cp -Lru ${directory} ${destinationWhenCopied} + cp -Lr ${directory} ${destinationWhenCopied} || cp -Lr ${directory} ${destinationWhenCopied} fi \n`; }, ''); } diff --git a/src/cache/test/getRestoreCacheCommand.test.ts b/src/cache/test/getRestoreCacheCommand.test.ts index 8088730a..c450162e 100644 --- a/src/cache/test/getRestoreCacheCommand.test.ts +++ b/src/cache/test/getRestoreCacheCommand.test.ts @@ -32,7 +32,7 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -44,7 +44,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` @@ -83,7 +83,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -95,7 +95,7 @@ describe('getRestoreCacheCommand', () => { then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` diff --git a/src/common/test/getAttachWorkspaceCommand.spec.ts b/src/common/test/getAttachWorkspaceCommand.spec.ts index 54833f2f..3313dc5f 100644 --- a/src/common/test/getAttachWorkspaceCommand.spec.ts +++ b/src/common/test/getAttachWorkspaceCommand.spec.ts @@ -21,7 +21,7 @@ describe('getAttachWorkspaceCommand', () => { echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lrn /tmp/local-ci/. /foo/baz || cp -Lru /tmp/local-ci/. /foo/baz + cp -Lr /tmp/local-ci/. /foo/baz || cp -Lr /tmp/local-ci/. /foo/baz fi` ) ); diff --git a/src/config/getAttachWorkspaceCommand.ts b/src/config/getAttachWorkspaceCommand.ts index 2309afdd..a105d0a9 100644 --- a/src/config/getAttachWorkspaceCommand.ts +++ b/src/config/getAttachWorkspaceCommand.ts @@ -17,6 +17,6 @@ export default function getAttachWorkspaceCommand(step: Step): string { echo "Warning: tried to attach_workspace to ${CONTAINER_STORAGE_DIRECTORY}, but it's empty. It might require a job to run before it." else echo "Attaching ${attachFrom}" - cp -Lrn ${attachFrom} ${step?.attach_workspace?.at} || cp -Lru ${attachFrom} ${step?.attach_workspace?.at} + cp -Lr ${attachFrom} ${step?.attach_workspace?.at} || cp -Lr ${attachFrom} ${step?.attach_workspace?.at} fi`; } diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index 9471f5bd..c49707a1 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -196,7 +196,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `echo "Persisting ${pathToPersist}" - cp -Lrn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -Lru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; + cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; } return step?.persist_to_workspace?.paths.reduce( @@ -208,7 +208,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `${accumulator} echo "Persisting ${pathToPersist}" - cp -Lrn ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -Lru ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; + cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; }, '' ); diff --git a/src/script/restoreCache.sh b/src/script/restoreCache.sh index 36d806f0..36df3a02 100644 --- a/src/script/restoreCache.sh +++ b/src/script/restoreCache.sh @@ -7,7 +7,7 @@ for directory_candidate in $restore_from_directories then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done diff --git a/src/test-tool/expected/with-cache.yml b/src/test-tool/expected/with-cache.yml index 608103ee..c61c2c03 100644 --- a/src/test-tool/expected/with-cache.yml +++ b/src/test-tool/expected/with-cache.yml @@ -33,7 +33,7 @@ jobs: then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -45,7 +45,7 @@ jobs: then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -64,7 +64,7 @@ jobs: else echo "Saving ~/.npm to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lrn ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -Lru ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm + cp -Lr ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -Lr ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm fi if [ -d /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache ] then @@ -75,13 +75,13 @@ jobs: else echo "Saving ~/.cache to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lrn ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -Lru ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache + cp -Lr ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -Lr ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache fi - run: name: Persist to workspace command: |- echo "Persisting ." - cp -Lrn . /tmp/local-ci || cp -Lru . /tmp/local-ci + cp -Lr . /tmp/local-ci || cp -Lr . /tmp/local-ci run-prettier: executor: default-executor steps: @@ -110,7 +110,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . fi - run: name: Run prettier check on project files @@ -127,7 +127,7 @@ jobs: else echo "Saving node_modules to the cache" mkdir -p /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lrn node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -Lru node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules + cp -Lr node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -Lr node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules fi run-linter: executor: default-executor @@ -157,7 +157,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . fi - run: name: Run linter @@ -190,7 +190,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . fi - run: name: Run unit tests @@ -223,7 +223,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . fi - run: name: Restore cache @@ -236,7 +236,7 @@ jobs: then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -248,7 +248,7 @@ jobs: then verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lrn "$verified_directory" "$lci_restore_cache_dirname" || cp -Lru "$verified_directory" "$lci_restore_cache_dirname"; + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -283,7 +283,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . fi - run: name: Build @@ -292,7 +292,7 @@ jobs: name: Persist to workspace command: |- echo "Persisting ." - cp -Lrn . /tmp/local-ci || cp -Lru . /tmp/local-ci + cp -Lr . /tmp/local-ci || cp -Lr . /tmp/local-ci verify-bundles-sizes: executor: default-executor steps: @@ -321,7 +321,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . fi - run: name: Check bundles sizes @@ -354,7 +354,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lrn /tmp/local-ci/. . || cp -Lru /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . fi - run: name: Firebase deploy From e5d7587e739b03e3ce3244b4775b9f36f49c60e2 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 22:30:37 -0500 Subject: [PATCH 13/20] Remove the extra cp -Lr command --- src/cache/getSaveCacheCommand.ts | 2 +- src/cache/test/getRestoreCacheCommand.test.ts | 16 ++++---- .../test/getAttachWorkspaceCommand.spec.ts | 2 +- src/config/getAttachWorkspaceCommand.ts | 2 +- src/process/ProcessFile.ts | 4 +- src/script/restoreCache.sh | 4 +- src/test-tool/expected/with-cache.yml | 40 +++++++++---------- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/cache/getSaveCacheCommand.ts b/src/cache/getSaveCacheCommand.ts index dd6d59fc..5ff547ae 100644 --- a/src/cache/getSaveCacheCommand.ts +++ b/src/cache/getSaveCacheCommand.ts @@ -24,7 +24,7 @@ export default function getSaveCacheCommand( else echo "Saving ${directory} to the cache" mkdir -p ${destination} - cp -Lr ${directory} ${destinationWhenCopied} || cp -Lr ${directory} ${destinationWhenCopied} + cp -Lr ${directory} ${destinationWhenCopied} fi \n`; }, ''); } diff --git a/src/cache/test/getRestoreCacheCommand.test.ts b/src/cache/test/getRestoreCacheCommand.test.ts index c450162e..3259a728 100644 --- a/src/cache/test/getRestoreCacheCommand.test.ts +++ b/src/cache/test/getRestoreCacheCommand.test.ts @@ -31,8 +31,8 @@ describe('getRestoreCacheCommand', () => { do if [ "$(find "$directory_candidate" 2>/dev/null)" ] then - verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -43,8 +43,8 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done` @@ -82,8 +82,8 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -94,8 +94,8 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done` diff --git a/src/common/test/getAttachWorkspaceCommand.spec.ts b/src/common/test/getAttachWorkspaceCommand.spec.ts index 3313dc5f..4e329b20 100644 --- a/src/common/test/getAttachWorkspaceCommand.spec.ts +++ b/src/common/test/getAttachWorkspaceCommand.spec.ts @@ -21,7 +21,7 @@ describe('getAttachWorkspaceCommand', () => { echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. /foo/baz || cp -Lr /tmp/local-ci/. /foo/baz + cp -Lr /tmp/local-ci/. /foo/baz fi` ) ); diff --git a/src/config/getAttachWorkspaceCommand.ts b/src/config/getAttachWorkspaceCommand.ts index a105d0a9..6b1b8206 100644 --- a/src/config/getAttachWorkspaceCommand.ts +++ b/src/config/getAttachWorkspaceCommand.ts @@ -17,6 +17,6 @@ export default function getAttachWorkspaceCommand(step: Step): string { echo "Warning: tried to attach_workspace to ${CONTAINER_STORAGE_DIRECTORY}, but it's empty. It might require a job to run before it." else echo "Attaching ${attachFrom}" - cp -Lr ${attachFrom} ${step?.attach_workspace?.at} || cp -Lr ${attachFrom} ${step?.attach_workspace?.at} + cp -Lr ${attachFrom} ${step?.attach_workspace?.at} fi`; } diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index c49707a1..0c00c6c9 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -196,7 +196,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `echo "Persisting ${pathToPersist}" - cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; + cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; } return step?.persist_to_workspace?.paths.reduce( @@ -208,7 +208,7 @@ export default class ProcessFile { // BusyBox doesn't have the -n option. return `${accumulator} echo "Persisting ${pathToPersist}" - cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} || cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY} \n`; + cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}\n`; }, '' ); diff --git a/src/script/restoreCache.sh b/src/script/restoreCache.sh index 36df3a02..172e4460 100644 --- a/src/script/restoreCache.sh +++ b/src/script/restoreCache.sh @@ -6,8 +6,8 @@ for directory_candidate in $restore_from_directories if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done diff --git a/src/test-tool/expected/with-cache.yml b/src/test-tool/expected/with-cache.yml index c61c2c03..c2d6d9b0 100644 --- a/src/test-tool/expected/with-cache.yml +++ b/src/test-tool/expected/with-cache.yml @@ -32,8 +32,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -44,8 +44,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -64,7 +64,7 @@ jobs: else echo "Saving ~/.npm to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lr ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -Lr ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm + cp -Lr ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm fi if [ -d /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache ] then @@ -75,13 +75,13 @@ jobs: else echo "Saving ~/.cache to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lr ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -Lr ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache + cp -Lr ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache fi - run: name: Persist to workspace command: |- echo "Persisting ." - cp -Lr . /tmp/local-ci || cp -Lr . /tmp/local-ci + cp -Lr . /tmp/local-ci run-prettier: executor: default-executor steps: @@ -110,7 +110,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . fi - run: name: Run prettier check on project files @@ -127,7 +127,7 @@ jobs: else echo "Saving node_modules to the cache" mkdir -p /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lr node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -Lr node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules + cp -Lr node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules fi run-linter: executor: default-executor @@ -157,7 +157,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . fi - run: name: Run linter @@ -190,7 +190,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . fi - run: name: Run unit tests @@ -223,7 +223,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . fi - run: name: Restore cache @@ -235,8 +235,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -247,8 +247,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory"; - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" || cp -Lr "$verified_directory" "$lci_restore_cache_dirname"; + echo "Restoring cached directory $verified_directory" + cp -Lr "$verified_directory" "$lci_restore_cache_dirname" break; fi done @@ -283,7 +283,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . fi - run: name: Build @@ -292,7 +292,7 @@ jobs: name: Persist to workspace command: |- echo "Persisting ." - cp -Lr . /tmp/local-ci || cp -Lr . /tmp/local-ci + cp -Lr . /tmp/local-ci verify-bundles-sizes: executor: default-executor steps: @@ -321,7 +321,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . fi - run: name: Check bundles sizes @@ -354,7 +354,7 @@ jobs: echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." else echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . || cp -Lr /tmp/local-ci/. . + cp -Lr /tmp/local-ci/. . fi - run: name: Firebase deploy From 8cd749d1caa564b34a4eebff9efa802b7d62514c Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Mon, 17 Oct 2022 23:48:39 -0500 Subject: [PATCH 14/20] Add back in cp -ru in caching --- src/cache/getSaveCacheCommand.ts | 2 +- src/cache/test/getRestoreCacheCommand.test.ts | 16 ++++++++-------- src/script/restoreCache.sh | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cache/getSaveCacheCommand.ts b/src/cache/getSaveCacheCommand.ts index 5ff547ae..5b5d9131 100644 --- a/src/cache/getSaveCacheCommand.ts +++ b/src/cache/getSaveCacheCommand.ts @@ -24,7 +24,7 @@ export default function getSaveCacheCommand( else echo "Saving ${directory} to the cache" mkdir -p ${destination} - cp -Lr ${directory} ${destinationWhenCopied} + cp -rn ${directory} ${destinationWhenCopied} || cp -ru ${directory} ${destinationWhenCopied} fi \n`; }, ''); } diff --git a/src/cache/test/getRestoreCacheCommand.test.ts b/src/cache/test/getRestoreCacheCommand.test.ts index 3259a728..22f20444 100644 --- a/src/cache/test/getRestoreCacheCommand.test.ts +++ b/src/cache/test/getRestoreCacheCommand.test.ts @@ -31,8 +31,8 @@ describe('getRestoreCacheCommand', () => { do if [ "$(find "$directory_candidate" 2>/dev/null)" ] then - verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + verified_directory=$(find "$directory_candidate" | tail -n1) echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -43,8 +43,8 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` @@ -82,8 +82,8 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -94,8 +94,8 @@ describe('getRestoreCacheCommand', () => { if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done` diff --git a/src/script/restoreCache.sh b/src/script/restoreCache.sh index 172e4460..7c0ddd7c 100644 --- a/src/script/restoreCache.sh +++ b/src/script/restoreCache.sh @@ -6,8 +6,8 @@ for directory_candidate in $restore_from_directories if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done From 67b9bf3b8cd21956fd09bf5b9aa1bd55418f7a32 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 18 Oct 2022 00:52:14 -0500 Subject: [PATCH 15/20] Make Jest tests pass again --- src/test-tool/expected/with-cache.yml | 108 +++++++++++++------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/src/test-tool/expected/with-cache.yml b/src/test-tool/expected/with-cache.yml index c2d6d9b0..f6c323f3 100644 --- a/src/test-tool/expected/with-cache.yml +++ b/src/test-tool/expected/with-cache.yml @@ -32,8 +32,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -44,8 +44,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -64,7 +64,7 @@ jobs: else echo "Saving ~/.npm to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lr ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm + cp -rn ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm || cp -ru ~/.npm /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.npm fi if [ -d /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache ] then @@ -75,7 +75,7 @@ jobs: else echo "Saving ~/.cache to the cache" mkdir -p /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lr ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache + cp -rn ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache || cp -ru ~/.cache /tmp/local-ci/v2-deps-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/.cache fi - run: name: Persist to workspace @@ -111,7 +111,7 @@ jobs: else echo "Attaching /tmp/local-ci/." cp -Lr /tmp/local-ci/. . - fi + fi - run: name: Run prettier check on project files command: npm run prettier:check @@ -127,7 +127,7 @@ jobs: else echo "Saving node_modules to the cache" mkdir -p /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi ) - cp -Lr node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules + cp -rn node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules || cp -ru node_modules /tmp/local-ci/node-modules-$( if [ -f "package-lock.json" ]; then (shasum "package-lock.json" 2>/dev/null || sha256sum "package-lock.json" 2>/dev/null) | awk '{print $1}'; fi )/node_modules fi run-linter: executor: default-executor @@ -150,14 +150,14 @@ jobs: name: Attach workspace command: |- if [ ! -d /tmp/local-ci ] - then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." - elif [ ! "$(ls -A /tmp/local-ci)" ] then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." - else - echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." + elif [ ! "$(ls -A /tmp/local-ci)" ] + then + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." + else + echo "Attaching /tmp/local-ci/." + cp -Lr /tmp/local-ci/. . fi - run: name: Run linter @@ -183,14 +183,14 @@ jobs: name: Attach workspace command: |- if [ ! -d /tmp/local-ci ] - then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." - elif [ ! "$(ls -A /tmp/local-ci)" ] then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." - else - echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." + elif [ ! "$(ls -A /tmp/local-ci)" ] + then + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." + else + echo "Attaching /tmp/local-ci/." + cp -Lr /tmp/local-ci/. . fi - run: name: Run unit tests @@ -216,14 +216,14 @@ jobs: name: Attach workspace command: |- if [ ! -d /tmp/local-ci ] - then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." - elif [ ! "$(ls -A /tmp/local-ci)" ] then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." - else - echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." + elif [ ! "$(ls -A /tmp/local-ci)" ] + then + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." + else + echo "Attaching /tmp/local-ci/." + cp -Lr /tmp/local-ci/. . fi - run: name: Restore cache @@ -235,8 +235,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -247,8 +247,8 @@ jobs: if [ "$(find "$directory_candidate" 2>/dev/null)" ] then verified_directory=$(find "$directory_candidate" | tail -n1) - echo "Restoring cached directory $verified_directory" - cp -Lr "$verified_directory" "$lci_restore_cache_dirname" + echo "Restoring cached directory $verified_directory"; + cp -rn "$verified_directory" "$lci_restore_cache_dirname" || cp -ru "$verified_directory" "$lci_restore_cache_dirname"; break; fi done @@ -276,14 +276,14 @@ jobs: name: Attach workspace command: |- if [ ! -d /tmp/local-ci ] - then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." - elif [ ! "$(ls -A /tmp/local-ci)" ] then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." - else - echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." + elif [ ! "$(ls -A /tmp/local-ci)" ] + then + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." + else + echo "Attaching /tmp/local-ci/." + cp -Lr /tmp/local-ci/. . fi - run: name: Build @@ -314,14 +314,14 @@ jobs: name: Attach workspace command: |- if [ ! -d /tmp/local-ci ] - then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." - elif [ ! "$(ls -A /tmp/local-ci)" ] then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." - else - echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." + elif [ ! "$(ls -A /tmp/local-ci)" ] + then + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." + else + echo "Attaching /tmp/local-ci/." + cp -Lr /tmp/local-ci/. . fi - run: name: Check bundles sizes @@ -347,14 +347,14 @@ jobs: name: Attach workspace command: |- if [ ! -d /tmp/local-ci ] - then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." - elif [ ! "$(ls -A /tmp/local-ci)" ] then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." - else - echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. . + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." + elif [ ! "$(ls -A /tmp/local-ci)" ] + then + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." + else + echo "Attaching /tmp/local-ci/." + cp -Lr /tmp/local-ci/. . fi - run: name: Firebase deploy From 01b776d02789b1b38368d4aa8ce1fb66a32f5b0b Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 18 Oct 2022 01:36:57 -0500 Subject: [PATCH 16/20] Move the test for getAttachWorkspaceCommand to config/test --- .../test/getAttachWorkspaceCommand.spec.ts | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/common/test/getAttachWorkspaceCommand.spec.ts diff --git a/src/common/test/getAttachWorkspaceCommand.spec.ts b/src/common/test/getAttachWorkspaceCommand.spec.ts deleted file mode 100644 index 4e329b20..00000000 --- a/src/common/test/getAttachWorkspaceCommand.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import getAttachWorkspaceCommand from 'config/getAttachWorkspaceCommand'; -import normalize from 'test-tool/helper/normalize'; - -describe('getAttachWorkspaceCommand', () => { - test('no attach_workspace', () => { - expect(getAttachWorkspaceCommand({})).toEqual(''); - }); - - test('with attach_workspace', () => { - expect( - normalize( - getAttachWorkspaceCommand({ attach_workspace: { at: '/foo/baz' } }) - ) - ).toEqual( - normalize( - `if [ ! -d /tmp/local-ci ] - then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." - elif [ ! "$(ls -A /tmp/local-ci)" ] - then - echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." - else - echo "Attaching /tmp/local-ci/." - cp -Lr /tmp/local-ci/. /foo/baz - fi` - ) - ); - }); -}); From d1c502667d1e236bfa708d1150c4ed0a57e7fafa Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 18 Oct 2022 01:37:39 -0500 Subject: [PATCH 17/20] Add the test I forgot to stage --- .../test/getAttachWorkspaceCommand.spec.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/config/test/getAttachWorkspaceCommand.spec.ts diff --git a/src/config/test/getAttachWorkspaceCommand.spec.ts b/src/config/test/getAttachWorkspaceCommand.spec.ts new file mode 100644 index 00000000..4e329b20 --- /dev/null +++ b/src/config/test/getAttachWorkspaceCommand.spec.ts @@ -0,0 +1,29 @@ +import getAttachWorkspaceCommand from 'config/getAttachWorkspaceCommand'; +import normalize from 'test-tool/helper/normalize'; + +describe('getAttachWorkspaceCommand', () => { + test('no attach_workspace', () => { + expect(getAttachWorkspaceCommand({})).toEqual(''); + }); + + test('with attach_workspace', () => { + expect( + normalize( + getAttachWorkspaceCommand({ attach_workspace: { at: '/foo/baz' } }) + ) + ).toEqual( + normalize( + `if [ ! -d /tmp/local-ci ] + then + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's not a directory. It might require a job to run before it." + elif [ ! "$(ls -A /tmp/local-ci)" ] + then + echo "Warning: tried to attach_workspace to /tmp/local-ci, but it's empty. It might require a job to run before it." + else + echo "Attaching /tmp/local-ci/." + cp -Lr /tmp/local-ci/. /foo/baz + fi` + ) + ); + }); +}); From a43d1200d99ecf8a3e052e85237cfcb6e0c642ef Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 18 Oct 2022 01:40:23 -0500 Subject: [PATCH 18/20] Remove some comments that don't apply --- src/cache/getSaveCacheCommand.ts | 1 + src/config/getAttachWorkspaceCommand.ts | 1 - src/process/ProcessFile.ts | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cache/getSaveCacheCommand.ts b/src/cache/getSaveCacheCommand.ts index 5b5d9131..50d6350f 100644 --- a/src/cache/getSaveCacheCommand.ts +++ b/src/cache/getSaveCacheCommand.ts @@ -15,6 +15,7 @@ export default function getSaveCacheCommand( path.basename(directory) ); + // BusyBox doesn't allow cp -n. return `${accumulator} if [ -d ${destinationWhenCopied} ] then echo "${directory} is already cached, skipping" diff --git a/src/config/getAttachWorkspaceCommand.ts b/src/config/getAttachWorkspaceCommand.ts index 6b1b8206..8deb11b1 100644 --- a/src/config/getAttachWorkspaceCommand.ts +++ b/src/config/getAttachWorkspaceCommand.ts @@ -8,7 +8,6 @@ export default function getAttachWorkspaceCommand(step: Step): string { const attachFrom = `${path.join(CONTAINER_STORAGE_DIRECTORY, path.sep)}.`; - // BusyBox doesn't allow cp -n. return `if [ ! -d ${CONTAINER_STORAGE_DIRECTORY} ] then echo "Warning: tried to attach_workspace to ${CONTAINER_STORAGE_DIRECTORY}, but it's not a directory. It might require a job to run before it." diff --git a/src/process/ProcessFile.ts b/src/process/ProcessFile.ts index 0c00c6c9..f6720d27 100644 --- a/src/process/ProcessFile.ts +++ b/src/process/ProcessFile.ts @@ -194,7 +194,6 @@ export default class ProcessFile { step?.persist_to_workspace?.paths ); - // BusyBox doesn't have the -n option. return `echo "Persisting ${pathToPersist}" cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}`; } @@ -206,7 +205,6 @@ export default class ProcessFile { workspacePath ); - // BusyBox doesn't have the -n option. return `${accumulator} echo "Persisting ${pathToPersist}" cp -Lr ${pathToPersist} ${CONTAINER_STORAGE_DIRECTORY}\n`; }, From 90cfe9d3ad6caba3bb2c0e10b3a596408e3907cd Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 18 Oct 2022 01:59:00 -0500 Subject: [PATCH 19/20] Bump the version to 2.0.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24bd520d..fbde584f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "local-ci", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "local-ci", - "version": "2.0.0", + "version": "2.0.1", "hasInstallScript": true, "license": "GPL-2.0-or-later", "os": [ diff --git a/package.json b/package.json index 896565f9..6ae039eb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "local-ci", "displayName": "Local CI", "description": "Debug CircleCI® workflows locally, with Bash access during and after. Free preview, then paid.", - "version": "2.0.0", + "version": "2.0.1", "publisher": "LocalCI", "contributors": [ "Ryan Kienstra" From 1f059c07e8787fba942ff3ce345afb7b4e764d83 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 18 Oct 2022 02:00:36 -0500 Subject: [PATCH 20/20] Add a CHANGELOG entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa66070e..d19db7f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 2.0.1 - 18 October 2022 +- Replace custom checkout steps so they work in Local CI. [#216](https://github.com/getlocalci/local-ci/pull/216) +- Give feedback when persisting to workspace. [#217](https://github.com/getlocalci/local-ci/pull/217) + ## 2.0.0 - 17 October 2022 - Add a button 'Start Docker'. [#214](https://github.com/getlocalci/local-ci/pull/214) - Bump the binary version to the latest: v0.1.22272. [#212](https://github.com/getlocalci/local-ci/pull/212)