# shared pipeline template # $TARGET_DIRECTORY_NAME is an optional repository variable. it is used when the asset folder name differs from the repository slug. # https://bitbucket.org/blog/share-ci-config # https://support.atlassian.com/bitbucket-cloud/docs/share-pipelines-configurations/ # https://support.atlassian.com/requests/BBS-209312 image: name: baizmandesign/wp-asset-deployment:latest username: $DOCKERHUB_USERNAME password: $DOCKERHUB_PASSWORD email: $DOCKERHUB_EMAIL definitions: pipelines: dreamhost-wp-asset-deployment: - step: name: Deploy ZIP archive to wp.baizmandesign.com. script: - git archive -o ${BITBUCKET_REPO_SLUG}.zip -9 --prefix=${TARGET_DIRECTORY_NAME:-${BITBUCKET_REPO_SLUG}}/ HEAD - pipe: atlassian/scp-deploy:1.5.0 variables: USER: $BDSL_SSH_USER SERVER: $BDSL_SSH_HOST REMOTE_PATH: $BDSL_SSH_HOST_SUBDIR LOCAL_PATH: ${BITBUCKET_REPO_SLUG}.zip - step: name: Deploy asset on $WP_CLI_ALIAS. script: - if [ "${WP_CLI_ALIAS}" != "" ]; then /bin/sh /usr/bin/update-asset.sh $WP_CLI_ALIAS ${TARGET_DIRECTORY_NAME:-${BITBUCKET_REPO_SLUG}} $BB_ACCESS_TOKEN; else echo ; echo '$WP_CLI_ALIAS is not defined.' ; echo ; fi