| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
CrafterCMS is a modern content management platform for building digital experience applications including:
You can learn more about CrafterCMS here: https://craftercms.org.
Try CrafterCMS using a pre-built AMI (use the authoring AMI): https://aws.amazon.com/marketplace/seller-profile?id=6d75ffca-9630-44bd-90b4-ac0e99058995
Download a pre-built binary archive here: https://craftercms.com/download.
Read the docs here: https://craftercms.com/docs/
This repository is for developers interested in contributing to CrafterCMS, customizing their own release, or building the latest. It contains all CrafterCMS modules and helps you build the following:
WARNING: CrafterCMS source code development and building is only supported on Unix based systems. If you want to use CrafterCMS in Windows, use Docker or install Windows Subsystem for Linux (WSL) by following the instructions here then use the WSL 2 terminal for all the commands below.
Please make sure your system meets the prerequisites: https://craftercms.com/docs/current/by-role/system-admin/installation.html#requirements
Let's begin :)
If you're building deployable CrafterCMS binaries, we'll clone the tag where the tag is the release you want to build. For example, if we want to build CrafterCMS version 4.4.4, we'll check the CrafterCMS tags list to get the tag for the version we want, which is v4.4.4 for our example:
git clone --branch v4.4.4 https://github.com/craftersoftware/craftercms.gitOR
If you would like to contribute to CrafterCMS, to build a developer's environment, we'll need to clone the develop branch (default):
git clone https://github.com/craftersoftware/craftercms.gitFor more information on CrafterCMS Git Workflow, please review CrafterCMS Git Workflow.
To build deployable and distributable binaries of CrafterCMS, use the Gradle task bundle. This task will generate .tar.gz files ready to be deployed to any system.
Before using bundle task make sure that the environment has been created and deployed using gradle tasks build and deploy
Archives will be named crafter-cms-${environment}-VERSION.tar.gz and can be found in the bundles folder.
./gradlew build deploy bundleTo run CrafterCMS from the binary archive, unzip and follow the instructions in the binary archive's README.txt.
CrafterCMS is a decoupled CMS, and that means you have an authoring environment that caters to content creators, and a different environment, delivery, that handles the end-users that use the experience created by the former.
To build a binary archive for a specific environment:
./gradlew bundle -Penv=authoringArchive will be named crafter-cms-authoring-${version}.tar.gz and can be found in the bundles folder.
For the delivery environment, simply substitute the env=authoring with env=delivery.
To download, build and generate a binary archive from a given tag or branch of the source code,
git clone -b <tag or branch> https://github.com/craftersoftware/craftercms.git ./gradlew build deploy bundleNOTE: When using a tag-based build, you're essentially cloning a point in time to build that specific version of CrafterCMS. That implies that you won't be able to update/nor push changes back.
CrafterCMS comprises a number of headless API-first (GraphQL, REST, in-process) modules that work together to provide the final solution. In this section, we'll start with the simple case of build everything/run everything, and then move on to building/hacking individual modules.
Build all CrafterCMS modules
./gradlew build deployStart CrafterCMS,
./gradlew startYou can now point your browser to http://localhost:8080/studio and start using CrafterCMS. To get started with your first CrafterCMS experience, you can follow this guide: Your First Templated Project or Your First Headless Project.
NOTE:
Stop CrafterCMS,
./gradlew stopYou might have noticed that you essentially have two environments built and running: authoring and delivery. CrafterCMS is a decoupled CMS, and that means you have an authoring environment that caters to content creators, and a different environment, delivery, that handles the end-users that use the experience created by the former.
As a developer, you can use an authoring environment for most tasks without the need to run a delivery environment. It's important to note that delivery essentially runs the same software that's in authoring except Crafter Studio (the authoring tools). By default, this project will build both environments unless instructed otherwise. The authoring environment runs at http://localhost:8080/studio, whereas the delivery environment runs at http://localhost:9080/.
To build, start and stop one of the two environments is similar to building/starting/stopping All.
./gradlew build deploy -Penv=authoring
./gradlew start -Penv=authoring
./gradlew stop -Penv=authoring ./gradlew build deploy -Penv=delivery
./gradlew start -Penv=delivery
./gradlew stop -Penv=deliveryThe mechanics for working with a single module are similar to working with all, with one exception: You can deploy a module to one or both environments (authoring/delivery).
CrafterCMS comprises the following modules (among others):
You'll find these projects under the root project directory and ready for you to contribute to in the folder {Project Root}/{module}.
Start by forking this repository. You can follow the GitHub instructions. The next step is to switch the origin URL to your fork; see these GitHub instructions. Then add an upstream remote pointing at the main craftersoftware/craftercms repo. Follow these steps to make it happen. You can now work in your local system, and build/deploy and ultimately push to your fork. We welcome code contributions, so please do send us pull-requests.
To update your local clone with the latest:
./gradlew selfUpdateYou can build or deploy a module by:
./gradlew studio:build
./gradlew studio:deploy -Penv=authoringNOTE:
For more detailed information and advanced topic, please visit the detailed documentation.
CrafterCMS has two environments, the Authoring Environment and the Delivery Environment.
The authoring environment provides all the content management services, enabling authoring, managing and publishing of all content. It provides a comprehensive set of user-friendly features for managing and optimizing your experiences.
The delivery environment provides content delivery services. It consumes content published from your authoring environment and provides developers with the foundation for quickly building high-performance, flexible experiences.
In this section we will be discussing the scripts for the authoring and delivery environments.
The CrafterCMS Authoring and Delivery scripts will help you on the basic startup and shutdown of the services needed to run a healthy Authoring environment and Delivery environment with the following scripts:
| Script | crafter.sh |
|---|---|
| Description | Main Script to start and stop all needed Services to have a functional CrafterCMS Authoring/Delivery Environment To log the output of the script to a file, set the environment variable CRAFTER_SCRIPT_LOG to point to a log file |
| Synopsis | crafter.sh start|stop|debug|help |
| Arguments | start [withMongoDB] [skipSearch] [skipMongoDB] [tailTomcat] Starts all CrafterCMS services in this order: Crafter Deployer, OpenSearch, Apache Tomcat If withMongoDB is specified MongoDB will be started. If skipSearch is specified OpenSearch will not be started. If skipMongoDB is specified MongoDB will not be started even if the Crafter Profile war is present. If tailTomcat is specified, Tomcat will be tailed and Crafter will shutdown when the script terminates. stop Stops all CrafterCMS services in the same order as they start. debug [withMongoDB] [skipSearch] [skipMongoDB] Starts all CrafterCMS services with the JAVA remote debug port 5000 for Crafter Deployer, and 8000 for Apache Tomcat for the Authoring Environment Starts all CrafterCMS services with the JAVA remote debug port 5001 for Crafter Deployer, and 9000 for Apache Tomcat for the Delivery Environment If withMongoDB is specified MongoDB will be started. If skipSearch is specified OpenSearch will not be started. If skipMongoDB is specified MongoDB will not be started even if the Crafter Profile war is present. start_deployer Starts Deployer stop_deployer Stops Deployer debug_deployer Starts Deployer in debug mode restart_deployer Restarts Deployer start_search Starts OpenSearch stop_search Stops OpenSearch debug_search Starts OpenSearch in debug mode restart_search Restarts OpenSearch start_tomcat Starts Apache Tomcat stop_tomcat Stops Apache Tomcat debug_tomcat Starts Apache Tomcat in debug mode restart_tomcat Restarts Apache Tomcat restart_debug_tomcat Restarts Apache Tomcat in debug mode start_mongodb Starts MongoDB stop_mongodb Stops MongoDB restart_mongodb Restarts MongoDB status Prints the status of all CrafterCMS subsystems status_engine Prints the status of Crafter Engine status_studio Prints the status of Crafter Studio status_profile Prints the status of Crafter Profile status_social Prints the status of Crafter Social status_deployer Prints the status of Crafter Deployer status_search Prints the status of OpenSearch status_mariadb Prints the status of MariaDb status_mongodb Prints the status of MongoDB backup <name> Perform a backup of all data restore <file> Perform a restore of all data upgradedb Perform database upgrade (mariadb-upgrade) |
| Synopsis | startup.sh |
|---|---|
| Description | Starts all needed Services to have a functional CrafterCMS Authoring/Delivery Environment |
| Synopsis | shutdown.sh |
|---|---|
| Description | Stops all needed Services to have a functional CrafterCMS Authoring/Delivery Environment |
| Synopsis | debug.sh |
|---|---|
| Description | Starts all needed Services to have a functional CrafterCMS Authoring/Delivery Environment with the JAVA remote debug ports open and listening port 5000/5001 for Crafter Deployer, and 8000/9000 for Apache Tomcat |
| Script | deployer.sh |
|---|---|
| Description | Script located in $CRAFTER_HOME/bin/crafter-deployer which will start,stop Crafter Deployer for the Authoring/Delivery environment |
| Synopsis | deployer.sh start|stop|debug|help |
| Arguments | start Starts all CrafterCMS services in this order Crafter Deployer OpenSearch, Apache Tomcat stop Stops all CrafterCMS services in the same order as they start. debug Start all CrafterCMS services with the JAVA remote debug port 5000 for Crafter Deployer, and 8000 for Apache Tomcat for the Authoring Environment Starts all CrafterCMS services with the JAVA remote debug port 5001 for Crafter Deployer, and 9000 for Apache Tomcat for the Delivery Environment help Prints script help |
For more information on environment variables used by crafter.sh, see CrafterCMS Environment Variables
Let's look at an example on how to start an authoring environment using the scripts we discussed above. To start the authoring environment, go to your CrafterCMS install folder then run the following:
cd crafter-authoring
./startup.shWhat the above does is go to your authoring environment folder, then run the startup script.
To stop the authoring environment:
./shutdown.shFor more information about Apache Tomcat, and OpenSearch please refer to the following:
As we have seen in the getting started section above, to run a gradle task, we run the following from the root of the project:
./gradlew command [-Penv={env}] ./gradlew module:task [-Penv={env}]e.g.:
./gradlew engine:deploy -Penv=authoringHere's a list of commands (Gradle tasks) available:
| Command command |
Description | Env Options env |
Applies to modules |
|---|---|---|---|
| build | Build all modules |
None | Yes |
| deploy | Deploy module/s or an entire environment | authoring delivery |
Yes |
| bundle | Build deployable and distributable binaries | authoring delivery |
No |
| start | Start CrafterCMS | authoring delivery |
No |
| stop | Stop CrafterCMS | authoring delivery |
No |
| upgrade | Upgrades the installed Tomcat version, etc., without deleting your data then builds and deploys | None | No |
| selfUpdate | Updates the CrafterCMS project (gradle) | None | No |
| clean | Delete all compiled objects | None | Yes |
NOTE:
Let's see some examples of running Gradle tasks here.
To build the authoring and delivery environments, run the following:
./gradlew buildThe Gradle task above will:
Download the dependencies
Build all CrafterCMS modules from the source
To build a module (all module options for task build are listed in the table above), run the following (we'll build the module studio in the example below):
./gradlew studio:buildTo build an environment, run the following (we'll build the authoring environment in the example below:
./gradlew build -Penv=authoringTo start an environment, run the following:
./gradlew start [-Penv={env}]For an alternative to start an environment, run the following:
cd crafter-{env}
./startup.shThe options above will:
For the Authoring Environment:
For the Delivery Environment:
Here's an example starting a delivery environment:
./gradlew start -Penv=deliveryTo stop an environment, run the following:
./gradlew stop [-Penv={env}]For an alternative to stop an environment, run the following:
cd crafter-{env}
./shutdown.shThe Gradle task bundle will build deployable and distributable binaries of CrafterCMS for the authoring and/or delivery environments. This will generate tar files ready to be unarchived and run.
./gradlew bundle [-Penv={env}]Binaries will be saved as crafter-cms-authoring-VERSION.tar.gz for the Authoring Environment and crafter-cms-delivery-VERSION.tar.gz for the Delivery Environment in the bundles folder
Using the common task property env lets you select what environment (authoring or delivery) will be generated.
Let's look at an example using the task property mentioned above:
./gradlew bundle -Penv=authoringThe command above will generate an authoring binary archive in the bundles folder named crafter-cms-authoring-VERSION.tar.gz.
| Back | FazBrowse Home | New Git URL |