menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Gitpod

Gitpod - one-click online IDE for GitHub

Channels
Team

a way to wait for previous task to complete

August 6, 2019 at 7:05pm

a way to wait for previous task to complete

August 6, 2019 at 7:05pm
Hi all, loving gitpod so far, testing it out with expo and love the idea of a dockerized ide. I'm playing around with the tasks, the docs for these are good and I have a decent gitpod yaml file that installs expo cli and other npm dependencies depending on the image state.
I have encountered an issue that I couldn't find an answer for in the docs. Is there a way to have a task run after a previous task is completed? they currently run async, but I'd like to make calls to expo once its installed. my yml file looks like this:
tasks:
  • before: npm install -g expo-cli
  • init: npm install
  • command: expo start --host tunnel
However the command (expo start) gets called before expo-cli has finished installing. Its not a deal breaker, as I can do it manually, but it would be real sweet to get this implemented :)

August 6, 2019 at 7:24pm
Hi , thanks for the nice feedback! Glad that you find Gitpod useful. :)
If both init and command run in parallel, I suspect that you have a - in front of each (i.e. they both run in separate Terminals). Instead of:
tasks:
- init: npm install
- command: expo start --host tunnel
you should have a single -:
tasks:
- init: npm intall
command: expo start --host tunnel
and with the added before:
tasks:
- before: npm install -g expo-cli
init: npm install
command: expo start --host tunnel
Edited
like-fill
1
This will open a single Terminal that runs before, init and command one after the other in sequence :)
(For the future, if you do want to synchronize multiple terminals, please have a look at gp sync-await label, gp sync-done label and also gp await-port 3000.)

August 7, 2019 at 7:35am
Ahh I knew it was something on my end, thank you kindly, will take a look at the gp commands, thank you
Hi , hope this helps!
But I suspect that you just need to replace two - with a space in your .gitpod.yml. You probably won't need the gp commands.

November 7, 2020 at 2:45am
(For the future, if you do want to synchronize multiple terminals, please have a look at gp sync-await label, gp sync-done label and also gp await-port 3000.)
I do not see any documentation for sync-await or sync-done in the docs (nothing shows up in a docs search currently). Are you planning on adding these to the docs? Thanks!