Varbase Sub Profile Generator

Having a generator tool helper. Which helps in extending Varbase profile using the sub profile method.

Step #1 Download

Download the Varbase Sub profile generator from

https://bitbucket.org/Vardot/varbase-subprofile-generator

and get ready to generate profiles.

Example: Let consider that the /var/www/html/products directory was the default products workspace directory.

  • Open a terminal window

  • Create the directory if it was not created yet

  • Change directory to the coding workspace directory

  • Clone the Varbase Subprofile generator

  • Change directory to the varbase-subprofile-generator directory

mkdir /var/www/html/products
cd /var/www/html/products
git clone git@github.com:Vardot/varbase-subprofile-generator.git
cd /var/www/html/products/varbase-subprofile-generator

Step #2 Select a Version

Set the version of the generator

Example: In case of wanting to generate a sub profile of Varbase 9.0.x run the following commands:

cd /var/www/html/products/varbase-subprofile-generator
git checkout 9.0.0

Step #3 Change Settings

Notice the settings.yml file which will set the default settings for Varbase Sub Profile Generator.

source:
  profile:
    git_repository: git@github.com:Vardot/varbase_subprofile_basic.git
    dev_branch:
      name: 9.0.x
      alias: 9.0.x-dev
      label: 9.0.x
  project:
    git_repository: git@github.com:Vardot/varbase-subprofile-basic-project.git
    dev_branch:
      name: 9.0.x
      alias: 9.0.x-dev
      label: 9.0.x
target:
  profile:
    dev_branch:
      name: 1.0.x
      alias: 1.0.x-dev
      label: 1.0.x
  project:
    dev_branch:
      name: 1.0.x
      alias: 1.0.x-dev
      label: 1.0.x

Change the dev_version to mach with the target dev_branch name and alias.

Example: The CV profile

Change target dev_branch for the profile and project to 3.0.x for the CV example profile

target:
  profile:
    dev_branch:
      name: 3.0.x
      alias: 3.0.x-dev
      label: 3.0.x
  project:
    dev_branch:
      name: 3.0.x
      alias: 3.0.x-dev
      label: 3.0.x

Step #4 Generate

Run the generate command.

Example: The CV profile

In a case of creating a Varbase sub profile named "cv". Run the following commands in the local terminal:

$ bash generate-varbase-subprofile.sh "cv" "/var/www/html/products" -vvv

The following directories will be created for the new sub profile.

$ cd /var/www/html/products
$ ls -l

products/
 - cv/
 - cv-project/

Step #5 Public Repositories

Saving the code in a repository is important. To let Composer build the project or manage the workflow of updates over code and config changes.

Push the generated profile and project template to https://github.com or https://gitlab.com for example.

Submit them to https://packagist.org to be able to create projects or manage projects using the composer.

Commit to a new project in https://drupal.org to list the profile in the projects catalog in Drupal.org

Example: The CV profile

CV at Github.com

CV at Packagist.org

CV at Drupal.org

Step #6 Changing

Have a development working directory to work on changing on generated sub profile.

Example: The CV profile

To install the development version of CV 3.0.x run this command:

composer create-project vardot/cv-project:3.0.x-dev PROJECT_DIR_NAME --stability dev --no-interaction

Commits changes over the code or configs to the cv and cv-project to the public repositories.

That will reflect on composer create-project, composer install or composer update.

CV on Github.com

Make sure that changes are updated in github.com site.

Do more composer create-project after committing changes and a new install for the site. To make sure that changes are working on install.

CV on Packagist.org

Make sure that changes are updated in the packagest.org site too.

CV on Drupal.org

Make sure that the code is synced with the project in Drupal.org site.

Last updated