Skip to main content
Last Reviewed: December 13, 2022

Deploy to Dev


You've now committed the code to the local branch. Deploy that branch directly to a new Multidev (called composerify in the steps below) and test the site in the browser.

Deploy to a Multidev

  1. Push the changes to a Multidev called composerify to safely test the site without affecting the Dev environment:

    git push -u origin composerify && terminus env:create $SITE.dev composerify
  2. Make a small change to pantheon.yml:

    pantheon.yml
    database:
     version: 10.4
    
    # add a comment to trigger a change and build
  3. Commit and push the change to trigger an Integrated Composer build on the Multidev:

    git commit -am "trigger composer build"
    git push origin composerify

Since the commit history of the composerify Multidev has no commits in common with the master branch, you cannot view the Multidev commit history from the Dashboard or the Integrated Composer logs.

If the site is not working, try this Composer command on the local composerify branch:

composer --no-dev --optimize-autoloader --no-interaction --no-progress --prefer-dist --ansi install

If Composer runs into an error or if any files have been changed (files that are not ignored by .gitignore), resolve those issues before you continue. Refer to the Integrated Composer Troubleshooting section for more information about troubleshooting Integrated Composer.

Move composerify to the Main Dev Branch

After you confirm that the site works in the Multidev, replace the master branch and its commit history with the composerify Multidev's commit history:

  1. Retrieve the most recent commit hash from the local composerify branch:

    git log --format="%H" -n 1

    This will give you a commit hash like fd3636f58f5b275b998bb1c9267bff8808353840.

  2. Reset the master branch to match that commit, then force push it to the Dev environment:

    git checkout master
    git reset --hard fd3636f58f5b275b998bb1c9267bff8808353840
    git push --force origin master

Your site's Dev environment is now set up to use the the latest version of Drupal Integrated Composer upstream.