Skip to content

Commit

Permalink
Merge pull request #52 from pantheon-systems/terminus1
Browse files Browse the repository at this point in the history
Terminus  1.0
  • Loading branch information
stevector authored Jan 25, 2017
2 parents d248729 + 473b902 commit a8d2f4d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions bin/behat-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Delete the Pantheon site environment after the Behat test suite has run.
###

terminus auth whoami > /dev/null
terminus auth:whoami > /dev/null
if [ $? -ne 0 ]; then
echo "Terminus unauthenticated; assuming unauthenticated build"
exit 0
Expand All @@ -20,4 +20,4 @@ fi
###
# Delete the environment used for this test run.
###
yes | terminus site delete-env --remove-branch
terminus multidev:delete $SITE_ENV --delete-branch --yes
16 changes: 8 additions & 8 deletions bin/behat-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# such that it can be run a second time if a step fails.
###

terminus auth whoami > /dev/null
terminus auth:whoami > /dev/null
if [ $? -ne 0 ]; then
echo "Terminus unauthenticated; assuming unauthenticated build"
exit 0
Expand All @@ -22,13 +22,13 @@ fi
###
# Create a new environment for this particular test run.
###
terminus site create-env --to-env=$TERMINUS_ENV --from-env=dev
yes | terminus site wipe
terminus env:create $TERMINUS_SITE.dev $TERMINUS_ENV
terminus env:wipe $SITE_ENV --yes

###
# Get all necessary environment details.
###
PANTHEON_GIT_URL=$(terminus site connection-info --field=git_url)
PANTHEON_GIT_URL=$(terminus connection:info $SITE_ENV --field=git_url)
PANTHEON_SITE_URL="$TERMINUS_ENV-$TERMINUS_SITE.pantheonsite.io"
PREPARE_DIR="/tmp/$TERMINUS_ENV-$TERMINUS_SITE"
BASH_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand All @@ -37,7 +37,7 @@ SIMPLESAMLPHP_VERSION='1.14.8'
###
# Switch to git mode for pushing the files up
###
terminus site set-connection-mode --mode=git
terminus connection:set $SITE_ENV git
rm -rf $PREPARE_DIR
git clone -b $TERMINUS_ENV $PANTHEON_GIT_URL $PREPARE_DIR

Expand Down Expand Up @@ -128,7 +128,7 @@ sleep 10
###
# Silence output so as not to show the password.
{
terminus wp "core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME --admin_email=$WORDPRESS_ADMIN_EMAIL --admin_password=$WORDPRESS_ADMIN_PASSWORD"
terminus wp $SITE_ENV -- core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME --admin_email=$WORDPRESS_ADMIN_EMAIL --admin_password=$WORDPRESS_ADMIN_PASSWORD
} &> /dev/null
terminus wp "plugin activate wp-native-php-sessions wp-saml-auth"
terminus wp "theme activate $TERMINUS_SITE"
terminus wp $SITE_ENV -- plugin activate wp-native-php-sessions wp-saml-auth
terminus wp $SITE_ENV -- theme activate $TERMINUS_SITE
2 changes: 1 addition & 1 deletion bin/behat-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Execute the Behat test suite against a prepared Pantheon site environment.
###

terminus auth whoami > /dev/null
terminus auth:whoami > /dev/null
if [ $? -ne 0 ]; then
echo "Terminus unauthenticated; assuming unauthenticated build"
exit 0
Expand Down
7 changes: 5 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ machine:
environment:
TERMINUS_ENV: ci-$CIRCLE_BUILD_NUM
TERMINUS_SITE: wp-saml-auth
SITE_ENV: $TERMINUS_SITE.$TERMINUS_ENV
WORDPRESS_ADMIN_USERNAME: pantheon
# A random password is set in the dependencies:pre stage as a text file.
# This line reads the same file repeatedly. If the openssl call were used
# in this step, it would result in a different password being used in each
# line of other steps. Each CircleCI command runs in a separate shell.
WORDPRESS_ADMIN_PASSWORD: $(cat ~/WORDPRESS_ADMIN_PASSWORD)
WORDPRESS_ADMIN_EMAIL: [email protected]
PATH: $PATH:~/terminus/bin

dependencies:
cache_directories:
Expand All @@ -38,9 +40,10 @@ dependencies:
echo "TERMINUS_TOKEN environment variables missing; assuming unauthenticated build"
exit 0
fi
composer global require pantheon-systems/terminus ">=0.13.3 <0.99"
composer install
terminus auth login --machine-token=$TERMINUS_TOKEN
git clone --branch master https://github.com/pantheon-systems/terminus.git ~/terminus
cd ~/terminus && composer install
terminus auth:login --machine-token=$TERMINUS_TOKEN
test:
pre:
Expand Down

0 comments on commit a8d2f4d

Please sign in to comment.