Archived video

This video is archived and won't be updated. We're keeping it online for now as a courtesy.

Alternate resources: 

Use Pantheon Multidev

Video loading...

  • 0:00
    Manage Drupal Sites with Pantheon Use Pantheon Multidev Addison Berry
  • 0:09
    One of the really cool features about the environments that you have on Pantheon
  • 0:14
    is Multidev where you get multiple development environments
  • 0:18
    instead of just one in the normal Pantheon workflow.
  • 0:22
    In this lesson, we're going to look at how you create a Multidev environment,
  • 0:27
    and then we're going to edit some code,
  • 0:29
    and then we'll show how you review and merge that code
  • 0:32
    into the Dev Master.
  • 0:34
    And then we go ahead and delete the branch.
  • 0:37
    So I'm starting in my Space Explorers Pantheon dashboard here,
  • 0:42
    and you can see this is the normal Dev environment dashboard
  • 0:46
    that I'm looking at currently.
  • 0:48
    But what we're going to be doing is moving over to the Multidev tab.
  • 0:52
    Now with Multidev, I actually have things here and can do things.
  • 0:57
    There are 2 different routes to get here.
  • 0:59
    I actually have both of them going on in this demo,
  • 1:01
    but one is that this website is currently launched under the Pro Plan,
  • 1:07
    so if you have the professional or business plans,
  • 1:10
    then you have access to Multidev environments.
  • 1:14
    The other way that you get access to Multidev though
  • 1:16
    is by having Pantheon for Agencies.
  • 1:18
    And then all of my sites have Multidev.
  • 1:21
    So I am in the Drupalize.Me organization which is Pantheon for Agencies,
  • 1:26
    and it's also a site that's launched on Pro.
  • 1:28
    So I have access to these wonderful Multidev environments here.
  • 1:32
    So this tab that we're on, of course, is listing existing environments,
  • 1:37
    and will allow me to create a new one.
  • 1:39
    There's also a tab to just show all of the Git branches on Dev.
  • 1:44
    So you can still—I mean, obviously, you can just use Git,
  • 1:48
    and you can create branches and work on your code and do those things.
  • 1:51
    And that would list those here.
  • 1:53
    And if you wanted, from a branch that's in code,
  • 1:56
    you could just create the environment directly here through the UI
  • 1:59
    for an existing branch that somebody had already created code for.
  • 2:03
    Now, so just keep in mind the Git branches is code in Git.
  • 2:07
    The environment is an entire site,
  • 2:10
    so it's the code from the branch
  • 2:13
    plus it's the database and the files.
  • 2:16
    It's a full functioning site that you can actually visit, not just code.
  • 2:19
    And you can see we have a couple of environments already created.
  • 2:23
    These are 2 branches that already exist, and you can see the status of what's going on with those.
  • 2:29
    And you can see this is 2 commits ahead, this is 3 commits behind,
  • 2:32
    just to give you a nice overview of where things are and the different branches.
  • 2:35
    And then let's just go ahead and create a new one and start to work with that.
  • 2:38
    So I'm going to create a new Dev environment.
  • 2:41
    And it says—you're creating a Git branch, so you have to give it a branch name.
  • 2:45
    I like to put type and ticket number.
  • 2:47
    Whatever your naming convention is, you go nuts with that.
  • 2:51
    And it wants to know where I want to get my—
  • 2:53
    basically where you want to get your environment from.
  • 2:55
    Like you're doing—you're copying the Dev code base,
  • 2:57
    but where do you want to get your live files from?
  • 3:01
    So that's just sort of up to you.
  • 3:03
    If you want to match the Dev environment that others are working on
  • 3:05
    or if you want to grab the latest and greatest stuff from the live site.
  • 3:08
    And then I'm just going to go ahead and create my environment.
  • 3:11
    OK. So once it's created that, I can just go straight to the new environment.
  • 3:14
    This is going to be very much like the Dev environment, right?
  • 3:17
    So I get the same dashboard here, but now you can see
  • 3:19
    I'm in this specific feature branch environment as it were.
  • 3:24
    And if you want, you can go actually look at the website
  • 3:27
    and play around with it and see.
  • 3:29
    But what I want to do is actually change some code.
  • 3:31
    I'm going to get some development done.
  • 3:33
    There is the Git command for using Git.
  • 3:36
    If you're using SFTP, it will show you connection information for that.
  • 3:39
    But here is how I would get into that branch in Git locally,
  • 3:44
    so I need to fetch the latest to get this latest branch
  • 3:47
    and then check out that branch locally.
  • 3:50
    So I'm going to go do that.
  • 3:53
    And I'm in my Space Explorer's master branch for Dev.
  • 3:58
    And I'm just going to go ahead and fetch, get all that stuff,
  • 4:01
    and now I'm in the feature-100 branch.
  • 4:04
    So that's where I need to be in order to get my work done.
  • 4:08
    And I'm just going to quickly go through, add something,
  • 4:11
    and then commit that and push that back up.
  • 4:13
    And then we'll pick up with the actual reviewing and merging and stuff like that.
  • 4:25
    So now I have everything committed and ready to push.
  • 4:28
    Just remember you want to push to your branch, obviously, and not to master.
  • 4:35
    So now I've made my changes, and I put them up into my branch.
  • 4:38
    So let's go back to Pantheon's UI here.
  • 4:40
    And you'll see that my commit is showing up,
  • 4:43
    and it's unmerged because it's not actually merged into the master for Dev.
  • 4:48
    It's only sitting in my branch at this time.
  • 4:52
    Now, when it comes for review—
  • 4:55
    so let's say I've done this and I'm like, "Yes, I'm ready to go,"
  • 4:57
    and in the ticket, I'm like, "This is ready to go.
  • 5:00
    Someone needs to review this and merge this into master."
  • 5:02
    The nice thing about using these environments,
  • 5:05
    the big distinction, like why not just do all of this in Git,
  • 5:09
    is that you now actually have a fully functioning website
  • 5:12
    that is running just this branch of code.
  • 5:16
    So you can really see what the changes are that this code has introduced.
  • 5:20
    And so when you have people looking and reviewing this,
  • 5:24
    not only can you look at the visual diff,
  • 5:26
    so like if I click on the actual commit here,
  • 5:31
    I get a visual diff that I can review.
  • 5:33
    But I can also actually launch the website
  • 5:37
    and click around and make sure.
  • 5:39
    And this is great for people who are not developers
  • 5:41
    but that you need to get feedback or write-off or OK from on
  • 5:44
    is this what you meant by how the feature is supposed to function?
  • 5:47
    Go to this URL, play on this site, let us know,
  • 5:51
    and then you can get a lot more feedback from people who are not developers
  • 5:55
    using Git on your changes that you're making.
  • 5:58
    So that's a really big thing here.
  • 6:01
    So I could just go look at the site. So let's say I've done that.
  • 6:03
    I've looked at it; I've reviewed all this stuff;
  • 6:05
    and I'm ready to actually merge this into Dev.
  • 6:10
    Now if we go back— so this is the environment that I'm in, right?
  • 6:14
    If I click on this dropdown,
  • 6:16
    I can get back to that Multidev overview.
  • 6:19
    I can also switch around to the other branches' environments
  • 6:22
    right now if I wanted to as well.
  • 6:24
    But if I go back to my Multidev environment,
  • 6:27
    you'll see that this is listed with the others now
  • 6:30
    and it shows that I'm one commit ahead.
  • 6:33
    And I have this Merge Into Master button.
  • 6:36
    So once I've done review, I can go here and do this.
  • 6:42
    When you click that, it's simply taking you to the Dev environment to the Merge tab.
  • 6:48
    So you could also get there that way by just going to your Dev environment
  • 6:52
    and going to Merge.
  • 6:54
    And then it's going to show you what is available to merge into the Dev Master.
  • 6:58
    So I have 2 things right now that are sitting here waiting,
  • 7:02
    feature-100 and bugfix. I've just reviewed the feature,
  • 7:05
    and I've gotten feedback on that.
  • 7:07
    So I'm going to do that, feature-100,
  • 7:10
    and now you'll also notice down here of course you can also merge this in the command line.
  • 7:14
    This is Git. We're just talking about the code actually changing and merging.
  • 7:19
    So you could just do this from the command line as well,
  • 7:21
    whichever you're more comfortable with.
  • 7:23
    But I'm just going to go ahead and click the big old Merge button.
  • 7:28
    So once that's done, you can see now it's just saying there's only bugfix-232.
  • 7:33
    So we've merged that into the Dev environment
  • 7:36
    which means it can now go into the normal pipeline and go up Test and Live.
  • 7:39
    Now if we go back to Multidev here,
  • 7:42
    so you can see that now there are no commits.
  • 7:45
    It's fine. We've just merged it in.
  • 7:47
    We don't necessarily need this anymore.
  • 7:49
    So I can go ahead and delete this environment if I want to.
  • 7:54
    So we'll do that. They want to make sure
  • 7:56
    you're sure this one is the one you want, right?
  • 8:02
    And then that environment goes away.
  • 8:04
    So now that's taking down the website.
  • 8:06
    That doesn't necessarily get rid of the code in the Git branches, right?
  • 8:11
    So if you go to Git branches, you can see that this still exists in Git.
  • 8:16
    It just doesn't actually have a full website environment.
  • 8:18
    So I could actually delete the Git branch from here if I wanted to
  • 8:22
    or if we were like we need to do more work, you can just go ahead
  • 8:25
    and re-create that environment again from the Git branch.
  • 8:30
    One last thing I just wanted to show you real quickly
  • 8:32
    is the merging doesn't just go from branches into master.
  • 8:37
    You can obviously just like in Git merge from master into your branches
  • 8:41
    and is something you should be doing regularly
  • 8:43
    to make sure that your development code, your branches,
  • 8:46
    are up to date with what's going on in master.
  • 8:48
    So you could see these both have something a little bit behind on them.
  • 8:53
    So I could go into this feature
  • 8:56
    and it shows me right here under the code tab
  • 8:59
    that I have commits that need to be merged in.
  • 9:01
    So it kind of puts it right there in your face.
  • 9:03
    And so I can open this up and go ahead and just merge this
  • 9:06
    and make sure that my feature branch or my bug branch
  • 9:10
    is up to date with the latest development code.
  • 9:12
    So to recap Multidev,
  • 9:15
    we created a Multidev environment.
  • 9:17
    We looked at the overview of what we have in that dashboard for Multidev.
  • 9:22
    And then we got our own separate environment just for that branch.
  • 9:25
    We had a whole website with the code for that branch.
  • 9:29
    I went in and edited the code.
  • 9:31
    We reviewed and then merged the code.
  • 9:33
    And of course the biggest feature of using the Pantheon environments
  • 9:39
    to do this review and merging of branches
  • 9:42
    is that you actually have a fully functioning website with that code running in it
  • 9:46
    that others can also actually click around on the site
  • 9:49
    and see how this branch affects the existing website.
  • 9:52
    So it's a little bit different than just having Git code
  • 9:55
    that you're reviewing and looking at the actual diffs and those kinds of things
  • 9:58
    or needing to have everybody create their own local environment in order to test it.
  • 10:03
    It's all done for you automatically and quickly
  • 10:05
    and then there's just a link that people can click, super, super handy.
  • 10:09
    And then after we did that, we went ahead and cleaned some stuff up.
  • 10:12
    We deleted the branch because we didn't need that anymore.
  • 10:15
    And then I also looked at making sure that I merged
  • 10:18
    the new updated master Dev code
  • 10:23
    into my Multidev branches.
  • 10:26
    So that is a wrap up of using Multidev
  • 10:28
    and you can see it's very, very handy, and it's really nice to have
  • 10:32
    ways to be able to track your branches
  • 10:34
    with full environments as opposed to just that one development environment
  • 10:38
    for testing your code as you go.

Use Pantheon Multidev


In this tutorial we're going to dive into using Pantheon's Multidev feature. To demonstrate how this works we'll first create a new Multidev environment by cloning the existing Dev environment. Once switched over to this new branch in Git, we'll quickly edit some code and push that to our repo. We'll use Multidev to review the new code in our dashboard, and then merge that branch into the Dev master branch. With the full process complete, we can delete that branch, and the environment with it.

Sponsored by Pantheon

Log in or sign up to download companion files.
Additional resources: