From dd970333d8d9970d0b1f6ef189eba5a78f6f4c18 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 21:42:17 -0500 Subject: [PATCH 01/10] Ensure sudo is installed before calling it Do sudo -V, and check that there's a non-empty result. --- src/utils/writeProcessFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/writeProcessFile.ts b/src/utils/writeProcessFile.ts index 571c9bd5..f1f1dfb8 100644 --- a/src/utils/writeProcessFile.ts +++ b/src/utils/writeProcessFile.ts @@ -42,7 +42,7 @@ function getEnsureVolumeIsWritableStep() { return { run: { name: 'Ensure volume is writable', - command: `if [ "$(ls -ld ${CONTAINER_STORAGE_DIRECTORY} | awk '{print $3}')" != "$(whoami)" ] + command: `if [ "$(ls -ld ${CONTAINER_STORAGE_DIRECTORY} | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) ${CONTAINER_STORAGE_DIRECTORY} fi`, From 5993d114df5c82a6db8ae889df05eadef650fa26 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 21:47:44 -0500 Subject: [PATCH 02/10] Fix failed unit tests --- src/test/expected/dynamic-config.yml | 2 +- src/test/expected/with-cache.yml | 16 ++++++++-------- src/utils/writeProcessFile.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/expected/dynamic-config.yml b/src/test/expected/dynamic-config.yml index 4a73049f..b07db4d4 100644 --- a/src/test/expected/dynamic-config.yml +++ b/src/test/expected/dynamic-config.yml @@ -7,7 +7,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi diff --git a/src/test/expected/with-cache.yml b/src/test/expected/with-cache.yml index 1cacd5e8..017e432a 100644 --- a/src/test/expected/with-cache.yml +++ b/src/test/expected/with-cache.yml @@ -10,7 +10,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi @@ -84,7 +84,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi @@ -123,7 +123,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi @@ -148,7 +148,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi @@ -173,7 +173,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi @@ -223,7 +223,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi @@ -251,7 +251,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi @@ -276,7 +276,7 @@ jobs: - run: name: Ensure volume is writable command: |- - if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] + if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi diff --git a/src/utils/writeProcessFile.ts b/src/utils/writeProcessFile.ts index f1f1dfb8..c0bd62b8 100644 --- a/src/utils/writeProcessFile.ts +++ b/src/utils/writeProcessFile.ts @@ -42,7 +42,7 @@ function getEnsureVolumeIsWritableStep() { return { run: { name: 'Ensure volume is writable', - command: `if [ "$(ls -ld ${CONTAINER_STORAGE_DIRECTORY} | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] + command: `if [ "$(ls -ld ${CONTAINER_STORAGE_DIRECTORY} | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) ${CONTAINER_STORAGE_DIRECTORY} fi`, From 03a87b2fabfa7864a9acc3d5c5975d9364ff30ad Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 21:49:22 -0500 Subject: [PATCH 03/10] Set the resource_class in test to large --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index fd0607d9..8df1ee5a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,7 @@ jobs: - checkout - node/install-packages - run: npm test + resource_class: large package: docker: - image: cimg/node:16.8.0-browsers From f5c8af4cf25c50817d2282a6e4d54dd7043de0cb Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 21:50:19 -0500 Subject: [PATCH 04/10] Remove duplicate condition --- src/utils/writeProcessFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/writeProcessFile.ts b/src/utils/writeProcessFile.ts index c0bd62b8..f1f1dfb8 100644 --- a/src/utils/writeProcessFile.ts +++ b/src/utils/writeProcessFile.ts @@ -42,7 +42,7 @@ function getEnsureVolumeIsWritableStep() { return { run: { name: 'Ensure volume is writable', - command: `if [ "$(ls -ld ${CONTAINER_STORAGE_DIRECTORY} | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] && [ "$(sudo -V 2>/dev/null)" ] + command: `if [ "$(ls -ld ${CONTAINER_STORAGE_DIRECTORY} | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) ${CONTAINER_STORAGE_DIRECTORY} fi`, From 51b8a1d374a43d3294a76d4c5393776be33ac561 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 22:02:31 -0500 Subject: [PATCH 05/10] Fix the dynamic-config test --- src/test/expected/dynamic-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/expected/dynamic-config.yml b/src/test/expected/dynamic-config.yml index b07db4d4..6418c798 100644 --- a/src/test/expected/dynamic-config.yml +++ b/src/test/expected/dynamic-config.yml @@ -6,7 +6,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci From 6dd2a5d6de8a26652776740a6d66d53c1ea9e76c Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 22:04:29 -0500 Subject: [PATCH 06/10] Replace |- with >- --- src/test/expected/with-cache.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/test/expected/with-cache.yml b/src/test/expected/with-cache.yml index 017e432a..71b5b7bc 100644 --- a/src/test/expected/with-cache.yml +++ b/src/test/expected/with-cache.yml @@ -9,7 +9,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -17,7 +17,7 @@ jobs: - checkout - run: name: Set more environment variables - command: |- + command: >- echo 'export CIRCLE_SHA1=$(git rev-parse HEAD)' >> $BASH_ENV echo 'export CIRCLE_BRANCH=$(git rev-parse --abbrev-ref HEAD)' >> $BASH_ENV echo 'export CIRCLE_PROJECT_REPONAME=$(basename $(git remote get-url origin))' >> $BASH_ENV @@ -83,14 +83,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -122,14 +122,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -147,14 +147,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -172,14 +172,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -222,14 +222,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -250,14 +250,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -275,14 +275,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." From 505347c91fceafc14eecd3f5763317c4253042e3 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 22:10:28 -0500 Subject: [PATCH 07/10] Change the command nomenclature back to what it was --- src/test/expected/with-cache.yml | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test/expected/with-cache.yml b/src/test/expected/with-cache.yml index 71b5b7bc..19c282e3 100644 --- a/src/test/expected/with-cache.yml +++ b/src/test/expected/with-cache.yml @@ -9,7 +9,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: >- + command: |- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -17,7 +17,7 @@ jobs: - checkout - run: name: Set more environment variables - command: >- + command: |- echo 'export CIRCLE_SHA1=$(git rev-parse HEAD)' >> $BASH_ENV echo 'export CIRCLE_BRANCH=$(git rev-parse --abbrev-ref HEAD)' >> $BASH_ENV echo 'export CIRCLE_PROJECT_REPONAME=$(basename $(git remote get-url origin))' >> $BASH_ENV @@ -83,14 +83,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: >- + command: |- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: >- + 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." @@ -122,14 +122,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: >- + command: |- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: >- + 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." @@ -147,14 +147,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: >- + command: |- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: >- + 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." @@ -172,14 +172,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: >- + command: |- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: >- + 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." @@ -222,14 +222,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: >- + command: |- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: >- + 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." @@ -250,14 +250,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: >- + command: |- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: >- + 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." @@ -275,14 +275,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: >- + command: |- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: >- + 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." @@ -294,7 +294,7 @@ jobs: fi - run: name: Firebase deploy - command: | + command: |- if [[ "$CIRCLE_BRANCH" == "master" ]] then npm run firebase:deploy:ci From 8de01d75dcc5dd7f115745f5649b6429a59569d8 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 22:13:38 -0500 Subject: [PATCH 08/10] Replace |- with | --- src/test/expected/with-cache.yml | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test/expected/with-cache.yml b/src/test/expected/with-cache.yml index 19c282e3..0a6ba30c 100644 --- a/src/test/expected/with-cache.yml +++ b/src/test/expected/with-cache.yml @@ -9,7 +9,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: | if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -17,7 +17,7 @@ jobs: - checkout - run: name: Set more environment variables - command: |- + command: | echo 'export CIRCLE_SHA1=$(git rev-parse HEAD)' >> $BASH_ENV echo 'export CIRCLE_BRANCH=$(git rev-parse --abbrev-ref HEAD)' >> $BASH_ENV echo 'export CIRCLE_PROJECT_REPONAME=$(basename $(git remote get-url origin))' >> $BASH_ENV @@ -83,14 +83,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: | if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -122,14 +122,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: | if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -147,14 +147,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: | if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -172,14 +172,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: | if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -222,14 +222,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: | if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -250,14 +250,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: | if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -275,14 +275,14 @@ jobs: steps: - run: name: Ensure volume is writable - command: |- + command: | if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci fi - run: name: Attach workspace - command: |- + 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." @@ -294,7 +294,7 @@ jobs: fi - run: name: Firebase deploy - command: |- + command: | if [[ "$CIRCLE_BRANCH" == "master" ]] then npm run firebase:deploy:ci From e69f672452077c7da68f1c276820ad27fda82d94 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 22:18:44 -0500 Subject: [PATCH 09/10] Change only certain commands to >- --- src/test/expected/with-cache.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/expected/with-cache.yml b/src/test/expected/with-cache.yml index 0a6ba30c..4e8b4573 100644 --- a/src/test/expected/with-cache.yml +++ b/src/test/expected/with-cache.yml @@ -9,7 +9,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: | + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -83,7 +83,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: | + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -122,7 +122,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: | + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -147,7 +147,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: | + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -172,7 +172,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: | + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -222,7 +222,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: | + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -250,7 +250,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: | + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci @@ -275,7 +275,7 @@ jobs: steps: - run: name: Ensure volume is writable - command: | + command: >- if [ "$(ls -ld /tmp/local-ci | awk '{print $3}')" != "$(whoami)" ] && [ "$(sudo -V 2>/dev/null)" ] then sudo chown $(whoami) /tmp/local-ci From 193eac684d75eb010dd90245a448a25288ff4226 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Wed, 20 Jul 2022 22:22:12 -0500 Subject: [PATCH 10/10] Replace some | with |- --- src/test/expected/with-cache.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/expected/with-cache.yml b/src/test/expected/with-cache.yml index 4e8b4573..ada7d8b1 100644 --- a/src/test/expected/with-cache.yml +++ b/src/test/expected/with-cache.yml @@ -17,7 +17,7 @@ jobs: - checkout - run: name: Set more environment variables - command: | + command: |- echo 'export CIRCLE_SHA1=$(git rev-parse HEAD)' >> $BASH_ENV echo 'export CIRCLE_BRANCH=$(git rev-parse --abbrev-ref HEAD)' >> $BASH_ENV echo 'export CIRCLE_PROJECT_REPONAME=$(basename $(git remote get-url origin))' >> $BASH_ENV @@ -90,7 +90,7 @@ jobs: fi - run: name: Attach workspace - command: | + 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." @@ -129,7 +129,7 @@ jobs: fi - run: name: Attach workspace - command: | + 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." @@ -154,7 +154,7 @@ jobs: fi - run: name: Attach workspace - command: | + 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." @@ -179,7 +179,7 @@ jobs: fi - run: name: Attach workspace - command: | + 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." @@ -229,7 +229,7 @@ jobs: fi - run: name: Attach workspace - command: | + 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." @@ -257,7 +257,7 @@ jobs: fi - run: name: Attach workspace - command: | + 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." @@ -282,7 +282,7 @@ jobs: fi - run: name: Attach workspace - command: | + 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."