Search UI Components for React – Search with Drupal Headless
Learn how to build a headless Drupal site with React and SearchStax Studio.
Solr Development / SearchStax APIs for CI/CD On BitBucket Pipeline
SearchStax APIs can be leveraged for CI/CD or Continuous Integration and Continuous Delivery to help Devops teams implement and deliver code changes in an automated manner.
With the SearchStax Managed Solr solution, we include an extensive set of APIs that give development teams the resources they need to seamlessly integrate Solr into their applications, tools and systems. This post provides a quick introduction to CI/CD and offers a simple example for how to leverage the SearchStax APIs for CI/CD on the BitBucket pipeline to automatically push config changes to a Solr cluster.
Editor’s Note: Managed Solr is now SearchStax Cloud. It is the same great product that lets developers set up and deploy Solr infrastructure in minutes.
CI/CD is an application development best practice that combines an agile culture, a set of operating principles and a collection of practices that enable teams to deliver application code changes frequently and more reliably. This implementation approach, also known as the CI/CD pipeline, allows teams to spend more time focused on meeting business requirements, code quality and security because the deployment steps have been automated.
In a world of spread-out development teams, it is more important than ever to have proper tools to be able to work together and to deliver work in the most efficient way possible. With consistency in the application integration process, teams using CI/CD pipeline are able to commit code changes more frequently leading to better collaboration and software quality.
In a simple use case, SearchStax APIs can be used to set up a configuration update pipeline where Solr configs are updated any time a change is made in the repository. For more complex use cases, such as a Blue-Green deployment (which we discussed in an earlier blog post), a software release can be achieved to create a replica of the primary deployment environment, push changes to the replica, then backup, restore and switch the replica to production.
To demonstrate how to use the SearchStax APIs. we take a look at a simple example to build a pipeline where config changes are pushed automatically to the Solr cluster. The instructions in this example are based on the BitBucket Pipeline, but the same instructions would apply to other CI/CD pipelines as well, including GitHub Actions.
A Solr config can be uploaded from a repository by:
We have translated the above steps into a python script that can be placed in the repository and executed via the BitBucket pipeline.
An archive can be created using any number of libraries. In this example, we have used the “zipfile” library.
Zookeeper Read API by SearchStax will let us check if the config already exists. If it does, then Zookeeper Delete API by SearchStax will help us delete the config.
After updating the Solr config, we should reload all the collections that are using the updated config so that the changes to the configs are picked up by the Solr collections. This example uses CLUSTERSTATUS API and RELOAD API from Solr to reload the collections.
We can compile the modules into a single script that’s placed in a repository and can be called in a BitBucket Pipeline directly.
Learn how to build a headless Drupal site with React and SearchStax Studio.
It’s easier than ever to build customized site search with SearchStax Studio. Learn how to build Vue search apps for
In this blog, we delve into Headless Content Management Systems, their role in content storage and rendering, and various rendering
Copyrights © SearchStax Inc.2014-2023. All Rights Reserved.
close
close
close