diff --git a/.travis.yml b/.travis.yml index 507378a1fd9..5ea963c20a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,6 @@ cache: - $HOME/.npm - $HOME/.nvm/.cache - $HOME/phpunit-bin - - $HOME/deployment-targets branches: only: @@ -160,21 +159,3 @@ jobs: - bash <(curl -s https://codecov.io/bash) -cF php -f /tmp/wordpress/src/wp-content/plugins/amp/build/logs/clover.xml - npm run test:js -- --collectCoverage - bash <(curl -s https://codecov.io/bash) -cF javascript -f build/logs/lcov.info - - - stage: deploy - if: type = push AND fork = false AND ( branch =~ ^[a-z][a-z0-9-]{0,10}$ OR branch =~ ^[0-9]+\.[0-9]+$ ) AND NOT branch IN ( live, test, dev, settings, team, support, debug, multidev, files, tags, billing ) - php: "7.1" - env: WP_VERSION=latest DEV_LIB_ONLY=composer,grunt - script: - - | - eval "$(ssh-agent -s)" - pantheon_branch=$( echo $TRAVIS_BRANCH | sed 's/^\([0-9]\)/v\1/' | sed 's/[^a-z0-9-]/-/' ) - echo "Initializing deployment to Pantheon branch: $pantheon_branch" - openssl aes-256-cbc -K $encrypted_7eb11f40d4e9_key -iv $encrypted_7eb11f40d4e9_iv -in bin/keys/id_rsa_ampconfdemo.enc -out bin/keys/id_rsa_ampconfdemo -d - chmod 600 bin/keys/id_rsa_ampconfdemo - ./bin/deploy-travis-pantheon.sh \ - ampconfdemo \ - db7f3307-9808-4753-aaa4-acb387c94472 \ - $(pwd)/bin/keys/id_rsa_ampconfdemo \ - $pantheon_branch - after_script: skip diff --git a/bin/deploy-travis-pantheon.sh b/bin/deploy-travis-pantheon.sh deleted file mode 100755 index 9450d5265f4..00000000000 --- a/bin/deploy-travis-pantheon.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -set -e -# Travis CI Deploy script to Pantheon - -# Positional args: -pantheon_site=$1 -pantheon_uuid=$2 -ssh_identity=$3 -pantheon_branch=$4 - -if [[ -z "$pantheon_site" ]]; then - echo "Missing pantheon_site positional arg 1" - exit 1 -fi -if [[ -z "$pantheon_uuid" ]]; then - echo "Missing pantheon_uuid positional arg 2" - exit 1 -fi -if [[ -z "$ssh_identity" ]]; then - echo "Missing ssh_identity positional arg 3" - exit 1 -fi -if [[ -z "$pantheon_branch" ]]; then - echo "Missing pantheon_branch positional arg 4" - exit 1 -fi - -cd "$(dirname "$0")/.." -project_dir="$(pwd)" -repo_dir="$HOME/deployment-targets/$pantheon_site" - -# Restrict deploys to commits pushed to a branch name that can be used as a subdomain, specifically here on a Pantheon multidev environment: -# "Branch names can contain any ASCII letter and number (a through z, 0 through 9) and hyphen (dash). The branch name must start with a letter or number. -# Currently, the maximum length is 11 characters and environments cannot be created with the following reserved names." -# Note: master is allowed since it maps to dev; the dev branch is instead disallowed. -if ! [[ $pantheon_branch =~ ^[a-z][a-z0-9-]{0,10}$ ]] || [[ $pantheon_branch =~ ^(live|test|dev|settings|team|support|debug|multidev|files|tags|billing)$ ]]; then - echo "Aborting since branch '$pantheon_branch' cannot be an environment." - exit 1 -fi - -ssh-add $ssh_identity - -if ! grep -q "codeserver.dev.$pantheon_uuid.drush.in" ~/.ssh/known_hosts; then - ssh-keyscan -p 2222 codeserver.dev.$pantheon_uuid.drush.in >> ~/.ssh/known_hosts -fi - -if ! grep -q "codeserver.dev.$pantheon_uuid.drush.in" ~/.ssh/config; then - echo "Host $pantheon_site" >> ~/.ssh/config - echo " Hostname codeserver.dev.$pantheon_uuid.drush.in" >> ~/.ssh/config - echo " User codeserver.dev.$pantheon_uuid" >> ~/.ssh/config - echo " IdentityFile $ssh_identity" >> ~/.ssh/config - echo " IdentitiesOnly yes" >> ~/.ssh/config - echo " Port 2222" >> ~/.ssh/config - echo " KbdInteractiveAuthentication no" >> ~/.ssh/config -fi -git config --global user.name "Travis CI" -git config --global user.email "travis-ci+$pantheon_site@xwp.co" - -# Set the branch. -if [[ $pantheon_branch == 'master' ]]; then - pantheon_env=dev -else - pantheon_env=$pantheon_branch -fi - -if [ ! -e "$repo_dir/.git" ]; then - git clone -v ssh://codeserver.dev.$pantheon_uuid@codeserver.dev.$pantheon_uuid.drush.in:2222/~/repository.git "$repo_dir" -fi - -cd "$repo_dir" -git fetch - -if git rev-parse --verify --quiet "$pantheon_branch" > /dev/null; then - git checkout "$pantheon_branch" -else - git checkout -b "$pantheon_branch" -fi -if git rev-parse --verify --quiet "origin/$pantheon_branch" > /dev/null; then - git reset --hard "origin/$pantheon_branch" -fi - -# Install and build. -cd "$project_dir" -if [ ! -e node_modules/.bin ]; then - npm install -fi -PATH="node_modules/.bin/:$PATH" -npm run build -rsync -avz --delete ./build/ "$repo_dir/wp-content/plugins/amp/" -git --no-pager log -1 --format="Build AMP plugin at %h: %s" > /tmp/commit-message.txt - -# Commit and deploy. -cd "$repo_dir" -git add -A "wp-content/plugins/amp/" -git commit -F /tmp/commit-message.txt -git push origin $pantheon_branch - -echo "View site at http://$pantheon_env-$pantheon_site.pantheonsite.io/" -echo "Access Pantheon dashboard at https://dashboard.pantheon.io/sites/$pantheon_uuid#$pantheon_env" diff --git a/bin/keys/id_rsa_ampconfdemo.enc b/bin/keys/id_rsa_ampconfdemo.enc deleted file mode 100644 index 807047641ec..00000000000 Binary files a/bin/keys/id_rsa_ampconfdemo.enc and /dev/null differ diff --git a/bin/keys/id_rsa_ampconfdemo.pub b/bin/keys/id_rsa_ampconfdemo.pub deleted file mode 100644 index 153effc4fe7..00000000000 --- a/bin/keys/id_rsa_ampconfdemo.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKI5pL/0+v6neXAyIAy9nCrFQS4g4YoeNe7Ij+2wzgO5tZ1wnY931pm5IJ4JD310m/LYqpVn6Uwc/qKwVDeHHPQDOAuL7eCJIt2ns+DqYoP1VEYBYgeyOdc8j20n0doi5fYklc6CYWHVJomvQ/Sn5ACfnuA4ppBZdUxIo70tJzv7SAyOZli4D7hNhxpBNl4i9H0S/XIT61TSroEAFU78BR1hv9e+U0SkGSpIP44vuwQ7jG/DlB0X7J2p1w9VosnEcwbDaMJF4THiSDUAB6Ezwxa481vKPHFunGnwuOl7QSbglz/WrZ1/v5N8Uzz2E6moRT1fMgBC2ygWJAgwq3VS/b travis-ci+ampconfdemo@xwp.co