A minimal Alpine Linux docker image with the latest git-ftp suited for automated deployments via Continuous Delivery systems like GitLab Pipelines.
Automatically build upon pushes to the master branch: https://hub.docker.com/r/biterika/git-ftp
Example bitbucket-pipelines.yml configuration:
# Installation ---
# 1. In Bitbucket, add $FTP_USERNAME $FTP_PASSWORD and $FTP_HOST as environment variables.
# 2. Commit this file to your repo
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will
# push everything and initial GitFTP)
#
# Usage ---
# - On each commit to master branch, it'll push all files to the $FTP_HOST
# - You also have the option to 'init' (from Bitbucket Cloud) - pushes everything and initialises
# - Finally you can also 'deploy-all' (from Bitbucket Cloud) - if multiple deploys fail, you
# can deploy everything to "catch up"
#
image: biterika/git-ftp:latest
pipelines:
custom:
init-master:
- step:
caches:
- node
- composer
script:
- git ftp init -u "$FTP_USERNAME_MASTER" -p "$FTP_PASSWORD_MASTER" ftp://$FTP_HOST_MASTER
init-staging:
- step:
caches:
- node
- composer
script:
- git ftp init -u "$FTP_USERNAME_STAGING" -p "$FTP_PASSWORD_STAGING" ftp://$FTP_HOST_STAGING
deploy-all-master:
- step:
caches:
- node
- composer
script:
- git ftp push -u "$FTP_USERNAME_MASTER" -p "$FTP_PASSWORD_MASTER" ftp://$FTP_HOST_MASTER
deploy-all-staging:
- step:
caches:
- node
- composer
script:
- git ftp push -u "$FTP_USERNAME_STAGING" -p "$FTP_PASSWORD_STAGING" ftp://$FTP_HOST_STAGING
branches:
master:
- step:
caches:
- node
- composer
script:
- git ftp push -u "$FTP_USERNAME_MASTER" -p "$FTP_PASSWORD_MASTER" ftp://$FTP_HOST_MASTER
staging:
- step:
caches:
- node
- composer
script:
- git ftp push -u "$FTP_USERNAME_STAGING" -p "$FTP_PASSWORD_STAGING" ftp://$FTP_HOST_STAGING
Make sure, you configure the master variables: $FTP_USERNAME_MASTER, $FTP_PASSWORD_MASTER, $FTP_HOST_MASTER and
staging variables: $FTP_USERNAME_STAGING, $FTP_PASSWORD_STAGING, $FTP_HOST_STAGING
variables in the CI/CD settings on Bitbucket.
Copyright (c) 2019 Biterika Group LLC. Released under the MIT license.
Content type
Image
Digest
Size
38.1 MB
Last updated
over 7 years ago
docker pull biterika/git-ftp