summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Pugh2017-05-23 13:39:19 -0400
committerJon Pugh2017-05-23 13:39:19 -0400
commitdfa824f7b9f42bd949824ce31c06f89f5aa456f6 (patch)
treed5c3c954dc2745b7c43973785ddb13fd9a179ab6
parent326e1b6c6019dd426c7355a0d592833bab70abf2 (diff)
parente10d629c76b876f3440561452c27b7ed2732efc1 (diff)
Merge branch '7.x-3.x' into 2754069-decouple-install-alternate2754069-decouple-install-alternate
-rw-r--r--.gitlab-ci.yml182
-rw-r--r--Provision/Config.php5
-rw-r--r--Provision/Config/Drushrc/Alias.php8
-rw-r--r--Provision/Service.php31
-rw-r--r--README.md4
-rw-r--r--aegir-release.make5
-rw-r--r--debian/changelog27
-rw-r--r--debian/control2
-rw-r--r--http/Provision/Config/Apache/server.tpl.php20
-rw-r--r--http/Provision/Config/Http/Server.php17
-rw-r--r--http/Provision/Config/Http/Site.php7
-rw-r--r--http/Provision/Config/Http/Ssl/Site.php8
-rw-r--r--http/Provision/Config/Nginx/Inc/vhost_include.tpl.php33
-rw-r--r--http/Provision/Config/Nginx/server.tpl.php2
-rw-r--r--http/Provision/Config/Nginx/subdir.tpl.php29
-rw-r--r--http/Provision/Service/http/pack.php2
-rw-r--r--http/Provision/Service/http/public.php3
-rw-r--r--http/Provision/Service/http/ssl.php5
-rw-r--r--platform/drupal/packages_6.inc82
-rw-r--r--platform/drupal/packages_7.inc95
-rw-r--r--platform/drupal/packages_8.inc80
-rw-r--r--platform/install.provision.inc30
-rw-r--r--platform/provision_drupal.drush.inc150
-rw-r--r--provision.api.php32
-rw-r--r--provision.drush.inc1
-rwxr-xr-xscripts/ci-aegir-dev-install-apt-debian8.sh35
-rwxr-xr-xscripts/ci-aegir-dev-install-apt-debian9.sh35
-rwxr-xr-xscripts/ci-aegir-dev-install-apt-ubuntu.sh30
-rwxr-xr-xscripts/ci-aegir-install-apt-debian.sh30
-rwxr-xr-xscripts/ci-aegir-install-apt-ubuntu.sh32
-rwxr-xr-xscripts/ci-aegir-stable-install-apt-debian.sh28
-rwxr-xr-xscripts/release.sh (renamed from release.sh)24
32 files changed, 898 insertions, 176 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..e172b6c
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,182 @@
+# Is performed before the scripts in the stages step
+before_script:
+ - source /etc/profile
+
+# Defines stages which are to be executed
+stages:
+ - build
+ - test
+ - publish
+ - upgradetest
+
+# Stage "build"
+build:deb:
+ stage: build
+ image: aegir/hostmaster:packaging_base
+ script:
+ - export commit=$(git log -n 1 --oneline | sed 's/ .*$//')
+ - export version=$(sed -ne 's/^[^(]*(\([^)]*\)).*/\1/;1p' debian/changelog)
+ - export new_version="${version}+${CI_BUILD_ID}.${commit}"
+ - dch -D unstable --newversion "$new_version" "automatic GitLab CI build ${CI_BUILD_ID}"
+ - dpkg-buildpackage
+ - mkdir build
+ - mv -v ../aegir3*.deb build/
+ - mv -v ../aegir3*.tar.gz build/
+ - mv -v ../aegir3*.dsc build/
+ - mv -v ../aegir3*.changes build/
+
+ # The files which are to be made available in GitLab as artifacts.
+ artifacts:
+ paths:
+ - build/*
+
+
+# Stage "test"
+test:debian-jessie-aegir3-apt:
+ stage: test
+ image: debian:jessie
+ dependencies:
+ - build:deb
+
+ before_script:
+ - apt-get update
+ # Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
+ - echo "#!/bin/sh" > /usr/sbin/policy-rc.d
+ - echo "exit 0" >> /usr/sbin/policy-rc.d
+ - apt-get install --yes sudo curl
+
+ script: "scripts/ci-aegir-dev-install-apt-debian8.sh"
+
+test:debian-stretch-aegir3-apt:
+ stage: test
+ image: debian:stretch
+ allow_failure: true
+ dependencies:
+ - build:deb
+ only:
+ - 7.x-3.x
+
+ before_script:
+ - apt-get update
+ # Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
+ - echo "#!/bin/sh" > /usr/sbin/policy-rc.d
+ - echo "exit 0" >> /usr/sbin/policy-rc.d
+ - apt-get install --yes sudo curl
+
+ script: "scripts/ci-aegir-dev-install-apt-debian9.sh"
+
+test:ubuntu-xenial-aegir3-apt:
+ stage: test
+ image: ubuntu:xenial
+ dependencies:
+ - build:deb
+ only:
+ - 7.x-3.x
+
+ before_script:
+ - apt-get update
+ # Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
+ - echo "#!/bin/sh" > /usr/sbin/policy-rc.d
+ - echo "exit 0" >> /usr/sbin/policy-rc.d
+ - apt-get install --yes sudo curl
+
+ script: "scripts/ci-aegir-dev-install-apt-ubuntu.sh"
+
+test:behat:
+ stage: test
+ image: aegir/hostmaster:packaging_base
+ dependencies:
+ - build:deb
+ allow_failure: true
+ variables:
+ AEGIR_TESTS_VERSION: "master"
+
+ before_script:
+ - sudo apt-get update
+ - sudo apt-get install --yes apt-transport-https ca-certificates curl gnupg2 software-properties-common
+ - curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
+ - sudo apt-key fingerprint 0EBFCD88
+ - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
+ - sudo apt-get update
+ - sudo apt-get install --yes docker-ce
+ - docker info
+ - git clone http://github.com/aegir-project/tests.git tests
+ - cd tests
+ - git checkout $AEGIR_TESTS_VERSION
+
+ # Run prepare scripts.
+ - cd travis
+ - sudo bash prepare-docker.sh
+ - bash prepare-testenv.sh
+
+ script:
+
+ # Tests are included in the docker-compose.yml file in the tests repo.
+ - sudo docker-compose -f docker-compose-provision.yml run hostmaster
+
+
+
+
+publish:unstable-repo:
+ stage: publish
+ dependencies:
+ - build:deb
+ allow_failure: true
+
+ only:
+ - 7.x-3.x
+
+ image: ruby:2.1
+ before_script:
+ # install ssh-agent
+ - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
+
+ # run ssh-agent
+ - eval $(ssh-agent -s)
+
+ # add ssh key stored in SSH_PRIVATE_KEY variable to the agent store
+ - ssh-add <(echo "$SSH_PRIVATE_KEY")
+
+ - mkdir -p ~/.ssh
+ - ls -la /.dockerenv
+ - echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
+ - cat ~/.ssh/known_hosts
+
+ script:
+ - ls -lah build/*
+ - scp build/* ci@aegir0.aegir.coop:/var/www/repos/incoming/
+ # reprepro should pick this up in seconds and update the repository index.
+
+
+# Upgrade the latest stable Aegir to our unstable repo.
+upgradetest:debian-jessie-aegir3-apt-upgrade:
+ stage: upgradetest
+ image: debian:jessie
+ dependencies:
+ - publish:unstable-repo
+
+ when: manual
+
+ before_script:
+ - apt-get update
+ # Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
+ - echo "#!/bin/sh" > /usr/sbin/policy-rc.d
+ - echo "exit 0" >> /usr/sbin/policy-rc.d
+ - apt-get install --yes sudo curl cron
+
+ script:
+ - "scripts/ci-aegir-stable-install-apt-debian8.sh"
+ # extra step to run the task queue.
+ - sudo su aegir --login --command 'drush @hostmaster php-eval "echo hosting_task_count();"'
+ - sudo su aegir --login --command 'drush @hostmaster hosting-tasks --force'
+ - sudo su aegir --login --command 'drush @hostmaster php-eval "echo hosting_task_count();"'
+ - sudo su aegir --login --command 'drush @hostmaster hosting-tasks --force'
+ - sudo su aegir --login --command 'drush @hostmaster php-eval "echo hosting_task_count();"'
+ - sudo su aegir --login --command 'drush @hostmaster php-eval "echo hosting_task_count_running();"'
+ - sleep 2m
+ - sudo su aegir --login --command 'drush @hostmaster php-eval "echo hosting_task_count_running();"'
+ # upgrade to the latest version from the unstable repo.
+ - rm -v /etc/apt/sources.list.d/aegir-stable.list
+ - echo "deb http://debian2.aegirproject.org unstable main" | sudo tee -a /etc/apt/sources.list.d/aegir-unstable.list
+ - sudo apt-get update
+ - sudo apt-get --yes upgrade
diff --git a/Provision/Config.php b/Provision/Config.php
index 763b003..ea77e25 100644
--- a/Provision/Config.php
+++ b/Provision/Config.php
@@ -167,6 +167,11 @@ class Provision_Config {
* array.
*/
private function render_template($template, $variables) {
+
+ // Allow modules to alter the variables before writing to the template.
+ // @see hook_provision_config_variables_alter()
+ drush_command_invoke_all_ref('provision_config_variables_alter', $variables, $template, $this);
+
drush_errors_off();
extract($variables, EXTR_SKIP); // Extract the variables to a local namespace
ob_start(); // Start output buffering
diff --git a/Provision/Config/Drushrc/Alias.php b/Provision/Config/Drushrc/Alias.php
index 71fa03b..e6c2a91 100644
--- a/Provision/Config/Drushrc/Alias.php
+++ b/Provision/Config/Drushrc/Alias.php
@@ -18,6 +18,14 @@ class Provision_Config_Drushrc_Alias extends Provision_Config_Drushrc {
*/
function __construct($context, $data = array()) {
parent::__construct($context, $data);
+
+ if (is_array($data['aliases'])) {
+ $data['aliases'] = array_unique($data['aliases']);
+ }
+ if (is_array($data['drush_aliases'])) {
+ $data['drush_aliases'] = array_unique($data['drush_aliases']);
+ }
+
$this->data = array(
'aliasname' => ltrim($context, '@'),
'options' => $data,
diff --git a/Provision/Service.php b/Provision/Service.php
index 58b97bf..2d732b1 100644
--- a/Provision/Service.php
+++ b/Provision/Service.php
@@ -55,7 +55,13 @@ class Provision_Service extends Provision_ChainedState {
}
- // All services have the ability to have an associated restart command and listen port.
+ /**
+ * All services have the ability to have an associated restart command and listen port.
+ *
+ * If services require a fixed path config file, implement the function symlink_service() inside this method.
+ *
+ * @See Provision_Service_http_public::init_server()
+ */
function init_server() {
if (!is_null($this->service)) {
if ($this->has_port) {
@@ -336,4 +342,27 @@ class Provision_Service extends Provision_ChainedState {
static function option_documentation() {
return array();
}
+
+ /**
+ * Save symlink for this server from /var/aegir/config/APPLICATION_NAME.conf -> /var/aegir/config/SERVER/APPLICATION_NAME.conf
+ *
+ * If service requires a fixed path config file, implement this function in the init_server() method.
+ *
+ * @See Provision_Service_http_public::init_server()
+ */
+ function symlink_service() {
+ $file = $this->application_name . '.conf';
+ // We link the app_name.conf file on the remote server to the right version.
+ $cmd = sprintf('ln -sf %s %s',
+ escapeshellarg($this->server->config_path . '/' . $file),
+ escapeshellarg($this->server->aegir_root . '/config/' . $file)
+ );
+
+ if ($this->server->shell_exec($cmd)) {
+ drush_log(dt("Created symlink for %file on %server", array(
+ '%file' => $file,
+ '%server' => $this->server->remote_host,
+ )), 'notice');
+ };
+ }
}
diff --git a/README.md b/README.md
index 4afd129..20cda0e 100644
--- a/README.md
+++ b/README.md
@@ -34,4 +34,6 @@ Other documentation for developers is also available at:
http://docs.aegirproject.org/en/3.x/extend/
-Build status: [![Build Status](https://travis-ci.org/aegir-project/provision.svg?branch=7.x-3.x)](https://travis-ci.org/aegir-project/provision)
+Build status Travis: [![Build Status](https://travis-ci.org/aegir-project/provision.svg?branch=7.x-3.x)](https://travis-ci.org/aegir-project/provision) (in-depth and manual install)
+
+Build status GitLab CI: [![build status](https://gitlab.com/aegir/provision/badges/7.x-3.x/build.svg)](https://gitlab.com/aegir/provision/commits/7.x-3.x) (debian packages)
diff --git a/aegir-release.make b/aegir-release.make
index b6999da..d59e783 100644
--- a/aegir-release.make
+++ b/aegir-release.make
@@ -5,6 +5,7 @@ api = 2
projects[drupal][type] = "core"
; The release.sh script updates the version of hostmaster.
-projects[hostmaster][version] = "7.x-3.0-dev"
projects[hostmaster][type] = "profile"
-projects[hostmaster][variant] = "projects"
+projects[hostmaster][download][type] = "git"
+projects[hostmaster][download][tag] = "7.x-3.0-dev"
+projects[hostmaster][download][url] = "http://git.drupal.org/project/hostmaster.git"
diff --git a/debian/changelog b/debian/changelog
index f2437c7..2694fe7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,30 @@
+aegir3-provision (3.11~beta2) unstable; urgency=medium
+
+ * Preparations for the 3.11 release, testing the GitLab build process.
+ * Many bugfixes and UI improvements, see http://aegir.readthedocs.org/en/3.x/release-notes/3.11
+
+ -- Herman van Rink <helmo@initfour.nl> Tue, 23 May 2017 11:13:35 +0200
+
+aegir3-provision (3.11~beta1) unstable; urgency=medium
+
+ * Preparations for the 3.11 release, testing the GitLab build process.
+ * Many bugfixes and UI improvements, see http://aegir.readthedocs.org/en/3.x/release-notes/3.11
+
+ -- Herman van Rink <helmo@initfour.nl> Thu, 18 May 2017 14:28:24 +0200
+
+aegir3-provision (3.10) unstable; urgency=medium
+
+ * Many bugfixes and UI improvements, see http://aegir.readthedocs.org/en/3.x/release-notes/3.10
+
+ -- Herman van Rink <helmo@initfour.nl> Thu, 16 Mar 2017 11:08:16 +0100
+
+aegir3-provision (3.9) unstable; urgency=medium
+
+ * Makefile tweaks to allow for minor releases to update Drupal core
+ * Many bugfixes and UI improvements, see http://aegir.readthedocs.org/en/3.x/release-notes/3.9
+
+ -- Herman van Rink <helmo@initfour.nl> Thu, 05 Jan 2017 20:23:06 +0100
+
aegir3-provision (3.9~beta1) unstable; urgency=medium
* Preparations for the 3.9 release
diff --git a/debian/control b/debian/control
index a963047..499cab5 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Vcs-browser: http://drupalcode.org/project/provision.git
Package: aegir3-provision
Architecture: all
-Depends: ${misc:Depends}, php5-cli (>= 5.3) | php7.0-cli, php5-mysql | php7.0-mysql, mysql-client | mariadb-client, sudo, postfix | mail-transport-agent, apache2 | nginx, adduser, ucf, curl
+Depends: ${misc:Depends}, php5-cli (>= 5.3) | php7.0-cli, php5 | php7.0-xml, php5-mysql | php7.0-mysql, mysql-client | mariadb-client, sudo, postfix | mail-transport-agent, apache2 | nginx, adduser, ucf, curl
Recommends: mysql-server | mariadb-server, rsync
Conflicts: aegir-provision, aegir-provision2, aegir2-provision
Replaces: aegir-provision, aegir-provision2, aegir2-provision
diff --git a/http/Provision/Config/Apache/server.tpl.php b/http/Provision/Config/Apache/server.tpl.php
index 621e7ac..5efa19d 100644
--- a/http/Provision/Config/Apache/server.tpl.php
+++ b/http/Provision/Config/Apache/server.tpl.php
@@ -17,18 +17,30 @@ NameVirtualHost *:<?php print $http_port; ?>
LoadModule rewrite_module modules/mod_rewrite.so
</IfModule>
+<?php
+if (drush_get_option('provision_apache_conf_suffix', FALSE)) {
+ $include_statement = 'IncludeOptional ';
+ $include_suffix = '/*.conf';
+}
+else {
+ $include_statement = 'Include ';
+ $include_suffix = '';
+}
+
+?>
+
# other configuration, not touched by aegir
# this allows you to override aegir configuration, as it is included before
-Include <?php print $http_pred_path ?>
+<?php print $include_statement . $http_pred_path . $include_suffix ?>
# virtual hosts
-Include <?php print $http_vhostd_path ?>
+<?php print $include_statement . $http_vhostd_path . $include_suffix ?>
# platforms
-Include <?php print $http_platformd_path ?>
+<?php print $include_statement . $http_platformd_path . $include_suffix ?>
# other configuration, not touched by aegir
# this allows to have default (for example during migrations) that are eventually overriden by aegir
-Include <?php print $http_postd_path ?>
+<?php print $include_statement . $http_postd_path . $include_suffix ?>
<?php print $extra_config; ?>
diff --git a/http/Provision/Config/Http/Server.php b/http/Provision/Config/Http/Server.php
index 14459d7..1a9fe52 100644
--- a/http/Provision/Config/Http/Server.php
+++ b/http/Provision/Config/Http/Server.php
@@ -16,23 +16,6 @@ class Provision_Config_Http_Server extends Provision_Config_Http {
function write() {
parent::write();
-
- if (isset($this->data['application_name'])) {
- $file = $this->data['application_name'] . '.conf';
- // We link the app_name.conf file on the remote server to the right version.
- $cmd = sprintf('ln -sf %s %s',
- escapeshellarg($this->data['server']->config_path . '/' . $file),
- escapeshellarg($this->data['server']->aegir_root . '/config/' . $file)
- );
-
- if ($this->data['server']->shell_exec($cmd)) {
- drush_log(dt("Created symlink for %file on %server", array(
- '%file' => $file,
- '%server' => $this->data['server']->remote_host,
- )));
-
- };
- }
}
function filename() {
diff --git a/http/Provision/Config/Http/Site.php b/http/Provision/Config/Http/Site.php
index b329234..35c7026 100644
--- a/http/Provision/Config/Http/Site.php
+++ b/http/Provision/Config/Http/Site.php
@@ -11,7 +11,12 @@ class Provision_Config_Http_Site extends Provision_Config_Http {
function filename() {
- return $this->data['http_vhostd_path'] . '/' . $this->uri;
+ if (drush_get_option('provision_apache_conf_suffix', FALSE)) {
+ return $this->data['http_vhostd_path'] . '/' . $this->uri . '.conf';
+ }
+ else {
+ return $this->data['http_vhostd_path'] . '/' . $this->uri;
+ }
}
function process() {
diff --git a/http/Provision/Config/Http/Ssl/Site.php b/http/Provision/Config/Http/Ssl/Site.php
index 3d91ef3..00658db 100644
--- a/http/Provision/Config/Http/Ssl/Site.php
+++ b/http/Provision/Config/Http/Ssl/Site.php
@@ -60,6 +60,14 @@ class Provision_Config_Http_Ssl_Site extends Provision_Config_Http_Site {
if ($this->ssl_enabled) {
// XXX: to be tested, not sure the data structure is sound
+ //
+ // ACHTUNG! This deletes even perfectly good certificate and key.
+ // There is no check in place to determine if the cert is "stale".
+ // Not sure what the idea was behind this cleanup, but it looks like
+ // an unfinished work, aggressively deleting existing cert/key pair,
+ // even if there is absolutely no reason to do so -- like when the site
+ // is simply migrated to another platform, while its name doesn't change.
+ //
Provision_Service_http_ssl::free_certificate_site($this->ssl_key, $this);
}
}
diff --git a/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php b/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
index 73ac20a..5d9e38d 100644
--- a/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
+++ b/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
@@ -1189,7 +1189,17 @@ location @drupal {
return 418;
}
<?php endif; ?>
- rewrite ^/(.*)$ /index.php?q=$1 last;
+ ###
+ ### For Drupal >= 7
+ ###
+ if ($sent_http_x_generator) {
+ add_header X-Info-Gen "Modern";
+ rewrite ^ /index.php?$query_string last;
+ }
+ ###
+ ### For Drupal <= 6
+ ###
+ rewrite ^/(.*)$ /index.php?q=$1 last;
}
<?php if ($nginx_config_mode == 'extended'): ?>
@@ -1198,11 +1208,11 @@ location @drupal {
###
location @nobots {
###
- ### Support for Accelerated Mobile Pages (AMP).
+ ### Support for Accelerated Mobile Pages (AMP) when bots are redirected below
###
- if ( $query_string ~ "^amp$" ) {
- rewrite ^/(.*)$ /index.php?q=$1 last;
- }
+ # if ( $query_string ~ "^amp$" ) {
+ # rewrite ^/(.*)$ /index.php?q=$1 last;
+ # }
###
### Send all known bots to $args free URLs (optional)
@@ -1218,7 +1228,18 @@ location @nobots {
if ( $args ~* "=PHP[A-Z0-9]{8}-" ) {
return 404;
}
- rewrite ^/(.*)$ /index.php?q=$1 last;
+
+ ###
+ ### For Drupal >= 7
+ ###
+ if ($sent_http_x_generator) {
+ add_header X-Info-Gen "Modern";
+ rewrite ^ /index.php?$query_string last;
+ }
+ ###
+ ### For Drupal <= 6
+ ###
+ rewrite ^/(.*)$ /index.php?q=$1 last;
}
###
diff --git a/http/Provision/Config/Nginx/server.tpl.php b/http/Provision/Config/Nginx/server.tpl.php
index ec17484..781d84c 100644
--- a/http/Provision/Config/Nginx/server.tpl.php
+++ b/http/Provision/Config/Nginx/server.tpl.php
@@ -288,7 +288,7 @@ map $http_user_agent $deny_on_high_load {
###
map $args $is_denied {
default '';
- ~*delete.+from|insert.+into|select.+from|union.+select|onload|\.php.+src|system\(.+|document\.cookie|\;|\.\. is_denied;
+ ~*delete.+from|insert.+into|select.+from|union.+select|onload|\.php.+src|system\(.+|document\.cookie|\;|\.\.\/ is_denied;
}
<?php endif; ?>
diff --git a/http/Provision/Config/Nginx/subdir.tpl.php b/http/Provision/Config/Nginx/subdir.tpl.php
index c2669bc..a45b88d 100644
--- a/http/Provision/Config/Nginx/subdir.tpl.php
+++ b/http/Provision/Config/Nginx/subdir.tpl.php
@@ -1154,6 +1154,16 @@ location @drupal_<?php print $subdir_loc; ?> {
return 418;
}
<?php endif; ?>
+ ###
+ ### For Drupal >= 7
+ ###
+ if ($sent_http_x_generator) {
+ add_header X-Info-Gen "Modern";
+ rewrite ^ /<?php print $subdir; ?>/index.php?$query_string last;
+ }
+ ###
+ ### For Drupal <= 6
+ ###
rewrite ^/<?php print $subdir; ?>/(.*)$ /<?php print $subdir; ?>/index.php?q=$1 last;
}
@@ -1163,11 +1173,11 @@ location @drupal_<?php print $subdir_loc; ?> {
###
location @nobots_<?php print $subdir_loc; ?> {
###
- ### Support for Accelerated Mobile Pages (AMP).
+ ### Support for Accelerated Mobile Pages (AMP) when bots are redirected below
###
- if ( $query_string ~ "^amp$" ) {
- rewrite ^/<?php print $subdir; ?>/(.*)$ /<?php print $subdir; ?>/index.php?q=$1 last;
- }
+ # if ( $query_string ~ "^amp$" ) {
+ # rewrite ^/<?php print $subdir; ?>/(.*)$ /<?php print $subdir; ?>/index.php?q=$1 last;
+ # }
###
### Send all known bots to $args free URLs (optional)
@@ -1183,6 +1193,17 @@ location @nobots_<?php print $subdir_loc; ?> {
if ( $args ~* "=PHP[A-Z0-9]{8}-" ) {
return 404;
}
+
+ ###
+ ### For Drupal >= 7
+ ###
+ if ($sent_http_x_generator) {
+ add_header X-Info-Gen "Modern";
+ rewrite ^ /<?php print $subdir; ?>/index.php?$query_string last;
+ }
+ ###
+ ### For Drupal <= 6
+ ###
rewrite ^/<?php print $subdir; ?>/(.*)$ /<?php print $subdir; ?>/index.php?q=$1 last;
}
diff --git a/http/Provision/Service/http/pack.php b/http/Provision/Service/http/pack.php
index 1b7daa5..ec816de 100644
--- a/http/Provision/Service/http/pack.php
+++ b/http/Provision/Service/http/pack.php
@@ -64,7 +64,7 @@ class Provision_Service_http_pack extends Provision_Service_http {
$this->_each_server($this->server->slave_web_servers, __FUNCTION__, array($config));
}
- function delete_config($configi, $data = array()) {
+ function delete_config($config, $data = array()) {
$this->_each_server($this->server->master_web_servers, __FUNCTION__, array($config));
$this->_each_server($this->server->slave_web_servers, __FUNCTION__, array($config));
diff --git a/http/Provision/Service/http/public.php b/http/Provision/Service/http/public.php
index d35a361..4d85fdf 100644
--- a/http/Provision/Service/http/public.php
+++ b/http/Provision/Service/http/public.php
@@ -57,10 +57,11 @@ class Provision_Service_http_public extends Provision_Service_http {
$this->server->http_vhostd_path = "{$app_dir}/vhost.d";
$this->server->http_subdird_path = "{$app_dir}/subdir.d";
$this->server->http_platforms_path = "{$this->server->aegir_root}/platforms";
+
+ $this->symlink_service();
}
}
-
static function option_documentation() {
return array(
'web_group' => 'server with http: OS group for permissions; working default will be attempted',
diff --git a/http/Provision/Service/http/ssl.php b/http/Provision/Service/http/ssl.php
index 581c04d..f30c5e8 100644
--- a/http/Provision/Service/http/ssl.php
+++ b/http/Provision/Service/http/ssl.php
@@ -192,6 +192,11 @@ class Provision_Service_http_ssl extends Provision_Service_http_public {
static function free_certificate_site($ssl_key, $site) {
if (empty($ssl_key)) return FALSE;
$ssl_dir = $site->platform->server->http_ssld_path . "/" . $ssl_key . "/";
+ // Respect hosting_le configuration, if detected -- start
+ $le_ctrl = d('@server_master')->aegir_root . "/tools/le/.ctrl";
+ $immutable = $le_ctrl . "/dont-overwrite-" . $site->uri . ".pid";
+ if (is_link($ssl_dir) || is_file($immutable)) return FALSE;
+ // Respect hosting_le configuration, if detected -- fin
// Remove the file system reciept we left for this file
if (provision_file()->unlink($ssl_dir . $site->uri . ".receipt")->
succeed(dt("Deleted SSL Certificate association receipt for %site on %server", array(
diff --git a/platform/drupal/packages_6.inc b/platform/drupal/packages_6.inc
index b48b7c3..49ee3d4 100644
--- a/platform/drupal/packages_6.inc
+++ b/platform/drupal/packages_6.inc
@@ -74,6 +74,11 @@ function _provision_drupal_parse_info_file($filename) {
}
$value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3;
+ // Remove any invalid UTF-8 sequences to prevent serialization errors.
+ if (function_exists('mb_convert_encoding')) {
+ $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
+ }
+
// Parse array syntax
$keys = preg_split('/\]?\[/', rtrim($key, ']'));
$last = array_pop($keys);
@@ -188,3 +193,80 @@ function _provision_drupal_system_map() {
drush_log(dt("Found !count themes", array('!count' => sizeof($packages['themes']))));
return $packages;
}
+
+/**
+ * Find available profiles on this platform.
+ */
+function _provision_find_profiles() {
+ $profiles = array();
+
+ include_once('includes/install.inc');
+ $profiles_subdirs[] = "./profiles";
+
+ foreach($profiles_subdirs as $profiles_subdir) {
+ if (!$dir = opendir($profiles_subdir)) {
+ drush_log(dt("Cannot find profiles directory"), 'error');
+ return FALSE;
+ }
+
+ while (FALSE !== ($name = readdir($dir))) {
+ $languages = array();
+ if (($name == '..') || ($name == '.') || (!is_dir("$profiles_subdir/$name"))) {
+ continue;
+ }
+
+ $profile = new stdClass();
+ $profile->name = $name;
+ $profile->info = array();
+
+ $info_file = "$profiles_subdir/$name/$name.info";
+ if (file_exists($info_file)) {
+ $profile->info = provision_parse_info_file($info_file);
+ // Skip hidden profiles
+ if (isset($profile->info['hidden']) && $profile->info['hidden'] == 1) {
+ continue;
+ }
+ }
+ $profile->filename = $info_file;
+
+ // Include code from the profile.
+ if (file_exists($profile_file = "$profiles_subdir/$name/$name.profile")) {
+ require_once($profile_file);
+ }
+
+ $func = $profile->name . "_profile_details";
+ if (function_exists($func)) {
+ $profile->info = array_merge($profile->info, $func());
+ }
+
+ $profile_path = $profiles_subdir . '/' . $name;
+ $profile->info['languages'] = _provision_find_profile_languages($profile_path);
+
+ $profiles[$name] = $profile;
+ drush_log(dt('Found install profile %name', array('%name' => $name)));
+ }
+ }
+ return $profiles;
+}
+
+/**
+ * Retrieve a list of paths to search in a certain scope
+ */
+function _provision_drupal_search_paths($scope, $key = '', $type = 'modules') {
+ $searchpaths = array();
+ $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
+ switch ($scope) {
+ case 'base' :
+ $searchpaths[] = sprintf("%s/%s", $drupal_root, $type);
+ $searchpaths[] = sprintf("%s/sites/all/%s", $drupal_root, $type);
+ break;
+ default :
+ if ($key) {
+ $searchpaths[] = sprintf("%s/%s/%s/%s", $drupal_root, $scope, $key, $type);
+ }
+ break;
+
+ }
+ return $searchpaths;
+}
+
diff --git a/platform/drupal/packages_7.inc b/platform/drupal/packages_7.inc
index 01cacbf..89517c4 100644
--- a/platform/drupal/packages_7.inc
+++ b/platform/drupal/packages_7.inc
@@ -39,7 +39,12 @@ function _provision_drupal_find_themes($scope, $key = '') {
$files[$name]->template = TRUE;
}
}
- $files[$name]->version = $files[$name]->info['version'];
+ if (!empty($files[$name]->info['version'])) {
+ $files[$name]->version = $files[$name]->info['version'];
+ }
+ else {
+ $files[$name]->version = NULL;
+ }
}
return $files;
}
@@ -77,6 +82,11 @@ function _provision_drupal_parse_info_file($filename) {
}
$value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3;
+ // Remove any invalid UTF-8 sequences to prevent serialization errors.
+ if (function_exists('mb_convert_encoding')) {
+ $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
+ }
+
// Parse array syntax
$keys = preg_split('/\]?\[/', rtrim($key, ']'));
$last = array_pop($keys);
@@ -194,3 +204,86 @@ function _provision_drupal_system_map() {
drush_log(dt("Found !count themes", array('!count' => sizeof($packages['themes']))));
return $packages;
}
+
+/**
+ * Find available profiles on this platform.
+ */
+function _provision_find_profiles() {
+ $profiles = array();
+
+ include_once('includes/install.inc');
+ $profiles_subdirs[] = "./profiles";
+
+ foreach($profiles_subdirs as $profiles_subdir) {
+ if (!$dir = opendir($profiles_subdir)) {
+ drush_log(dt("Cannot find profiles directory"), 'error');
+ return FALSE;
+ }
+
+ while (FALSE !== ($name = readdir($dir))) {
+ $languages = array();
+ if (($name == '..') || ($name == '.') || (!is_dir("$profiles_subdir/$name"))) {
+ continue;
+ }
+
+ $profile = new stdClass();
+ $profile->name = $name;
+ $profile->info = array();
+
+ $info_file = "$profiles_subdir/$name/$name.info";
+ if (file_exists($info_file)) {
+ $profile->info = provision_parse_info_file($info_file);
+ // Skip hidden profiles
+ if (isset($profile->info['hidden']) && $profile->info['hidden'] == 1) {
+ continue;
+ }
+ }
+ $profile->filename = $info_file;
+
+ // Include code from the profile.
+ if (file_exists($profile_file = "$profiles_subdir/$name/$name.profile")) {
+ require_once($profile_file);
+ }
+
+ $func = $profile->name . "_profile_details";
+ if (function_exists($func)) {
+ $profile->info = array_merge($profile->info, $func());
+ }
+
+ $profile_path = $profiles_subdir . '/' . $name;
+ $profile->info['languages'] = _provision_find_profile_languages($profile_path);
+
+ // Drupal 7 renamed the default install profile to 'standard'
+ // Aegir now allows projects to specify an "old short name" to provide an upgrade path when projects get renamed.
+ if ($profile->name == 'standard') {
+ $profile->info['old_short_name'] = 'default';
+ }
+
+ $profiles[$name] = $profile;
+ drush_log(dt('Found install profile %name', array('%name' => $name)));
+ }
+ }
+ return $profiles;
+}
+
+/**
+ * Retrieve a list of paths to search in a certain scope
+ */
+function _provision_drupal_search_paths($scope, $key = '', $type = 'modules') {
+ $searchpaths = array();
+ $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
+ switch ($scope) {
+ case 'base' :
+ $searchpaths[] = sprintf("%s/%s", $drupal_root, $type);
+ $searchpaths[] = sprintf("%s/sites/all/%s", $drupal_root, $type);
+ break;
+ default :
+ if ($key) {
+ $searchpaths[] = sprintf("%s/%s/%s/%s", $drupal_root, $scope, $key, $type);
+ }
+ break;
+
+ }
+ return $searchpaths;
+}
+
diff --git a/platform/drupal/packages_8.inc b/platform/drupal/packages_8.inc
index 272c3a6..edf7969 100644
--- a/platform/drupal/packages_8.inc
+++ b/platform/drupal/packages_8.inc
@@ -91,17 +91,26 @@ function _provision_drupal_system_map() {
*/
function _provision_system_query($type) {
$packages = array();
- foreach (system_get_info($type) as $name => $package) {
- $package = (object) $package;
+
+ if ($type == 'theme') {
+ /** @var \Drupal\Core\Extension\Extension[] $extensions_data */
+ $extensions_data = \Drupal::service('theme_handler')->rebuildThemeData();
+ }
+ // Modules.
+ else {
+ /** @var \Drupal\Core\Extension\Extension[] $extensions_data */
+ $extensions_data = system_rebuild_module_data();
+ }
+
+ foreach ($extensions_data as $name => $extension_data) {
+ $package = (object) $extension_data->info;
$package->filename = drupal_get_filename($type, $name);
$frags = explode("/", $package->filename);
// Flag site-specific packages.
if ($frags[0] == 'sites' && $frags[1] != 'all') {
$package->platform = -1;
}
- // In Drupal 8, system_get_info returns enabled modules/themes.
- $package->status = 1;
-
+ $package->status = $extension_data->status;
$package->filename = realpath($package->filename);
if ($type == 'module') {
@@ -113,3 +122,64 @@ function _provision_system_query($type) {
return $packages;
}
+
+/**
+ * Find available profiles on this platform.
+ */
+function _provision_find_profiles() {
+ $profile_dirs = array('./core/profiles', './profiles');
+
+ $profiles = array();
+ foreach($profile_dirs as $profile_dir) {
+ if (!is_dir($profile_dir)) {
+ drush_log(dt("Cannot find profiles directory %dir", array('%dir' => $profile_dir)), 'error');
+ return FALSE;
+ }
+
+ $info_files = drush_scan_directory($profile_dir, "/\.info.yml$/");
+ foreach ($info_files as $path => $info_file) {
+ $path = realpath($path);
+ $info = Symfony\Component\Yaml\Yaml::parse($path);
+ if ($info['type'] == 'profile' && (!isset($info['hidden']) || !$info['hidden'])) {
+ $profile = new stdClass();
+ $profile->name = $info['name'];
+ $profile->info = $info;
+ $profile->filename = $path;
+ $profile->path = dirname($path);
+ $profile->info['languages'] = _provision_find_profile_languages($profile->path);
+
+ $profiles[basename($profile->path)] = $profile;
+ drush_log(dt('Found install profile %name', array('%name' => $name)));
+ }
+ }
+ }
+ return $profiles;
+}
+
+/**
+ * Retrieve a list of paths to search in a certain scope
+ */
+function _provision_drupal_search_paths($scope, $key = '', $type = 'modules') {
+ $searchpaths = array();
+ $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
+ switch ($scope) {
+ case 'base':
+ $searchpaths[] = sprintf("%s/%s", $drupal_root, $type);
+ $searchpaths[] = sprintf("%s/core/%s", $drupal_root, $type);
+ $searchpaths[] = sprintf("%s/sites/all/%s", $drupal_root, $type);
+ break;
+ case 'profiles':
+ foreach (_provision_find_profiles() as $profile) {
+ $searchpaths[] = $profile->path;
+ }
+ break;
+ default:
+ if ($key) {
+ $searchpaths[] = sprintf("%s/%s/%s/%s", $drupal_root, $scope, $key, $type);
+ }
+ break;
+
+ }
+ return $searchpaths;
+}
+
diff --git a/platform/install.provision.inc b/platform/install.provision.inc
index afc6456..47913f5 100644
--- a/platform/install.provision.inc
+++ b/platform/install.provision.inc
@@ -19,7 +19,35 @@ function drush_provision_drupal_provision_install_validate() {
return drush_set_error("PROVISION_URL_REQUIRED", dt("You need to specify a valid url to install a site"));
}
if (_provision_drupal_site_exists()) {
- return drush_set_error('PROVISION_SITE_INSTALLED');
+
+ // If "force-reinstall" option is set, delete the database and files.
+ if (drush_get_option('force-reinstall', FALSE)) {
+
+ drush_log(dt('Forcing reinstall...'), 'ok');
+
+ // Load the current database name from drushrc.php.
+ // I cannot find another way to find the current db_name!
+ require_once(d()->site_path . '/drushrc.php');
+ $old_db_name = $options['db_name'];
+
+ if (d()->service('db')->database_exists($old_db_name)) {
+ d()->service('db')->drop_database($old_db_name);
+ drush_log(dt('Dropped database @database.', array(
+ '@database' => $old_db_name,
+ )), 'ok');
+ }
+
+ // Destroy site_path.
+ if (file_exists(d()->site_path)) {
+ _provision_recursive_delete( d()->site_path );
+ drush_log(dt('Deleted @site_path.', array('@site_path' => d()->site_path)), 'ok');
+ }
+ }
+
+ // Check again if site does not exist after the forced reinstall.
+ if (_provision_drupal_site_exists()) {
+ return drush_set_error('PROVISION_SITE_INSTALLED');
+ }
}
}
diff --git a/platform/provision_drupal.drush.inc b/platform/provision_drupal.drush.inc
index 129c459..233d60f 100644
--- a/platform/provision_drupal.drush.inc
+++ b/platform/provision_drupal.drush.inc
@@ -63,8 +63,11 @@ function provision_drupal_drush_exit() {
}
}
elseif (d()->type === 'platform') {
- // Don't generate the drushrc.php on provision-save/delete commands.
- if (!preg_match("/^provision-(save|delete)/", $command[0])) {
+ // Don't generate the drushrc.php on provision-save/delete/git-clone commands.
+ // Avoiding running on git-clone is needed in order to let it work with makefiles in the git repo.
+ // If this function runs, the platform directory is created, and drush make fails because the directory already exists.
+ // @TODO: Determine what tasks should save platform data and only act on those.
+ if (!preg_match("/^provision-(save|delete|git-clone)/", $command[0])) {
provision_save_platform_data();
}
}
@@ -369,105 +372,6 @@ function _provision_drupal_rebuild_caches() {
}
}
-/**
- * Find available profiles on this platform.
- */
-function _provision_find_profiles() {
- $profiles = array();
-
- if (drush_drupal_major_version() >= 8) {
- include_once('core/includes/install.inc');
- $profiles_subdirs[] = "./core/profiles";
- $profiles_subdirs[] = "./profiles";
- }
- else {
- include_once('includes/install.inc');
- $profiles_subdirs[] = "./profiles";
- }
-
- foreach($profiles_subdirs as $profiles_subdir) {
- if (!$dir = opendir($profiles_subdir)) {
- drush_log(dt("Cannot find profiles directory"), 'error');
- return FALSE;
- }
-
- while (FALSE !== ($name = readdir($dir))) {
- $languages = array();
- if (($name == '..') || ($name == '.') || (!is_dir("$profiles_subdir/$name"))) {
- continue;
- }
-
- $profile = new stdClass();
- $profile->name = $name;
- $profile->info = array();
-
- if (drush_drupal_major_version() >= 8) {
- $yaml_file = "$profiles_subdir/$name/$name.info.yml";
- if(!file_exists($yaml_file)) {
- drush_log(dt("@name.info.yml not found.", array("@name" => $name)), 'notice');
- unset($files[$name]);
- continue;
- }
- $profile->info = Symfony\Component\Yaml\Yaml::parse($yaml_file);
-
- // Skip hidden profiles.
- if (isset($profile->info['hidden']) && $profile->info['hidden'] == 1) {
- continue;
- }
-
- if (!empty($profile->info['name'])) {
- $profile->name = $profile->info['name'];
- }
- $profile->filename = $yaml_file;
- }
- else {
- $info_file = "$profiles_subdir/$name/$name.info";
- if (file_exists($info_file)) {
- $profile->info = provision_parse_info_file($info_file);
- // Skip hidden profiles
- if (isset($profile->info['hidden']) && $profile->info['hidden'] == 1) {
- continue;
- }
- }
- $profile->filename = $info_file;
- }
-
- // Include code from the profile.
- if (file_exists($profile_file = "$profiles_subdir/$name/$name.profile")) {
- require_once($profile_file);
- }
-
- $func = $profile->name . "_profile_details";
- if (function_exists($func)) {
- $profile->info = array_merge($profile->info, $func());
- }
-
- $languages['en'] = 1;
- // Find languages available
- $files = array_keys(drush_scan_directory($profiles_subdir . '/' . $name . '/translations', '/\.po$/', array('.', '..', 'CVS'), 0, FALSE, 'filepath'));
- $files = array_merge($files, array_keys(drush_scan_directory($profiles_subdir . '/' . $name , '/\.po$/', array('.', '..', 'CVS'), 0, FALSE, 'filepath')));
- if (is_array($files)) {
- foreach ($files as $file) {
- if (preg_match('!(/|\.)([^\./]+)\.po$!', $file, $langcode)) {
- $languages[$langcode[2]] = 1; // use the language name as an index to weed out duplicates
- }
- }
- }
- $profile->info['languages'] = array_keys($languages);
-
- // Drupal 7 renamed the default install profile to 'standard'
- // Aegir now allows projects to specify an "old short name" to provide an upgrade path when projects get renamed.
- if ($profile->name == 'standard') {
- $profile->info['old_short_name'] = 'default';
- }
-
- $profiles[$name] = $profile;
- drush_log(dt('Found install profile %name', array('%name' => $name)));
- }
- }
- return $profiles;
-}
-
function provision_drupal_find_sites() {
$sites = array();
if ($dir = opendir("./sites")) {
@@ -638,28 +542,6 @@ function provision_drupal_system_map() {
}
/**
- * Retrieve a list of paths to search in a certain scope
- */
-function _provision_drupal_search_paths($scope, $key = '', $type = 'modules') {
- $searchpaths = array();
- $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
- switch ($scope) {
- case 'base' :
- $searchpaths[] = sprintf("%s/%s", $drupal_root, $type);
- $searchpaths[] = sprintf("%s/core/%s", $drupal_root, $type);
- $searchpaths[] = sprintf("%s/sites/all/%s", $drupal_root, $type);
- break;
- default :
- if ($key) {
- $searchpaths[] = sprintf("%s/%s/%s/%s", $drupal_root, $scope, $key, $type);
- }
- break;
-
- }
- return $searchpaths;
-}
-
-/**
* Find modules in a certain scope.
*
* This function is general enough that it works for all supported
@@ -844,3 +726,25 @@ function _provision_client_delete_symlink() {
->fail('Failed to delete symlink @path: @reason');
}
}
+
+/**
+ * Find available languages for a profile.
+ */
+function _provision_find_profile_languages($profile_path) {
+ $languages = array();
+
+ // English is default.
+ $languages['en'] = 1;
+
+ // Find languages available.
+ $files = array_keys(drush_scan_directory($profile_path . '/translations', '/\.po$/', array('.', '..', 'CVS'), 0, FALSE, 'filepath'));
+ $files = array_merge($files, array_keys(drush_scan_directory($profile_path, '/\.po$/', array('.', '..', 'CVS'), 0, FALSE, 'filepath')));
+ if (is_array($files)) {
+ foreach ($files as $file) {
+ if (preg_match('!(/|\.)([^\./]+)\.po$!', $file, $langcode)) {
+ $languages[$langcode[2]] = 1; // use the language name as an index to weed out duplicates
+ }
+ }
+ }
+ return array_keys($languages);
+}
diff --git a/provision.api.php b/provision.api.php
index 3f491ff..50fd9e2 100644
--- a/provision.api.php
+++ b/provision.api.php
@@ -14,8 +14,15 @@
* $options['provision_backup_suffix'] = '.tar.bz2';
*
* provision_verify_platforms_before_migrate - When migrating many sites turning this off can save time, default TRUE.
+ *
* provision_backup_suffix - Method to set the compression used for backups... e.g. '.tar.bz2' or '.tar.', defaults to '.tar.gz'.
*
+ * provision_apache_conf_suffix
+ * Set to TRUE to generate apache vhost files with a .conf suffix, default FALSE.
+ * This takes advantage of the IncludeOptional statment introduced in Apache 2.3.6.
+ * WARNING: After turning this on you need to re-verify all your sites, then then servers,
+ * and then cleanup the old configfiles (those without the .conf suffix).
+ *
*/
/**
@@ -216,6 +223,31 @@ function hook_provision_config_load_templates_alter(&$templates, $config) {
}
/**
+ * Alter the variables used for rendering a config file.
+ *
+ * When implementing this hook, the function name should start with your file's name, not "drush_".
+ *
+ * @param $variables
+ * The variables that are about to be injected into the template.
+ * @param $template
+ * The template file chosen for use.
+ * @param $config
+ * The Provision_config object trying to find its template.
+ *
+ * @see hook_provision_config_load_templates()
+ * @see hook_provision_config_load_templates_alter()
+ */
+function hook_provision_config_variables_alter(&$variables, $template, $config) {
+
+ // If this is the vhost template and the http service is Docker...
+ if (is_a($config, 'Provision_Config_Apache_Site') && is_a(d()->platform->service('http'), 'Provision_Service_http_apache_docker')) {
+
+ // Force the listen port to be 80.
+ $variables['http_port'] = '80';
+ }
+}
+
+/**
* Alter the array of directories to create.
*
* @param $mkdir
diff --git a/provision.drush.inc b/provision.drush.inc
index 8331e41..f417a8e 100644
--- a/provision.drush.inc
+++ b/provision.drush.inc
@@ -113,6 +113,7 @@ function provision_drush_command() {
'options' => array(
'client_email' => dt('The email address of the client to use.'),
'profile' => dt('The profile to use when installing the site.'),
+ 'force-reinstall' => dt('Delete the sites database and files, before attempting to install.'),
),
'allow-additional-options' => TRUE,
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
diff --git a/scripts/ci-aegir-dev-install-apt-debian8.sh b/scripts/ci-aegir-dev-install-apt-debian8.sh
new file mode 100755
index 0000000..b07e861
--- /dev/null
+++ b/scripts/ci-aegir-dev-install-apt-debian8.sh
@@ -0,0 +1,35 @@
+#
+# Install Aegir debian packages located in the 'build/' directory.
+# These are provided by the GitLab CI build stage.
+#
+# This script is tuned for Debian 8 - Jessie.
+#
+
+sudo apt-get update
+echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
+#echo "debconf debconf/priority select critical" | debconf-set-selections
+
+
+echo mysql-server-5.5 mysql-server/root_password password PASSWORD | debconf-set-selections
+echo mysql-server-5.5 mysql-server/root_password_again password PASSWORD | debconf-set-selections
+
+debconf-set-selections <<EOF
+aegir3-hostmaster aegir/db_password string PASSWORD
+aegir3-hostmaster aegir/db_password seen true
+aegir3-hostmaster aegir/db_user string root
+aegir3-hostmaster aegir/db_host string localhost
+aegir3-hostmaster aegir/email string aegir@example.com
+aegir3-hostmaster aegir/site string aegir.example.com
+postfix postfix/main_mailer_type select Local only
+
+EOF
+
+sudo apt-get install --yes mysql-server php5-mysql php5-cli php5 postfix
+
+set -x
+
+sudo DPKG_DEBUG=developer dpkg --install build/aegir3_*.deb build/aegir3-provision*.deb build/aegir3-hostmaster*.deb
+sudo apt-get install --fix-broken --yes
+
+
+
diff --git a/scripts/ci-aegir-dev-install-apt-debian9.sh b/scripts/ci-aegir-dev-install-apt-debian9.sh
new file mode 100755
index 0000000..86dadd2
--- /dev/null
+++ b/scripts/ci-aegir-dev-install-apt-debian9.sh
@@ -0,0 +1,35 @@
+#
+# Install Aegir debian packages located in the 'build/' directory.
+# These are provided by the GitLab CI build stage.
+#
+# This script is tuned for Debian 9 - Stretch.
+#
+
+sudo apt-get update
+echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
+#echo "debconf debconf/priority select critical" | debconf-set-selections
+
+
+echo mysql-server-5.7 mysql-server/root_password password PASSWORD | debconf-set-selections
+echo mysql-server-5.7 mysql-server/root_password_again password PASSWORD | debconf-set-selections
+
+debconf-set-selections <<EOF
+aegir3-hostmaster aegir/db_password string PASSWORD
+aegir3-hostmaster aegir/db_password seen true
+aegir3-hostmaster aegir/db_user string root
+aegir3-hostmaster aegir/db_host string localhost
+aegir3-hostmaster aegir/email string aegir@example.com
+aegir3-hostmaster aegir/site string aegir.example.com
+postfix postfix/main_mailer_type select Local only
+
+EOF
+
+sudo apt-get install --yes mysql-server phpi7.0-mysql php7.0-cli
+
+set -x
+
+sudo DPKG_DEBUG=developer dpkg --install build/aegir3_*.deb build/aegir3-provision*.deb build/aegir3-hostmaster*.deb
+sudo apt-get install --fix-broken --yes
+
+
+
diff --git a/scripts/ci-aegir-dev-install-apt-ubuntu.sh b/scripts/ci-aegir-dev-install-apt-ubuntu.sh
new file mode 100755
index 0000000..a09543b
--- /dev/null
+++ b/scripts/ci-aegir-dev-install-apt-ubuntu.sh
@@ -0,0 +1,30 @@
+#
+# Install Aegir debian packages located in the 'build/' directory.
+# These are provided by the GitLab CI build stage.
+#
+# This script is tuned for Ubuntu 16.04.
+#
+sudo apt-get update
+echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
+#echo "debconf debconf/priority select critical" | debconf-set-selections
+
+
+echo mysql-server-5.7 mysql-server/root_password password PASSWORD | debconf-set-selections
+echo mysql-server-5.7 mysql-server/root_password_again password PASSWORD | debconf-set-selections
+
+debconf-set-selections <<EOF
+aegir3-hostmaster aegir/db_password string PASSWORD
+aegir3-hostmaster aegir/db_password seen true
+aegir3-hostmaster aegir/db_user string root
+aegir3-hostmaster aegir/db_host string localhost
+aegir3-hostmaster aegir/email string aegir@example.com
+aegir3-hostmaster aegir/site string aegir.example.com
+postfix postfix/main_mailer_type select Local only
+
+EOF
+
+sudo apt-get install --yes mysql-server php7.0-mysql php7.0-cli php7.0 postfix
+
+sudo DPKG_DEBUG=developer dpkg --install build/aegir3_*.deb build/aegir3-provision*.deb build/aegir3-hostmaster*.deb
+sudo apt-get install --fix-broken --yes
+
diff --git a/scripts/ci-aegir-install-apt-debian.sh b/scripts/ci-aegir-install-apt-debian.sh
new file mode 100755
index 0000000..2052ef4
--- /dev/null
+++ b/scripts/ci-aegir-install-apt-debian.sh
@@ -0,0 +1,30 @@
+#
+# Install Aegir debian packages located in the projects unstable repository.
+#
+# This script is tuned for Debian 8 - Jessie.
+#
+
+echo "deb http://debian.aegirproject.org unstable main" | sudo tee -a /etc/apt/sources.list.d/aegir-unstable.list
+curl http://debian.aegirproject.org/key.asc | sudo apt-key add -
+sudo apt-get update
+echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
+#echo "debconf debconf/priority select critical" | debconf-set-selections
+
+
+echo mysql-server-5.5 mysql-server/root_password password PASSWORD | debconf-set-selections
+echo mysql-server-5.5 mysql-server/root_password_again password PASSWORD | debconf-set-selections
+
+debconf-set-selections <<EOF
+aegir3-hostmaster aegir/db_password string PASSWORD
+aegir3-hostmaster aegir/db_password seen true
+aegir3-hostmaster aegir/db_user string root
+aegir3-hostmaster aegir/db_host string localhost
+aegir3-hostmaster aegir/email string aegir@example.com
+aegir3-hostmaster aegir/site string aegir.example.com
+postfix postfix/main_mailer_type select Local only
+
+EOF
+
+sudo DPKG_DEBUG=developer apt-get install --yes aegir3 mysql-server
+
+
diff --git a/scripts/ci-aegir-install-apt-ubuntu.sh b/scripts/ci-aegir-install-apt-ubuntu.sh
new file mode 100755
index 0000000..5d37706
--- /dev/null
+++ b/scripts/ci-aegir-install-apt-ubuntu.sh
@@ -0,0 +1,32 @@
+#
+# Install Aegir debian packages located in the projects unstable repository.
+#
+# This script is tuned for Ubuntu 16.04.
+#
+
+echo "deb http://debian.aegirproject.org unstable main" | sudo tee -a /etc/apt/sources.list.d/aegir-unstable.list
+curl http://debian.aegirproject.org/key.asc | sudo apt-key add -
+sudo apt-get update
+echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
+#echo "debconf debconf/priority select critical" | debconf-set-selections
+
+
+echo mysql-server-5.7 mysql-server/root_password password PASSWORD | debconf-set-selections
+echo mysql-server-5.7 mysql-server/root_password_again password PASSWORD | debconf-set-selections
+
+debconf-set-selections <<EOF
+aegir3-hostmaster aegir/db_password string PASSWORD
+aegir3-hostmaster aegir/db_password seen true
+aegir3-hostmaster aegir/db_user string root
+aegir3-hostmaster aegir/db_host string localhost
+aegir3-hostmaster aegir/email string aegir@example.com
+aegir3-hostmaster aegir/site string aegir.example.com
+postfix postfix/main_mailer_type select Local only
+
+EOF
+
+sudo apt-get install --yes mysql-server
+
+sudo DPKG_DEBUG=developer apt-get install --yes aegir3
+
+
diff --git a/scripts/ci-aegir-stable-install-apt-debian.sh b/scripts/ci-aegir-stable-install-apt-debian.sh
new file mode 100755
index 0000000..d33846b
--- /dev/null
+++ b/scripts/ci-aegir-stable-install-apt-debian.sh
@@ -0,0 +1,28 @@
+#
+# Install Aegir debian packages located in the projects stable repository.
+#
+# This script is tuned for Debian 8 - Jessie.
+#
+
+echo "deb http://debian.aegirproject.org stable main" | sudo tee -a /etc/apt/sources.list.d/aegir-stable.list
+curl http://debian.aegirproject.org/key.asc | sudo apt-key add -
+sudo apt-get update
+echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
+
+echo mysql-server-5.5 mysql-server/root_password password PASSWORD | debconf-set-selections
+echo mysql-server-5.5 mysql-server/root_password_again password PASSWORD | debconf-set-selections
+
+debconf-set-selections <<EOF
+aegir3-hostmaster aegir/db_password string PASSWORD
+aegir3-hostmaster aegir/db_password seen true
+aegir3-hostmaster aegir/db_user string root
+aegir3-hostmaster aegir/db_host string localhost
+aegir3-hostmaster aegir/email string aegir@example.com
+aegir3-hostmaster aegir/site string aegir.example.com
+postfix postfix/main_mailer_type select Local only
+
+EOF
+
+sudo DPKG_DEBUG=developer apt-get install --yes aegir3 mysql-server
+
+
diff --git a/release.sh b/scripts/release.sh
index 58e53f6..43b3baf 100755
--- a/release.sh
+++ b/scripts/release.sh
@@ -52,6 +52,7 @@ The following operations will be done:
0. prompt you for a debian/changelog entry
1. change the makefile to download tarball
2. change the upgrade.sh.txt version
+ . change the .gitlab-ci.yml to build a release package
3. display the resulting diff
4. commit those changes to git
5. lay down the tag
@@ -61,8 +62,6 @@ The following operations will be done:
9. clone fresh copies of golden contrib to lay down the tag
10. (optionally) push those changes
- ARE YOU SURE you disabled the D_aegir-debian-build-3x job in Jenkins?
-
The operation can be aborted before step 8. Don't forget that as
long as changes are not pushed upstream, this can all be reverted (see
git-reset(1) and git-revert(1) ).
@@ -80,7 +79,7 @@ dch -v $debversion -D unstable
git add debian/changelog
echo changing hostmaster version in aegir-release.make
-sed -i'.tmp' -e '/^projects\[hostmaster\]\[version\]/s/=.*$/= "'"$version"'"/' aegir-release.make && git add aegir-release.make && rm aegir-release.make.tmp
+sed -i'.tmp' -e "s/7.x-3.0-dev/$major-$version/" aegir-release.make && git add aegir-release.make && rm aegir-release.make.tmp
echo enabling release makefilexs
ln -sf aegir-release.make aegir.make && git add aegir.make
@@ -92,6 +91,10 @@ git add provision.info && rm provision.info.tmp
echo changing upgrade.sh.txt version
sed -i'.tmp' -e"s/AEGIR_VERSION=.*$/AEGIR_VERSION=\"$major-$version\"/" upgrade.sh.txt && git add upgrade.sh.txt && rm upgrade.sh.txt.tmp
+echo Skip adding a build ID for dev packages, released do not need that.
+sed -i -e"s/ - export new_version=.*$//" .gitlab-ci.yml && git add .gitlab-ci.yml
+sed -i -e"s/ - dch -D unstable --newversion.*$//" .gitlab-ci.yml && git add .gitlab-ci.yml
+
echo resulting changes to be committed:
git diff --cached | cat
@@ -108,7 +111,7 @@ NEW_TAG="$major-$version"
commitmsg=`git commit -m"change version information for release $version"`
echo $commitmsg
commitid=`echo $commitmsg | sed 's/^\[[^ ]* \([a-z0-9]*\)\].*$/\1/'`
-sed -n '1,/ --/p' debian/changelog | git tag -a -F - $major-$version
+sed -n '1,/ --/p' debian/changelog | git tag -a -F - $NEW_TAG
echo reverting tree to HEAD versions
git revert --no-commit $commitid
@@ -157,8 +160,13 @@ echo =========
echo
# Can we push?
if prompt_yes_no "Push tags and commits upstream? "; then
- # this makes sure we push the commit *and* the tag
- git push --tags origin HEAD
+
+ # this makes sure we push the commit *and* the tag, and leave the revert commit for the moment.
+ git push --tags origin $commitid:$CURRENT_BRANCH
+
+ # Also push provision to GitLab to kick off CI.
+ git push --tags gitlab $commitid:$CURRENT_BRANCH
+
git --work-tree=build-area/hostmaster --git-dir=build-area/hostmaster/.git push --tags origin HEAD
git --work-tree=build-area/hosting --git-dir=build-area/hosting/.git push --tags origin HEAD
git --work-tree=build-area/eldir --git-dir=build-area/eldir/.git push --tags origin HEAD
@@ -187,3 +195,7 @@ if prompt_yes_no "Push tags and commits for GOLDEN CONTRIB upstream? "; then
git --work-tree=build-area/$shortname --git-dir=build-area/$shortname/.git push --tags origin HEAD
done
fi
+
+if prompt_yes_no "Is GitLab finished building the release packages? Then we can push the revert commit. "; then
+ git push origin
+fi