WEBVTT

1
00:00:00.000 --> 00:00:01.247
To do your first deployment,

2
00:00:01.287 --> 00:00:04.737
take those configuration details and
paste them into the agent window.

3
00:00:04.827 --> 00:00:07.467
If you're not comfortable doing
that and you want to do it by hand,

4
00:00:07.507 --> 00:00:11.287
just ask the agent for how to do it,
and it will show you which file to update

5
00:00:11.327 --> 00:00:12.897
and which fields to use.

6
00:00:12.987 --> 00:00:15.367
But I'm fine just pasting
it into this agent.

7
00:00:15.407 --> 00:00:18.567
And I've written, "Deploy my
application to DigitalOcean."

8
00:00:18.607 --> 00:00:21.887
I've included the public
and private IP addresses,

9
00:00:21.927 --> 00:00:25.957
and this is the connection information
for the hosted database that we have.

10
00:00:26.867 --> 00:00:29.527
The agent will make
entries to config.jsoc,

11
00:00:29.567 --> 00:00:31.527
which is where our deployment
configuration is stored,

12
00:00:31.567 --> 00:00:33.147
and then it will run the first deployment.

13
00:00:33.187 --> 00:00:37.387
The agent should be smart enough to pick
the right user for you, but if not,

14
00:00:37.427 --> 00:00:39.687
and it asks you, if you're
deploying to DigitalOcean,

15
00:00:39.727 --> 00:00:41.857
you'll want to use the root
user to do deployment.

16
00:00:42.127 --> 00:00:44.267
And it might ask you which key to use.

17
00:00:44.307 --> 00:00:47.467
Use the one that we selected when
we created the DigitalOcean droplet.

18
00:00:47.507 --> 00:00:49.797
So in this case, I'll use id_digitalocean.

19
00:00:50.187 --> 00:00:52.517
Next, it's asking me whether
or not we have a domain.

20
00:00:52.667 --> 00:00:54.127
We do have a domain, actually.

21
00:00:54.167 --> 00:00:56.907
So we're going to use demo.elements.dev.

22
00:00:56.947 --> 00:00:58.617
Now, if you don't have a URL

23
00:00:59.067 --> 00:01:02.167
or DNS entry for your domain,
don't worry about that. Just leave it blank

24
00:01:02.207 --> 00:01:06.047
and you can go and look at the IP address
and use that to test out your application.

25
00:01:06.087 --> 00:01:08.747
But we happen to have one
and so I'll enter it here.

26
00:01:08.787 --> 00:01:10.767
All right, it's just asking
me whether I want to proceed.

27
00:01:10.807 --> 00:01:13.147
It's telling me that Elements will
do everything that we need to do

28
00:01:13.187 --> 00:01:14.537
and so I'll click yes.

29
00:01:15.207 --> 00:01:16.287
Depending upon your agent,

30
00:01:16.327 --> 00:01:18.877
it might not ask you any
questions and that's fine as well.

31
00:01:19.167 --> 00:01:22.447
Elements is smart enough to handle
the entire deployment on the agent's behalf.

32
00:01:22.487 --> 00:01:24.507
The agent is just going to add
some configuration details

33
00:01:24.547 --> 00:01:27.117
and then ask Elements
itself to do the deployment.

34
00:01:27.187 --> 00:01:30.907
The first one should take just
under a minute to complete,

35
00:01:30.947 --> 00:01:33.487
and then hot deployments after that
usually take anywhere from half

36
00:01:33.527 --> 00:01:37.827
a second to three seconds. Great,
the initial deployment has completed,

37
00:01:37.867 --> 00:01:40.437
and it's telling me that
the website is up and running.

38
00:01:40.827 --> 00:01:44.427
Since I had a URL,
I've typed demo.elements.dev,

39
00:01:44.467 --> 00:01:47.057
and that dropped me into
the sign-in page automatically.

40
00:01:47.167 --> 00:01:49.967
So we have a live site that's working
with load balancing working automatically

41
00:01:50.007 --> 00:01:54.277
and HTTPS SSL certificates
configured automatically.

42
00:01:54.587 --> 00:01:58.887
If you don't have a URL, just type in
the public IP address that was given

43
00:01:58.927 --> 00:02:02.167
to you by DigitalOcean and you
should land at your website as well.

44
00:02:02.207 --> 00:02:05.147
Just keep in mind that the data that's
going back and forth between your browser

45
00:02:05.187 --> 00:02:08.237
and the server is not encrypted
unless you have a URL.

46
00:02:09.007 --> 00:02:12.647
Now that the machine has been provisioned,
if you want to deploy again,

47
00:02:12.687 --> 00:02:16.247
it's going to be very fast and you can
just ask your agent to do a deployment.

48
00:02:16.287 --> 00:02:19.427
If you finish a feature or if
you're feeling really bold,

49
00:02:19.467 --> 00:02:22.917
you might just ask it to deploy automatically
after each time it makes a change.

50
00:02:23.167 --> 00:02:27.027
I'm so comfortable with deploying Elements
applications that if it's just cosmetic,

51
00:02:27.067 --> 00:02:30.007
I'll often just deploy it
immediately so I can see it live.

52
00:02:30.047 --> 00:02:31.207
And if there's some kind of mistake,

53
00:02:31.247 --> 00:02:33.607
I'll just ask the agent
to fix it and deploy again.

54
00:02:33.647 --> 00:02:37.427
Because deploys are so fast and because
they're so reliable, I don't really worry

55
00:02:37.467 --> 00:02:41.697
that a deployment is going to break
the site as much as I used to in the past.

56
00:02:41.907 --> 00:02:43.227
Deployment is very robust.

57
00:02:43.267 --> 00:02:47.017
If anything fails in the build,
whether it's a type checking error,

58
00:02:47.227 --> 00:02:51.007
a program analysis security error,
a database migration error,

59
00:02:51.047 --> 00:02:55.367
if the tests don't pass, any of those things
will block the release from proceeding

60
00:02:55.407 --> 00:02:57.957
and whatever was there
before will stay there.

61
00:02:58.647 --> 00:03:02.357
Additionally, any connected browsers
will be hot reloaded automatically.

62
00:03:02.707 --> 00:03:05.587
And so from the time that you deploy
to the time that the users see

63
00:03:05.627 --> 00:03:10.007
the update is typically anywhere from
milliseconds to one to three seconds.

64
00:03:10.047 --> 00:03:11.157
It's very fast.
