Now, if you're looking at a test website job, you will see or you probably figure out that we have
done something kind of weird.
So now we have executed Gatsby serve.
And it's saying that the website is running at a specific address that we actually expected to, but
it seems that the next comment is not being executed.
And this is because get disserve sort of blocks the entire terminal with this execution.
So it will not allow for the next command to start.
And the process is sort of still running.
So it will not give back to possibility for the for the rest of the job to continue.
And this is not exactly what you wanted to do.
And if we leave it in this change, it will more or less run forever?
Well, not actually forever.
If you look here on the right side, you will see that you have the duration of the job.
So how many seconds have passed since the job started?
I'm at three minutes, four minutes almost.
And there's also the information regarding the timeout, not the time means if this job is not responding
after one hour, Gottleib will ultimately kill it.
So if the entire job takes more than one hour, there's something wrong with it.
Generally, it shouldn't take that long, and especially in our case, it should only take a few minutes.
And if you leave it in this stage, as I said, it will run forever, or in this case, it'll run to
the timeout that is configured here at one hour and after one hour gets up will fail this job because
it has run into this timeout.
Now, we don't have to wait one hour to fix our mistake.
In this case.
We can click here on console and we can just terminate the job.
So what we need here in order to sort of release the terminal is to use.
The end sign, the ampersands sign, and what will this do is sort of run this process in in the background
so it will execute this.
The server will continue to run and it will release it for the next comment.
Additionally, what we want to do, because the server takes like a few seconds to start, we want to
include a small pause in our execution and just to give the next command a chance and to give the Gatsby
server a chance to start going to say, here, sleep.
And we are going to indicate a number of seconds, I think three seconds should be more than enough,
and this is not the smartest way to do it, because no matter how fast the server starts, we'll always
wait three seconds.
But for the simple example is definitely more than enough just to exemplify how we can include a small
slip inside a script, but will deal with that a bit later.
So let's committees and see how it looks like.
It is an important thing I want you to notice when you are going to view all the pipelines that are
currently running, this is available in Cassidys pipelines and you will see here that we still have
the previous pipeline running from the previous permit.
And because we have pushed another change, another pipeline was started.
So we now have two pipelines running in parallel.
So I just wanted for you to be aware that there is the possibility that pipelines run in parallel so
they will not be automatically cancelled or something like that.
When the new pipeline starts, you will have pipelines running in parallel.
And especially as this previous pipeline, we don't need it anymore.
We can cancel the job or we can actually cancel the entire pipeline.
It really depends on how you want to do it.
Nine o'clock here, stop the pipeline.
And will see here that the pipeline has been canceled.
You can additionally cancel jobs, so every time you click on a job and you will see here this button,
if I click on it, you can cancel individual stages.
So if you're, like, constantly working on your pipeline and trying to optimize it and at the same
time, you want to sort of save resources or you have the impression that the pipeline altogether is
running a bit slow.
You can definitely cancel jobs that make no sense in continuing to run.
Now, let's take a look at what our test website stage is doing, and you will see that this is still
failing, but at least what we have done here is worked.
So we are serving the website and after this, we are waiting OCF seconds.
And you will see that in parallel, you are still getting outputs from The Gatsby self-command.
So it's saying here Gatsby are running at this address.
Now, the process in figuring out what has happened here is relatively the same.
Generally, what you want to do is to identify where from where this area is coming from.
And obviously it's coming from this comment and we're getting here this Arrowfield writing body.
And the idea would be to search for this specific string.
And to find online help on why this is happening and for example, a quick search leads to stack overflow
with somebody having a similar problem, you will see here that's using Croal and is passing this information
to grep.
And apparently it says that this happens when a program, for example, Greb closes the read pipe before
the previous program is finished, writing the whole page and as a solution is using tech and is saying
that tech is a simple Unix problem that reads the entire input page and reverses the line order.
For that reason, you have to run it twice.
So let's try this and see if this solves our problem.
So I'm going to adhere to.
An attack.
And you will see now that the test job stage has succeeded and that the fix that we have found online
seems to be working and as I have said with test changed a string here, make sure that it fails, make
sure that everything works properly before just leaving it in production and relying on things where
you're not sure.
So let's review again what we have learned in this lecture, we have added a new job and because two
jobs now are in the stage test, this test are being executed in parallel.
Now, in this first one test artifact, we have used this Docker image Alpine, which is a very, very
small, minimalistic image.
But it's just enough for us to be able to run this script command.
And as you have seen, it executes very, very fast.
It's like 20 seconds to download the image, stouter image and run the script that we have.
And in this second job that is running in parallel, we are using the node image we have then the script
we have to install NPM in order to use Gatsby and we're using Gatsby to start the server.
We are using this and operator, which makes this command run in the background and it's releasing the
terminal so that the next commands can be executed and we have to sleep.
We are waiting a few seconds, give the server a chance to start.
And after that, with Kerl and Whicker, we are calling this address and then waiting for the entire
response to be written, the tech tech command that we have used as a solution to the error that we
were getting and then we'd grippe.
We are searching for this string.