Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Integrating Crafter CMS With GitLab for Better DevOps

DZone's Guide to

Integrating Crafter CMS With GitLab for Better DevOps

Learn how to integrate Crafter CMS software with your GitLab development project in this tutorial.

· DevOps Zone ·
Free Resource

Read why times series is the fastest growing database category.

Content authoring and software development are both a major part of producing today's digital experiences. Unfortunately, development support is not something traditional CMS platforms handle very well at scale. Crafter CMS, a 100% open source CMS platform that includes a Git-based repository designed to handle not only authoring but also DevOps seamlessly.

Many development teams use cloud hosted developer platforms like GitLab to assist with their development process. Crafter's Git based CMS supports developers working against remote repositories like GitLab, GitHub, Bitbucket, and others.

By supporting this kind of architecture, Crafter provides a very simple way to flow code forward from a developer and her team all the way up through the CI/CD process to production. We also support a very simple way for any developer or any environment to easily update itself with the latest content from production. DevOps and CMS have never been easy - until now. Crafter CMS's CODE FORWARD, CONTENT BACK™ process makes this process simple and allows you to leverage awesome platforms like GitLab to support your team with the tools they know and love.

In this article, I'll show you how to create a new project in GitLab and then start a new project in Crafter CMS in a way that connects to GitLab as an upstream remote repository so that GitLab can be used to support your development process with your CMS related development!

Step 1: Create a Project in GitLab

                                                        Figure 1: Create a project in GitLab.
  1. Select Blank Project to create a bare project
  2. Enter your project name
  3. Provide a project description

  4. Choose your security level

  5. Click create site

Once your repository is created you will see a screen similar to the one below. You want to make note of the Git URL for the site. You will need this URL in the next step.

Figure 2: New Project in GitLab.


Step 2: Create Your Project in Crafter Studio

Next, you want to log in to Crafter Studio as the admin user. The admin user has the rights to create new projects (called sites.) Click Create Site.

Clicking Create Site will present you with the Create Site dialog. This dialog changes depending on what you choose. Below is an example of the dialog filled out in a way that creates your project locally, set the Github repository as its upstream remote and pushes the initial project contents to the upstream repository.

Let's walk through each part of the dialog:

      Figure 4: Create Site Dialog in Crafter Studio, populating a bare upstream Git repository.
  1. The first thing you need to do is give your site an ID. The ID itself doesn't matter in a sense. It doesn't need to match anything per se, technically speaking the only requirement is that it's unique. That said, it's a best practice to provide an ID that is meaningful/recognizable to the team. If your website is called Sweet.com a good ID might be "sweetdotcom."
  2. Next, because you plan to connect this project to an upstream repository you want to click the plus (+) on "Link to upstream remote Git repository" This will open a number of new fields.
  3. In the "Remote Git Repository Name" field you want to provide a repository name that makes sense. It's common to use "origin" or "upstream."
  4. In the "Remote Git Repository URL" field you must provide the link to the Git repository discussed in Step #1: https://gitlab.com/russdanner/sweet-dotcom.git.
  5. Provide your credentials in Git Remote Repository Username and Password.
  6. Choose the option: "Create site based on blueprint then push to remote bare repository." This means that Crafter Studio will create a new site based on the blueprint you choose, link the remote repository as an upstream and then once the blueprint is installed in the local Repositories it will be pushed automatically to the upstream remote.
  7. Choose your blueprint. There are several out of the box blueprints provided by default. Choose one of these or one of your own. For our example, we'll choose Editorial which is the simple Article style website/project template.
  8. Click Create. Crafter CMS will create the local repositories, Solr core and internal data structures required to support the project and install the blueprint. Once complete it will connect to the upstream and push the contents of the Sandbox repository to the remote.

          Figure 5: Site is created and the contents of the sandbox are automatically pushed to the                                                                         upstream repository.

Step 3: Check GitLab to Make Sure Your Site Is There

Go back to your GitLab project and refresh the screen. You will see the contents of your CMS project in the repository.

Your project is there! Now you are ready to set up your entire development process and CI/CD automation. To learn more about how this is configured check out these blogs:

Let's consider for a moment that you're a new developer joining the team. The topology above is already set up and you just want to get a local environment up and going. Simple. Follow these instructions.

  1. Install Crafter Studio locally (Source build or Binaries bundle)
  2. Login as Admin
  3. Click Create Site
  4. Fill out the Create Site Form as in a similar fashion described in Step 2, except this time you chose the option to create your site based on an existing upstream repository. This can be your team's branch or your own fork. The exact workflow is up to you.

Platforms like GitLab that support agile development and CI/CD are helping bring best practices to the enterprise with easy to use tools that make implementing these activities simple.

Crafter CMS's Git-based repository and DevOps integration make it simple to build CMS and content related projects while adhering to DevOps best practices and leveraging today's best development platforms.

"Code Forward, Content Back" is a trademark of Crafter Software Corporation.

Learn how to get 20x more performance than Elastic by moving to a Time Series database.

Topics:
devops ,cms ,integration ,gitlab

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}