Skip to content

Instantly share code, notes, and snippets.

@dusta
Created February 11, 2020 14:35
Show Gist options
  • Save dusta/68cac449ea09238cf7481ec13985c64f to your computer and use it in GitHub Desktop.
Save dusta/68cac449ea09238cf7481ec13985c64f to your computer and use it in GitHub Desktop.
bitbucket-pipelines deploy tag zip ftp
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.3
pipelines:
tags: # add the 'tags' section
v*: # specify the tag
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y git unzip zip zlib1g-dev libzip-dev git-ftp curl
- docker-php-ext-install zip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Setup
- composer install
# Deploy
- zip -r $BITBUCKET_REPO_SLUG-$BITBUCKET_TAG.zip .
- curl -T $BITBUCKET_REPO_SLUG-$BITBUCKET_TAG.zip -u $FTP_USERNAME:$FTP_PASSWORD ftp://$FTP_HOST/public_html/releases/
- curl -v "https://$DEPLOY_URL/release.php?key=$DEPLOY_KEY&v=$BITBUCKET_TAG"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment