Closed tobeycodes closed 7 years ago
Suggested fix
USER_ID=$(terminus auth:whoami --field=id 2>&1)
if [[ ! $USER_ID =~ ^[A-Za-z0-9-]+$ ]]; then
echo "Terminus unauthenticated; assuming unauthenticated build"
exit 0
fi
I think long term we could create a teminus_helper.sh. It can be sourced by any file we need it so we can be all DRY 👍
Better yet we can login during dependencies: pre:
in circle.yml
instead of sourcing a function in other scripts.
Awesome! :)
I also moved installing terminus to here without the .sh file for 2.0. Will look at a PR for all this bigger stuff when I have a bit of time to tidy it up
version: 2
jobs:
build:
docker:
- image: php:7.0-apache
environment:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/.composer/vendor/bin
working_directory: /var/www/html
steps:
- run:
name: Updating and installing packages
command: apt-get update && apt-get -y install git unzip jq
- run:
name: Install Composer
command: |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php -r "copy('https://composer.github.io/installer.sig', 'composer-setup.sig');" && \
php -r "if (hash_file('SHA384', 'composer-setup.php') === trim(file_get_contents('composer-setup.sig'))) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
php -r "unlink('composer-setup.php');" && \
php -r "unlink('composer-setup.sig');"
- run:
name: Install Terminus
command: composer global require pantheon-systems/terminus:1.3.0
- checkout
- run:
name: Running Build
command: ./bin/build
- deploy:
name: Running Deploy
command: ./bin/deploy```
This last command exit code condition will never pass
https://github.com/ataylorme/Advanced-WordPress-on-Pantheon/blob/master/bin/behat-cleanup.sh#L12