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
1.For Creating a new site. Usually we need the anonymized db here if its a development server, or just the ability to create databases. In any case you need to provide with database credentials, perhaps information that needs to be provides in the "add server" step for the root mysql user and the user and databases that will be created under the create new site stage.
2.For Snapshots as i understand it you will be backups of directory and db saving them with a date or name stamp so you can restore right?
3.Should we be supplying git credentials or should they exist on the server?