Pantheon Community

Drupal 8 Repository in GitLabCI to Pantheon

Hello,

I’m working on a migration of an existing Drupal 8 site to Pantheon from another cloud host. I am very new to the Pantheon community, but have been working with Drupal for over 10 years.

Our code repository is currently in Github, and we use Travis CI to build and deploy. Both this repository and CI tool are owned/maintined by an outside vendor and we’re moving everything in-house, so as part of our migration to Pantheon I am also working on migrating both of those to GitLab. Our site uses Acquia BLT to build front-end artifacts which is part of the reason why I believe we need a CI tool to get the site artifacts ready for deploying to Pantheon.

What I am hoping to accomplish is with the code stored in GitLab, use GitLab CI to deploy to Pantheon. My understanding of the documentation I’ve read leads me to believe we can take artifacts built in GitLab CI and deploy them to Pantheon using Build Tools. Is this correct?

I have installed Terminus and the Build Tools plugin, but I’m not sure how to use that with an existing code repository. The documentation seems to tell me just how to create a new project rather than adding it to an existing project. I did see an option for “–preserve-local-repository " when I run " terminus help build:project:create” which seems to be what I want, but I’m not 100% sure.

Since I’m building a new .gitlab-ci.yml file as well, I was curious if there was a particular image that is best used for that to work well with Pantheon / Build Tools? I saw a Docker Build Tools CI dockerfile, but it seems specific to CircleCI and also includes PHP 7.3 (we’re currently on 7.2). For now, I’m attempting to use php:7.2-fpm.

Further complicating this, our site also uses NodeJS and React and the front-end artifacts are built using Acquia BLT, so the CI tool will need to incorporate those as well.

Does anyone here have experience working with GitLab CI and Pantheon that can help give me a sense of direction and/or let me know if I’m on the right track? Is there any specific training courses that focus on this particular workflow?

Thank you!

Phil

Welcome to Pantheon :wave:

Your assumption on Build Tools was correct, it only officially supports new builds right now. There is a conversion tool in progress, it isn’t release candidate ready just yet, but you could give it a go in multidev and see if it works for you: https://github.com/pantheon-systems/terminus-build-tools-plugin/pull/316
We’d love to hear if it does work, or if it doesn’t, what happened.

I’m still pretty new to the CI workflow process so I’ll let our more experienced CI folks speak to your other questions.

1 Like

Hello. Following up on this. I was able to deploy to my Pantheon site from my GitLab repository using GitLab CI…but the site itself does not come up.

I ended up just using Acquia BLT and GitLab CI and didn’t do anything with Pantheon Build Tools.

I created a new GitLab branch for this called pantheondev that appeared over in the Multidev section of the Pantheon UI after GitLab CI finished deploying. I created a Multidev site for it through the UI which successfully completed.

Afterwards I used Terminus to run drush updatedb, drush cim and drush cr on the Multidev site. All of the Drush commands appeared successful.

However, the site itself just displays an error:
http://pantheondev-harvardlib.pantheonsite.io/

"No site detected. Make sure your code is pulled into this environment. "

I switched the Multidev to STFP mode and confirmed that I see all the code there…so I’m not sure what I’m missing? I tried to incorporate Pantheon-specific files that our Migration Team created to my pantheondev branch, but perhaps I missed something?

The Pantheon Documentation I found about this error doesn’t have much detail on what to do next:

Would anyone be able to help me troubleshoot and determine why the Multidev site isn’t coming up?

Thank you!

Phil

1 Like

@philip_plencner - Not 100% sure about this, but do you have a pantheon.yml file in place? Or pantheon.upstream.yml?

CI process usually means nested docroot, which means that the dashboard may be struggling to figure out where to serve the site from. Let us know!

Edited to add docs link: https://pantheon.io/docs/videos/pantheon-yml

Hello @sparklingrobots,

Yes, it ended up being the dashboard didn’t know where to serve the site from. I submitted a support ticket and learned that the site is expetcted to be under the /web/ folder.

This resolved the issue and the multidev site comes up now.

Thanks everyone!

2 Likes