Skip to content

Commit

Permalink
chore: make it clear something failed in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Jan 8, 2024
1 parent 4fba04b commit 4d81d0f
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions upgrade-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,25 @@ if [ "$1" == "--upgrade-expo" ]; then
echo "Upgrading $DIRNAME..."

if [ -z ${CI} ]; then
echo "• Run $manager install";
(cd $DIRNAME && $manager install --ignore-scripts &> ../.sdk-upgrade-logs/$DIRNAME-install.txt || echo "FAILURE")
else
echo "::group::• Run $manager install";
(cd $DIRNAME && $manager install --ignore-scripts)
exitCode=$?
echo "::endgroup::"
else
echo "• Run $manager install";
(cd $DIRNAME && $manager install --ignore-scripts &> ../.sdk-upgrade-logs/$DIRNAME-install.txt || echo "FAILURE")
if [ $exitCode -ne 0 ]; then echo "FAILURE"; fi
fi

if [ -z ${CI} ]; then
echo "• Run expo upgrade";
(cd $DIRNAME && $manager add expo@latest && $manager expo install --fix &> ../.sdk-upgrade-logs/$DIRNAME-upgrade.txt || echo "FAILURE")
else
echo "::group::• Run expo upgrade";
(cd $DIRNAME && $manager add expo@latest && $manager expo install --fix)
exitCode=$?
echo "::endgroup::"
else
echo "• Run expo upgrade";
(cd $DIRNAME && $manager add expo@latest && $manager expo install --fix &> ../.sdk-upgrade-logs/$DIRNAME-upgrade.txt || echo "FAILURE")
if [ $exitCode -ne 0 ]; then echo "FAILURE"; fi
fi
done

Expand All @@ -44,21 +48,25 @@ if [ "$1" == "--upgrade-expo" ]; then
mkdir -p ./.sdk-upgrade-logs/with-yarn-workspaces
for d in with-yarn-workspaces/apps/*/ ; do
if [ -z ${CI} ]; then
echo "• Run yarn install";
(cd $DIRNAME && yarn install &> ../.sdk-upgrade-logs/with-yarn-workspaces/$DIRNAME-install.txt || echo "FAILURE")
else
echo "::group::• Run yarn install";
(cd $DIRNAME && yarn install)
exitCode=$?
echo "::endgroup::"
else
echo "• Run yarn install";
(cd $DIRNAME && yarn install &> ../.sdk-upgrade-logs/with-yarn-workspaces/$DIRNAME-install.txt || echo "FAILURE")
if [ $exitCode -ne 0 ]; then echo "FAILURE"; fi
fi

if [ -z ${CI} ]; then
echo "• Run expo upgrade";
(cd $DIRNAME && yarn add expo@latest && yarn expo install --fix &> ../.sdk-upgrade-logs/with-yarn-workspaces/$DIRNAME-upgrade.txt || echo "FAILURE")
else
echo "::group::• Run expo upgrade";
(cd $DIRNAME && yarn add expo@latest && yarn expo install --fix)
exitCode=$?
echo "::endgroup::"
else
echo "• Run expo upgrade";
(cd $DIRNAME && yarn add expo@latest && yarn expo install --fix &> ../.sdk-upgrade-logs/with-yarn-workspaces/$DIRNAME-upgrade.txt || echo "FAILURE")
if [ $exitCode -ne 0 ]; then echo "FAILURE"; fi
fi
done

Expand All @@ -83,7 +91,9 @@ if [ "$1" == "--fix-dependencies" ]; then
else
echo "::group::• Run $manager install";
(cd $DIRNAME && $manager install --ignore-scripts)
exitCode=$?
echo "::endgroup::"
if [ $exitCode -ne 0 ]; then echo "FAILURE"; fi
fi

if [ -z ${CI} ]; then
Expand All @@ -92,7 +102,9 @@ if [ "$1" == "--fix-dependencies" ]; then
else
echo "::group::• Run expo fix";
(cd $DIRNAME && $manager expo install --fix)
exitCode=$?
echo "::endgroup::"
if [ $exitCode -ne 0 ]; then echo "FAILURE"; fi
fi
done

Expand All @@ -107,7 +119,9 @@ if [ "$1" == "--fix-dependencies" ]; then
else
echo "::group::• Run yarn install";
(cd $DIRNAME && yarn install)
exitCode=$?
echo "::endgroup::"
if [ $exitCode -ne 0 ]; then echo "FAILURE"; fi
fi

if [ -z ${CI} ]; then
Expand All @@ -116,7 +130,9 @@ if [ "$1" == "--fix-dependencies" ]; then
else
echo "::group::• Run expo fix";
(cd $DIRNAME && yarn expo install --fix)
exitCode=$?
echo "::endgroup::"
if [ $exitCode -ne 0 ]; then echo "FAILURE"; fi
fi
done

Expand Down

0 comments on commit 4d81d0f

Please sign in to comment.