Skip to content

craftercms/craftercms

develop
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

build status

CrafterCMS

CrafterCMS is a modern content management platform for building digital experience applications including:

  • Single Page Applications (SPAs) using frameworks like React, Vue, and Angular
  • Native mobile apps and headless applications (IOT, digital signage, wearables, etc.)
  • HTML5 websites using Bootstrap or other HTML frameworks
  • e-commerce front-ends
  • OTT video experiences on AWS Elemental Media Services
  • AR/VR applications using A-Frame

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.org/downloads

Read the docs here: https://docs.craftercms.org/current

This repository is for developers interested in contributing to CrafterCMS, customizing their own release, or building the latest. This parent project helps you build the following:

  1. Deployable CrafterCMS binaries
  2. Docker images
  3. Developer's environment so you can compile and contribute to CrafterCMS

WARNING: CrafterCMS source code development and building is only supported on Unix based systems. If you want to use CrafterCMS in Windows, install Windows Subsystem for Linux (WSL) by following the instructions here then use the WSL 2 terminal for all the commands below. Please refer to the documentation in Installing CrafterCMS on WSL 2.

1. Initial Setup

Please make sure your system meets the prerequisites: https://docs.craftercms.org/current/system-administrators/requirements-supported-platforms.html

Let's begin :)

If you're building deployable CrafterCMS binaries, we'll clone the master branch:

git clone -b master https://github.com/craftercms/craftercms.git

OR

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 -b develop https://github.com/craftercms/craftercms.git

For more information on CrafterCMS Git Workflow, please review: https://github.com/craftercms/craftercms/blob/master/GIT_WORKFLOW.md

2. Summary of Commands and Options

2.1 Commands

  • download Download dependencies
  • clone Clone CrafterCMS modules
  • selfUpdate Update the parent project (craftercms)
  • update Update modules
  • clean Clean modules
  • build Build modules
  • deploy Deploy modules
  • upgrade Upgrade modules (same as update, clean, build, deploy)
  • start Start CrafterCMS
  • stop Stop CrafterCMS
  • status Report status on running environments if any
  • bundle Create deployable binaries

2.2 Options

  • overwriteChangedFiles: Update and overwrite the deployed environment (authoring or delivery) files (binaries, configuration, etc.), default true
  • refreshEnv: Update the deployed environment (authoring or delivery) with any changes to the scripts, default false
  • overwriteArtifact: Update and overwrite the downloaded artifacts (example: OpenSearch, Tomcat, ...) that's cached in the downloads folder by downloading it again, default false
  • gitRemote: Git remote name to use in cloned modules, default origin
  • gitBranch: Git branch to use when cloning modules, default develop (for develop branch)
  • gitUrl: Which Git URL to use, default https://github.com/craftercms/
  • socialRequired: Include Social in the build, default false
  • profileRequired: Include Profile in the build, default false
  • startSearch or withSearch: start OpenSearch, default true
  • startMongoDB: start MongoDB, default false unless Profile or Social are enabled. This is automatic.
  • unitTest: Run unit tests during build, default false
  • shallowClone: Clone only the latest commits and not the entire history (faster, but you lose history), default false
  • bundlesDir: Where to deposit binaries, default ./bundles
  • downloadGrapes: Download Grapes ahead of time (useful when no public Internet is available), default false
  • downloadDir: Where to store downloads, default ./downloads
  • authoringEnvDir: Where to store the authoring environment, default ./crafter-authoring
  • deliveryEnvDir: Where to store the delivery environment, default ./crafter-delivery
  • currentPlatform: What platform to build to (linux or darwin), default is the build machine's OS
  • currentArch: What arch to build to (aarch64 or x86_64), default is the build machine's arch

3. Build Deployable Binaries

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 bundle

To run CrafterCMS from the binary archive, unzip and follow the instructions in the binary archive's README.txt.

3.1. Build Environment Specific Binaries

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=authoring

Archive 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.

3.2 Update, Build and Bundle from a Tag/Branch

To download, build and generate a binary archive from a given tag or branch of the source code,

  1. Clone the branch/tag of craftercms that you want to work with
    git clone -b <tag or branch> https://github.com/craftercms/craftercms/
  1. Download, build and bundle the tag/branch that you want to work with
    ./gradlew build deploy bundle

NOTE: 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.

4. Build a Developer's Environment

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.

4.1. Build, Start and Stop All

4.1.1. Build All

Build all CrafterCMS modules

    ./gradlew build deploy

4.1.2. Start All

Start CrafterCMS,

   ./gradlew start

You 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: https://docs.craftercms.org/current/content-authors/index.html.

NOTE: * The authoring environment runs on port 8080, a great place to start, while the delivery environment runs on port 9080.

4.1.3. Stop All

Stop CrafterCMS,

    ./gradlew stop

4.2. Two Environments: Authoring vs Delivery

You 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/.

4.2.1. Build, Start, and Stop a Specific Environment

To build, start and stop one of the two environments is similar to building/starting/stopping All.

Authoring

    ./gradlew build deploy -Penv=authoring
    ./gradlew start -Penv=authoring
    ./gradlew stop -Penv=authoring

Delivery

    ./gradlew build deploy -Penv=delivery
    ./gradlew start -Penv=delivery
    ./gradlew stop -Penv=delivery

4.3. Crafter Modules

The 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:

You'll find these projects checked out and ready for you to contribute to in the folder src/{modules}.

4.3.1. Forking a Module

Start by forking the module you want to work on. You can follow the GitHub instructions. The next step is to switch the origin url location to be the one just forked, to do so you can use these GitHub instructions. The last step will be to add an upstream repository from the main craftercms repo to your own. 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 project with the latest:

    ./gradlew update

4.3.2. Update, Build, Deploy, Start, and Stop a Module

You can update, build, deploy, start or stop a module by:

    ./gradlew update -Pmodules=studio
    ./gradlew build -Pmodules=studio
    ./gradlew deploy -Pmodules=studio -Penv=authoring
    ./gradlew start -Pmodules=studio -Penv=authoring
    ./gradlew stop -Pmodules=studio -Penv=authoring

NOTE: * If you don't specify the env parameter, it means all environments (where applicable). * In the current version of CrafterCMS, some services run in the same Web container, and that implies the stopping/starting of one of these services will cause other services to stop/start as well.

5. Advanced Topics

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.

5.1 Authoring and Delivery Environment Scripts

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 (mysql_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



Here are the location environment variables used by crafter.sh:

Variable Name Description
Default Value
CRAFTER_HOME CrafterCMS Authoring/Delivery path
{CrafterCMS-install-directory}/crafter-{env}/
CRAFTER_LOGS_DIR CrafterCMS logs file path
$CRAFTER_HOME/logs
CRAFTER_DATA_DIR CrafterCMS data file path
$CRAFTER_HOME/data
CRAFTER_TEMP_DIR CrafterCMS temporary directory path
$CRAFTER_HOME/temp
CRAFTER_BACKUPS_DIR CrafterCMS backup directory path
$CRAFTER_HOME/backups



Here are the environment variables used for hosts and ports in crafter.sh:

Hosts and Ports
Variable Name
Description
Default Value
MAIL_HOST CrafterCMS mail host
localhost
MAIL_PORT CrafterCMS mail port
25
SEARCH_HOST Search host
localhost
SEARCH_PORT Search port
9201
DEPLOYER_HOST Deployer host
localhost
DEPLOYER_PORT Deployer port
9201
MONGODB_HOST MongoDB host
localhost
MONGODB_PORT MongoDB port
27020
MARIADB_HOST MariaDb host
127.0.0.1
MARIADB_PORT MariaDb port
33306
TOMCAT_HOST Tomcat host
localhost
TOMCAT_HTTP_PORT Tomcat Http port
8080
TOMCAT_HTTPS_PORT Tomcat SSL (https) port
8443
TOMCAT_AJP_PORT Tomcat AJP port
8009
TOMCAT_SHUTDOWN_PORT Tomcat shutdown port
8005
TOMCAT_DEBUG_PORT Tomcat debug port
8000



Here are the environment variables used for URLs in crafter.sh:

URLs
Variable Name
Description
Default Value
SEARCH_URL Search URL
http://$SEARCH_HOST:$SEARCH_PORT
DEPLOYER_URL Crafter Deployer URL
http://$DEPLOYER_HOST:$DEPLOYER_PORT
STUDIO_URL Crafter Studio URL
http://$TOMCAT_HOST:$TOMCAT_HTTP_PORT/studio
ENGINE_URL Crafter Engine URL
http://$TOMCAT_HOST:$TOMCAT_HTTP_PORT/studio
PROFILE_URL Crafter Profile URL
http://$TOMCAT_HOST:$TOMCAT_HTTP_PORT/crafter-profile
SOCIAL_URL Crafter Social URL
http://$TOMCAT_HOST:$TOMCAT_HTTP_PORT/crafter-social



Here are the environment variables used for Java options in crafter.sh:

Java options
Variable Name
Description
Default Value
OPENSEARCH_JAVA_OPTS OpenSearch Java options
"-server -Xss1024K -Xmx1G"
DEPLOYER_JAVA_OPTS Deployer Java options
"-server -Xss1024K -Xmx1G"
CATALINA_OPTS Tomcat options
"-server -Xss1024K -Xms1G -Xmx4G"



Here are the environment variables used for Tomcat in crafter.sh:

Tomcat
Variable Name
Description
Default Value
CATALINA_HOME Apache Tomcat files path
$CRAFTER_HOME/bin/apache-tomcat
CATALINA_PID Tomcat process id file save path
$CATALINA_HOME/bin/tomcat.pid
CATALINA_LOGS_DIR Tomcat file logs path
$CRAFTER_LOGS_DIR/tomcat
CATALINA_OUT Tomcat main log file
$CATALINA_LOGS_DIR/catalina.out
CATALINA_TMPDIR Tomcat temporary directory
$CRAFTER_TEMP_DIR/tomcat



Here are the environment variables used for OpenSearch in crafter.sh:

OpenSearch
Variable Name
Description
Default Value
OPENSEARCH_JAVA_HOME OpenSearch Java home directory
$JAVA_HOME
OPENSEARCH_HOME OpenSearch home directory
$CRAFTER_BIN_DIR/opensearch
OPENSEARCH_INDEXES_DIR OpenSearch indexes directory
$CRAFTER_DATA_DIR/indexes-es
OPENSEARCH_LOGS_DIR OpenSearch log files directory
$CRAFTER_LOGS_DIR/logs/search
OPENSEARCH_PID OpenSearch process Id
$OPENSEARCH_HOME/opensearch.pid
OPENSEARCH_USERNAME OpenSearch username
OPENSEARCH_PASSWORD OpenSearch password
SEARCH_DOCKER_NAME OpenSearch Docker name
{env}-search



Here are the environment variables used for the Deployer in crafter.sh:

Deployer
Variable Name
Description
Default Value
DEPLOYER_HOME Crafter Deployer jar files path
$CRAFTER_HOME/bin/crafter-deployer
DEPLOYER_DATA_DIR Deployer data files directory
$CRAFTER_DATA_DIR/deployer
DEPLOYER_LOGS_DIR Deployer log files directory
$CRAFTER_LOGS_DIR/deployer
DEPLOYER_DEPLOYMENTS_DIR Deployer deployments files directory
$CRAFTER_DATA_DIR/repos/sites
DEPLOYER_SDOUT Deployer SDOUT path
$DEPLOYER_LOGS_DIR/crafter-deployer.out
DEPLOYER_PID Deployer process id file
$DEPLOYER_HOME/crafter-deployer.pid



Here are the environment variables used for MongoDB in crafter.sh:

MongoDB
Variable Name
Description
Default Value
MONGODB_HOME MongoDB files path
$CRAFTER_BIN_DIR/mongodb
MONGODB_PID MongoDB process id file save path
$MONGODB_DATA_DIR/mongod.lock
MONGODB_DATA_DIR MongoDB data directory
$CRAFTER_DATA_DIR/mongodb
MONGODB_LOGS_DIR MongoDB log files directory
$CRAFTER_LOGS_DIR/mongodb



Here are the environment variables used for MariaDb in crafter.sh:

MariaDB
Variable Name
Description
Default Value
MARIADB_SCHEMA MariaDb schema
crafter
MARIADB_HOME MariaDb files path
$CRAFTER_BIN_DIR/dbms
MARIADB_DATA_DIR MariaDb data directory
$CRAFTER_DATA_DIR/db
MARIADB_ROOT_USER MariaDb root username
MARIADB_ROOT_PASSWD MariaDb root password
MARIADB_USER MariaDb username
crafter
MARIADB_PASSWD MariaDb user password
crafter
MARIADB_SOCKET_TIMEOUT MariaDB socket timeout
60000
MARIADB_TCP_TIMEOUT MariaDB TCP timeout
120
MARIADB_PID MariaDB process id file
$MARIADB_HOME/$HOSTNAME.pid



Here are the environment variables used for Git in crafter.sh:

Git
Variable Name
Description
Default Value
GIT_CONFIG_NOSYSTEM Ignore Git system wide configuration file
true



Here are the environment variables used for Management Tokens. Remember to update these per installation and provide these tokens to the status monitors:

Management Token
Variable Name
Description
Default Value
STUDIO_MANAGEMENT_TOKEN Authorization token for Studio
defaultManagementToken
ENGINE_MANAGEMENT_TOKEN Authorization token for Engine
defaultManagementToken
DEPLOYER_MANAGEMENT_TOKEN Authorization token for Deployer
defaultManagementToken
PROFILE_MANAGEMENT_TOKEN Authorization token for Profile
defaultManagementToken
SOCIAL_MANAGEMENT_TOKEN Authorization token for Social
defaultManagementToken



Here are the environment variables used to encrypt and decrypt values inside configuration files:

Encryption
Variable Name
Description
Default Value
CRAFTER_ENCRYPTION_KEY Key used for encrypting properties
default_encryption_key
CRAFTER_ENCRYPTION_SALT Salt used for encrypting properties
default_encryption_salt



Here are the environment variables used to encrypt and decrypt values in the database:

Encryption
Variable Name
Description
Default Value
CRAFTER_SYSTEM_ENCRYPTION_KEY Key used for encrypting database values
<someDefaultKeyValue>
CRAFTER_SYSTEM_ENCRYPTION_SALT Salt used for encrypting database values
<someDefaultSaltValue>



Here are the configuration variables used in CrafterCMS:

Configuration
Variable Name
Description
Default Value
CRAFTER_ENVIRONMENT Name used for environment specific configurations in Studio, Engine and Deployer
default



Here are the SSH variables used in CrafterCMS:

Configuration
Variable Name
Description
Default Value
CRAFTER_SSH_CONFIG CrafterCMS folder path for the SSH configuration
$CRAFTER_DATA_DIR/ssh



Here are the environment variables used for Studio's access tokens for API's:

Configuration
Variable Name
Description
Default Value
STUDIO_TOKEN_ISSUER Issuer for generated tokens
Crafter Studio
STUDIO_TOKEN_VALID_ISSUERS Issuer for generated tokens
Crafter Studio
STUDIO_TOKEN_AUDIENCE Audience for generation and validation of access tokens
STUDIO_TOKEN_TIMEOUT Expiration time of access tokens in minutes
5
STUDIO_TOKEN_SIGN_PASSWORD Password for signing the access tokens
STUDIO_TOKEN_ENCRYPT_PASSWORD Password for encrypting the access tokens
STUDIO_REFRESH_TOKEN_NAME Name of the cookie to store the refresh token
refresh_token
STUDIO_REFRESH_TOKEN_MAX Expiration time of the refresh token cookie in seconds
300
STUDIO_REFRESH_TOKEN_SECURE Indicates if refresh token cookie should be secure
false



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.sh

What the above does is go to your authoring environment folder, then run the startup script.

To stop the authoring environment:

   ./shutdown.sh

5.1.1 Other Scripts

For more information about Apache Tomcat, and OpenSearch please refer to the following:

5.2 Gradle Authoring and Delivery Environment Scripts

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}] [-Pmodules={module}]

Here's a list of commands (Gradle tasks) available:

Command
command
Description Env Options
env
Module Options
module
clone Clones CrafterCMS
  • None
  • None
build Build module/s or an entire environment
Note:: build will clone if needed
authoring
delivery
  • None
  • studio
  • deployer
  • engine
  • search
  • social
  • profile
  • core
  • commons
  • studio-ui
  • groovy-sandbox
  • script-security-plugin
  • cli
deploy Deploy module/s or an entire environment authoring
delivery
  • None
  • studio
  • deployer
  • engine
  • search
  • social
  • social-admin
  • profile
  • profile-admin
  • commons
  • core
  • studio-ui
  • groovy-sandbox
  • script-security-plugin
  • cli
bundle Build deployable and distributable binaries authoring
delivery
  • None
start Start CrafterCMS authoring
delivery
  • None
stop Stop CrafterCMS authoring
delivery
  • None
update Update a module or modules
  • None
  • None
  • studio
  • deployer
  • engine
  • search
  • social
  • profile
  • core
  • commons
  • studio-ui
  • groovy-sandbox
  • script-security-plugin
  • cli
upgrade Upgrades the installed Tomcat version, etc, without deleting your data then builds and deploys
  • None
  • None
selfupdate Updates the CrafterCMS project (gradle)
  • None
  • None
clean Delete all compiled objects
  • None
  • None

NOTE: * If you don't specify the env parameter, it means all environments (where applicable). * In the current version of CrafterCMS, some services run in the same Web container, and that implies the stopping/starting of one of these services will cause other services to stop/start as well. * The Gradle task property modules accepts one or multiple module/s, separated by commas like this: ./gradlew build -Pmodules=search,studio * The clean command does not delete previously built environment folders crafter-authoring and crafter-delivery. To build a fresh copy of these two, backup your custom data and delete both folders manually.



Let's see some examples of running Gradle tasks here.

5.2.1 BUILD

To build the authoring and delivery environments, run the following:

   ./gradlew build

The Gradle task above will:

  1. Download the dependencies

  2. Build all CrafterCMS modules from the source (check the section on how to update the source)

    • crafter-authoring
    • crafter-delivery

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 build -Pmodules=studio

To build an environment, run the following (we'll build the authoring environment in the example below:

   ./gradlew build -Penv=authoring

5.2.2 START

To start an environment, run the following:

   ./gradlew start [-Penv={env}]

For an alternative to start an environment, run the following:

   cd crafter-{env}
   ./startup.sh

The options above will:

For the Authoring Environment:

  • The above will start the authoring environment with the default port 8080

For the Delivery Environment:

  • The above will start the delivery environment with the default port 9080

Here's an example starting a delivery environment:

   ./gradlew start -Penv=delivery

5.2.3 STOP

To stop an environment, run the following:

   ./gradlew stop [-Penv={env}]

For an alternative to stop an environment, run the following:

   cd crafter-{env}
   ./shutdown.sh

5.2.4 BUNDLE

The 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=authoring

The command above will generate an authoring binary archive in the bundles folder named crafter-cms-authoring-VERSION.tar.gz.

About

Parent project for Crafter CMS. Issue tracking across all repositories and global builds.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published