tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

FlowSaga tutorial not working on latest CLI

Open eldermoraes opened this issue 7 years ago • 3 comments

Hi folks,

The FlowSaga tutorial isn't compatible to the latest version of Fn CLI. When you run:

./scripts/configure.sh

It's raises the error:

Fn: 'route' is not a Fn Command

I've tried to fix the script configure.sh like this:

#! /usr/bin/env bash

FLOWSERVER_IP=$(docker inspect --type container -f '{{.NetworkSettings.IPAddress}}' flowserver)
TOOLS_IP=$(docker inspect --type container -f '{{.NetworkSettings.IPAddress}}' bristol)

fn config app travel COMPLETER_BASE_URL "http://$FLOWSERVER_IP:8081"
fn config function travel flight-book FLIGHT_API_URL "http://$TOOLS_IP:3001/flight"
fn config function travel flight-book FLIGHT_API_SECRET "shhhh"
fn config function travel flight-cancel FLIGHT_API_URL "http://$TOOLS_IP:3001/flight"
fn config function travel flight-cancel FLIGHT_API_SECRET "shhhh"
fn config function travel hotel-book HOTEL_API_URL "http://$TOOLS_IP:3001/hotel"
fn config function travel hotel-cancel HOTEL_API_URL "http://$TOOLS_IP:3001/hotel"
fn config function travel car-book CAR_API_URL "http://$TOOLS_IP:3001/car"
fn config function travel car-cancel CAR_API_URL "http://$TOOLS_IP:3001/car"
fn config function travel email EMAIL_API_URL "http://$TOOLS_IP:3001/email"

I'm not sure if it's correct...

Then I used fn migrate on trip function to fix the func.yaml file. Next, the tutorial says to run:

fn call travel /trip < sample-payload.json

But the new CLI doesn't support it, so I've changed to:

fn invoke travel trip < sample-payload.json

And here I got stuck with this error:

{"message":"container exit code 1"}

Fn: Error calling function: status 502

See 'fn <command> --help' for more information. Client version: 0.5.20

Any clue of what could be happening?

eldermoraes avatar Oct 26 '18 07:10 eldermoraes

Hi! This tutorial is slightly outdated. Please https://github.com/delabassee/tutorials/tree/master/FlowSaga for now, we’re working to update all tutorials we have.

denismakogon avatar Oct 26 '18 08:10 denismakogon

Great! Thanks.

eldermoraes avatar Oct 26 '18 08:10 eldermoraes

Am going to re-open this as we don't have a bug to track it @michael-w-williams can you see if you can retrofit @delabassee 's example into tutorials? thanks!

zootalures avatar Oct 26 '18 11:10 zootalures