Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Automate colima delete command with confirmation #3061

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
brew install docker
colima delete
# Attempt to start Colima
ATTEMPT_LIMIT=3
ATTEMPT_LIMIT=4

start_colima() {
colima start --network-address --arch x86_64 --cpu=1 --memory=1
Expand All @@ -99,8 +99,8 @@ jobs:
break
else
echo "Failed to start Colima. Attempt $i/$ATTEMPT_LIMIT."
if [ $i -eq $ATTEMPT_LIMIT ]; then
colima delete
if [ $i -eq $(($ATTEMPT_LIMIT - 1)) ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC: @tobitege

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it delete after every failed attempt (except the last one), like this?

if [ $i -lt $ATTEMPT_LIMIT ]; then

Copy link
Contributor Author

@SmartManoj SmartManoj Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but if [ $i -lt $ATTEMPT_LIMIT ]; then it will delete.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll change that in my PR then

Copy link
Contributor Author

@SmartManoj SmartManoj Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, like this?

Did you mean unlike this?

yes | colima delete
else
colima stop -f
fi
Expand Down