ember-cli-surge icon indicating copy to clipboard operation
ember-cli-surge copied to clipboard

Surge commands do not complete/return on CircleCI

Open xtagon opened this issue 6 years ago • 5 comments

I was following this issue: https://github.com/kiwiupover/ember-cli-surge/issues/83#issuecomment-426760595 but I decided to open a new issue, because this is still affecting me, and it's happening on CircleCI (Linux) and not on Windows, so it might be a slightly different issue.

Every time I deploy one of my Ember apps with Surge, the command succeeds, but CircleCI times out because there is no response from surge.

I'm happy to help troubleshoot but I'm not sure what the next step is to try. Any ideas?

Thanks in advance!

Versions:

ember-cli 2.18.2 ember-cli-surge 1.3.0 surge 0.20.1

Deploy command in CircleCI config:

node_modules/ember-cli/bin/ember surge

xtagon avatar Feb 04 '19 19:02 xtagon

This is an upstream issue. Where surge is not exit from the deploy.

I will try again to get this resolved.

kiwiupover avatar Feb 08 '19 17:02 kiwiupover

Okay, thank you 👍

Is there an issue already opened with the surge repo?

xtagon avatar Feb 10 '19 19:02 xtagon

Any update on the issue ? I just add ember surge into my gitlab-ci pipeline and I face the same problem: after deploy ember surge does not terminate

NotGrm avatar Nov 08 '19 10:11 NotGrm

No idea how to solve it, but I came up with a workaround. It feels like a dirty hack, but it works...

#!/usr/bin/expect

# Surge CLI has a bug where the command hangs without exiting even after
# success, which times out the CI job when it should finish sooner.
#
# This script is meant to exit as soon as the success message is reached.
#
# It also sets a lower timeout in case this ends up blocking other CI jobs.

# 5 minutes
set timeout 300

spawn ./node_modules/ember-cli/bin/ember surge

expect "Success!" { exit 0 }

This is an expect script I wrote that will wait until the Success! message appears. You'll need to install expect on the CI container. For Debian-based images this may be as easy as apt install expect.

xtagon avatar Nov 08 '19 17:11 xtagon

Thanks heaps for this solution Justin.

via Newton Mail [https://cloudmagic.com/k/d/mailapp?ct=dx&cv=10.0.32&pv=10.14.6&source=email_footer_2] On Fri, Nov 8, 2019 at 9:03 AM, Justin Workman [email protected] wrote: No idea how to solve it, but I came up with a workaround. It feels like a dirty hack, but it works...

#!/usr/bin/expect

Surge CLI has a bug where the command hangs without exiting even after

success, which times out the CI job when it should finish sooner.

This script is meant to exit as soon as the success message is reached.

It also sets a lower timeout in case this ends up blocking other CI jobs.

5 minutes

set timeout 300

spawn ./node_modules/ember-cli/bin/ember surge

expect "Success!" { exit 0 }

This is an expect script I wrote that will wait until the Success! message appears. You'll need to install expect on the CI container. For Debian-based images this may be as easy as apt install expect .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub [https://github.com/kiwiupover/ember-cli-surge/issues/148?email_source=notifications&email_token=AAE6EC3M2A4B7CKCF3LG7BDQSWLURA5CNFSM4GUHLSBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDSXPBY#issuecomment-551909255] , or unsubscribe [https://github.com/notifications/unsubscribe-auth/AAE6EC2EC6WG6WJCV5UKZJTQSWLURANCNFSM4GUHLSBA] .

kiwiupover avatar Nov 08 '19 17:11 kiwiupover