Skip to content

Commit

Permalink
Merge pull request kalabox#35 from kalabox/issue543
Browse files Browse the repository at this point in the history
Issue543
  • Loading branch information
pirog committed Oct 15, 2015
2 parents c01772f + b76c57b commit 2b51dc9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 13 deletions.
9 changes: 7 additions & 2 deletions app/dockerfiles/terminus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ FROM kalabox/pantheon-appserver:v0.10.0
# Install all the CLI magic
RUN \
apt-get -y update && \
apt-get install -y mysql-client postgresql-client-common sqlite php5-curl && \
apt-get install -y mysql-client php5-mysql php5-json postgresql-client-common sqlite php5-curl && \
apt-get install -y kdiff3-qt && \
curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer && \
ln -s /usr/local/bin/composer /usr/bin/composer && \
git clone --depth 1 --branch 5.11.0 https://github.com/drush-ops/drush.git /usr/local/src/drush5 && \
git clone --depth 1 --branch 6.6.0 https://github.com/drush-ops/drush.git /usr/local/src/drush6 && \
git clone --depth 1 --branch 8.0.0-rc1 https://github.com/drush-ops/drush.git /usr/local/src/drush8 && \
ln -s /usr/local/src/drush5/drush /usr/bin/drush5 && \
ln -s /usr/local/src/drush6/drush /usr/bin/drush6 && \
ln -s /usr/local/src/drush8/drush /usr/bin/drush8 && \
cd /usr/local/src/drush8 && composer install --no-dev && \
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && mv wp-cli.phar /usr/local/bin/wp && \
curl https://github.com/pantheon-systems/cli/releases/download/0.8.1/terminus.phar -L -o /usr/local/bin/terminus && \
Expand Down Expand Up @@ -44,6 +48,7 @@ RUN \
# Install some extra goodies
RUN \
cd /usr/share/drush/commands && \
curl -L "http://ftp.drupal.org/files/projects/registry_rebuild-7.x-2.2.tar.gz" | tar -zvx
curl -L "http://ftp.drupal.org/files/projects/registry_rebuild-7.x-2.2.tar.gz" | tar -zvx && \
curl -O "https://raw.githubusercontent.com/drush-ops/config-extra/1.0.0/config_extra.drush.inc"

ENTRYPOINT ["/usr/local/bin/kterminus"]
5 changes: 4 additions & 1 deletion app/dockerfiles/terminus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ FROM kalabox/pantheon-appserver:v0.10.0
# Install all the CLI magic
RUN \
apt-get -y update && \
apt-get install -y mysql-client postgresql-client-common sqlite php5-curl && \
apt-get install -y mysql-client php5-mysql php5-json postgresql-client-common sqlite php5-curl && \
curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer && \
ln -s /usr/local/bin/composer /usr/bin/composer && \
git clone --depth 1 --branch 5.11.0 https://github.com/drush-ops/drush.git /usr/local/src/drush5 && \
git clone --depth 1 --branch 6.6.0 https://github.com/drush-ops/drush.git /usr/local/src/drush6 && \
git clone --depth 1 --branch 8.0.0-rc1 https://github.com/drush-ops/drush.git /usr/local/src/drush8 && \
ln -s /usr/local/src/drush5/drush /usr/bin/drush5 && \
ln -s /usr/local/src/drush6/drush /usr/bin/drush6 && \
ln -s /usr/local/src/drush8/drush /usr/bin/drush8 && \
cd /usr/local/src/drush8 && composer install --no-dev && \
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && mv wp-cli.phar /usr/local/bin/wp && \
curl https://github.com/pantheon-systems/cli/releases/download/0.8.1/terminus.phar -L -o /usr/local/bin/terminus && \
Expand Down
10 changes: 10 additions & 0 deletions app/dockerfiles/terminus/kdrush
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ fi
source /root/.phpbrew/bashrc > /dev/null
phpbrew -d switch ${PHP_VERSION} > /dev/null

# Drush 8 needs us to set the php bin and php ini eplicitly
# todo: other drush versions may require this as well?
if [ "$DRUSH_VERSION" == "drush8" ]; then
# for some reason DRUSH_PHP is not working here so we are doing this instead
rm /usr/bin/php
ln -s ${PHPBREW_PATH}/php /usr/bin/php
# Export the php config
export PHP_INI="${HOME}/.phpbrew/php/php-${PHP_VERSION}/etc/php.ini"
fi

$DRUSH_VERSION "$@"
7 changes: 6 additions & 1 deletion app/plugins/kalabox-plugin-pantheon/lib/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ module.exports = function(kbox) {
var opts = drush.getOpts(this.options);
var cmd = this.payload;
cmd.unshift('@dev');
cmd.push('--strict=0');
if (opts['drush-version'] === '6') {
cmd.push('--strict=0');
}
if (opts['drush-version'] === '8') {
cmd.push('--alias-path=/src/config/drush');
}
drush.cmd(cmd, opts, done);
};
});
Expand Down
17 changes: 8 additions & 9 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,13 @@ module.exports = function(kbox, pantheon) {
// Auth if we need to
.then(function(needsAuth) {

if (pantheonConfig && needsAuth) {
// Login to the pantheon
return pantheon.auth(pantheonConfig.account, options.password)

// Login to the pantheon
return pantheon.auth(pantheonConfig.account, options.password)

// Return sites to be used
.then(function() {
return pantheon.getSites();
});
}
// Return sites to be used
.then(function() {
return pantheon.getSites();
});
})

// Update our config with relevant info
Expand All @@ -74,6 +71,8 @@ module.exports = function(kbox, pantheon) {
pantheonConfig.framework = pantheonConfig.framework || site.framework;
pantheonConfig.php = getPhpVersion(site);
pantheonConfig.upstream = site.upstream;
var drushversion = pantheonConfig.framework === 'drupal8' ? '8' : '6';
pantheonConfig['drush-version'] = drushversion;

// Rebuild json
kalaboxJson.pluginConf['kalabox-plugin-pantheon'] = pantheonConfig;
Expand Down

0 comments on commit 2b51dc9

Please sign in to comment.