compudeploy
creates, deploys and updates CiviCRM websites
- The creation command should take a single repository URL
- The host for the site should be flexible: local host, local vagrant, local docker, remote host, AWS
- The type of site should be flexible: a profile or a "full site" repository
Adds a server configuration for deployment
compubuild add-server --type=remote --name=testing1 --target=<target>
name
: The name of the configurationtype
: What kind of server is it. For example jenkins, remote, aws, local or dockertarget
: Not required for all types, but if a server is remote points to where it is located
Creates a new site
compubuild create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=testing1 \
--name=testing1 \
--git-ref=CGP-my-feature-branch \
--git-merge-ref=CGP-my-workstream-branch \
--cms-db=./dumps/drupal-test.sql \
--civi-db=./dumps/civi-test.sql
name
: The name of the siteserver
: Which server it should be deployed tourl
: The URL for the sitebuild-dir
: Where on the server the site should be createdrepo
: What repository to use to create the sitegit-ref
: Optional branch of the repository to check out before buildinggit-merge
: Optional branch to merge intogit-ref
before buildingcms-db
: Allows import of a certain database before running upgraders for Drupal. Supports local and remote filescivi-db
: Allows import of a certain database before running upgraders for CiviCRM. Supports local and remote files
Deploys code changes to an existing site
compubuild deploy
--name=testing1 \
--git-ref=CGP-my-feature-branch \
--git-merge-ref=CGP-my-workstream-branch
--skip-upgraders \
--cms-db=scp://123.23.234.42/dumps/drupal.mysql \
--civi-db=scp://123.23.234.42/dumps/civicrm.mysql
name
: The name of the sitegit-ref
: Optional branch of the repository to check outgit-merge
: Optional branch to merge intogit-ref
skip-upgraders
: Whether to run the Drupal and CiviCRM upgraders during deploymentcms-db
: Allows import of a certain database before running upgraders for Drupal. Supports local and remote filescivi-db
: Allows import of a certain database before running upgraders for CiviCRM. Supports local and remote files
Destroy all resources related to a site: db, files, vhosts
compubuild destroy --name=mysite
name
: The name of the site to destroy
Takes a snapshot of the database
compubuild snapshot --name=mysite --snapshot-name=pre-release
name
: the name of the sitesnapshot-name
: the name to store the snapshot as, defaults to "default"
Restores the databases using a snapshot name or defaults to "default" if none provided
compubuild restore --name=mysite --snapshot-name=pre-release
name
: the name of the sitesnapshot-name
: the name to store the snapshot as, defaults to "default"
Executes a command on a site and returns the result
compubuild exec --name=mysite --dir=profiles/compuclient --cmd=phpunit4
name
: The name of the sitedir
: The directory from where the command should be executedcmd
: The command to run
add-server --type=local --name=local
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/home/michael/sites/mysite \
--url=mysite.local \
--server=local \
--name=local-mysite
add-server --type=vagrant --name=vagrant1
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/home/michael/sites/mysite \
--url=mysite.local \
--server=vagrant1 \
--name=local-mysite
add-server --type=remote --name=testing1 --target=184.112.23.23
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=testing1 \
--name=testing1
add-server --type=remote --name=testing1 --target=184.112.23.23
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=testing1 \
--git-ref=CGP-my-new-branch \
--name=pr221
add-server --type=remote --name=testing1 --target=184.112.23.23
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=testing1 \
--git-ref=CGP-my-new-branch \
--name=pr221
exec --dir=/var/www/mysite/profiles/compuclient phpunit4
add-server --type=aws --name=aws1
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=aws1
add-server --type=remote --name=mysite --target=184.112.23.23
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=mysite
add-server --type=remote --name=mysite --target=184.112.23.23
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=mysite
--name=mysite
deploy --name=mysite --git-ref=1.1.0
add-server --type=remote --name=mysite --target=184.112.23.23
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--name=mysite \
--server=mysite \
--git-ref=1.0.0
snapshot --name=mysite --name=pre-relase
deploy --name=mysite --git-ref=1.1.0 #returns failure
restore --name=mysite --name=pre-release
deploy --name=mysite --git-ref=1.0.0
add-server --type=remote --name=mysite --target=184.112.23.23
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=testing1 \
--git-ref=CGP-my-new-branch \
--name=pr221 \
--cms-db=./../dumps/brochure_drupal.mysql \
--civi-db=./../dumps/brochure_civicrm.mysql
add-server --type=remote --name=dev1 --type=aws
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--server=testing1 \
--git-ref=CGP-my-new-branch \
--name=pr221 \
--cms-db=scp://123.23.234.42/dumps/drupal.mysql \
--civi-db=scp://123.23.234.42/dumps/civicrm.mysql
add-server --type=remote --name=mysite --target=184.112.23.23
create --repo=http://bitbucket.org/compucorp/mysite \
--build-dir=/var/www/mysite \
--url=mysite.civihr.net \
--server=testing1 \
--git-ref=CGP-my-new-branch \
--name=pr221
destroy pr221
- [] create brochure-site from master in Vagrant
- [] create brochure-site from master in Docker-
- [] create profile site from compuclient master in Vagrant
- [] create brochure-site and use imported db dumps
- [] create brochure-site based of different branch
- [] create brochure-site with different branch and merge staging
- [] create profile site in remote host
@mickadoo a few questions:
add-server
command?local
if we can guarantee that we'll always use it on the server where the site will run. This will probably make things much much simplergit-
prefix from the params name. It is very unlikely, but we might decide to not user git in the future.base-branch
,workstream-branch
andbranch
, wherestaging
would be thebase-branch
,epic
would be theworkstream-branch
andfeature
thebranch
. This can also be useful when you want to test a hotfix, which can be merged to bothmaster
andstaging