This image helps to deploy Applications with Deployer PHP official package. Useful for pipelines
466
This pipe helps to deploy a PHP application with Official Deployer Package for PHP
Add the following snippet to the script section of your bitbucket-pipelines.yml file:
script:
- pipe: docker://helixtech/deployer-php:0.1.0
variables:
HOST: "host-to-deploy"
SSH_PRIVATE_KEY_TO_DEPLOY: "$PRIVATE_KEY_TO_DEPLOY"
# DEPLOYER_VERSION: "v6.8.0" # Optional
# PATH_DEPLOY_FILE: "path/to/file" # Optional
# DOWNLOAD_DEPLOY_FILE: "true" # Optional
# SSH_PRIVATE_KEY_TO_CLONE: "$PRIVATE_KEY_TO_CLONE" # Depends on DOWNLOAD_DEPLOY_FILE
# REPO_DEPLOYER_URL: "[email protected]:username/repo-deployer-file.git" # Depends on DOWNLOAD_DEPLOY_FILE
# REPO_DEPLOYER_BRANCH: "master" # Depends on DOWNLOAD_DEPLOY_FILE
# EXTRA_ARGS: "<string>" # Optional
# DEBUG: "<boolean>" # Optional
| Variable | Usage |
|---|---|
| HOST (*) | The host where you want to deploy. This parameter is required because before run the deploy, that host is added to known_hosts file |
| SSH_PRIVATE_KEY_TO_DEPLOY (*) | The ssh key necessary to deploy into the HOST server |
| DEPLOYER_VERSION | The Deployer that you want to use. Default: latest. If you want to use another version don't forget the version prefix "v", E.g: v6.7.2. For more information about versions you can see Deployer download |
| DEBUG | Turn on extra debug information. Default: false. |
| EXTRA_ARGS (Optional) | Pass some extra options to the deployer command. For more information you can see Deployer PHP |
| PATH_DEPLOY_FILE (Optional) | Path to the Deployer file. [IMPORTANT] Avoid pass "--file[=FILE]" option in EXTRA_ARGS, because it's unnecesary. With this parameter the pipe locates the working directory in this value. Defult: "." |
| DOWNLOAD_DEPLOY_FILE | Turn on import the Deployer file from a git repository. Default: false. |
| REPO_DEPLOYER_URL (**) | The git repository uri to import the Deployer file. If you use ssh method (E.g. [email protected]:username/repo-deployer-file.git) you have to use the SSH_PRIVATE_KEY_TO_CLONE. If you use Https method you can use the oauth method for authenticate (E.g. git clone https://x-token-auth:{access_token}@bitbucket.org/user/repo.git) |
| REPO_DEPLOYER_BRANCH (**) | The repository branch where is the Deployer file |
| SSH_PRIVATE_KEY_TO_CLONE (**) | The ssh key necessary to clone a repository where you have the Deployer file. This parameter is required ONLY if REPO_DEPLOYER_URL is for clone by ssh method (E.g. REPO_DEPLOYER_URL=[email protected]:username/repo-deployer-file.git) |
(*) = required variable.
(**) = required variable ONLY if DOWNLOAD_DEPLOY_FILE is set "true".
Basic example:
Deploy with Deployer file located in the repository root running the pipeline.
script:
- export KEY_TO_DEPLOY=$(echo "$PRIVATE_KEY_TO_DEPLOY" | base64 --decode) // This line will decode the ssh key encoded
- pipe: docker://helixtech/deployer-php:0.1.0
variables:
HOST: "host-to-deploy"
SSH_PRIVATE_KEY_TO_DEPLOY: "$KEY_TO_DEPLOY"
Advanced example:
Clone the Deployer file from a git repository by ssh method.
script:
- export KEY_TO_DEPLOY=$(echo "$PRIVATE_KEY_TO_DEPLOY" | base64 --decode) // This line will decode the ssh key encoded
- export KEY_TO_CLONE=$(echo "$PRIVATE_KEY_TO_CLONE" | base64 --decode) // This line will decode the ssh key encoded
- pipe: docker://helixtech/deployer-php:0.1.0
variables:
HOST: "host-to-deploy"
SSH_PRIVATE_KEY_TO_DEPLOY: "$KEY_TO_DEPLOY"
DEPLOYER_VERSION: "v6.3.0"
PATH_DEPLOY_FILE: "path/to/file"
DOWNLOAD_DEPLOY_FILE: "true"
SSH_PRIVATE_KEY_TO_CLONE: "$KEY_TO_CLONE"
REPO_DEPLOYER_URL: "[email protected]:username/repo-deployer-file.git"
REPO_DEPLOYER_BRANCH: "master"
EXTRA_ARGS: "dev --branch=develop"
Clone the Deployer file from a git repository by https method.
script:
- export KEY_TO_DEPLOY=$(echo "$PRIVATE_KEY_TO_DEPLOY" | base64 --decode) // This line will decode the ssh key encoded
- pipe: docker://helixtech/deployer-php:0.1.0
variables:
HOST: "host-to-deploy"
SSH_PRIVATE_KEY_TO_DEPLOY: "$KEY_TO_DEPLOY"
PATH_DEPLOY_FILE: "path/to/file"
DOWNLOAD_DEPLOY_FILE: "true"
REPO_DEPLOYER_URL: "https://x-token-auth:{access_token}@bitbucket.org/user/repo.git"
EXTRA_ARGS: "dev --branch=develop"
docker run \
-e SSH_PRIVATE_KEY_TO_CLONE="$(cat ~/.ssh/id_rsa_to_clone_file)" \
-e SSH_PRIVATE_KEY_TO_DEPLOY="$(cat ~/.ssh/id_rsa_to_deploy)" \
-e HOST=host-to-deploy \
-e PATH_DEPLOY_FILE="path/to/file" \
-e [email protected]:username/repo-deployer-file.git \
-e DOWNLOAD_DEPLOY_FILE="true" \
-e REPO_DEPLOYER_BRANCH=master \
-e EXTRA_ARGS="dev --branch=develop" \
--name test_deployer \
helixtech/deployer-php:0.1.0
If you’d like help with this pipe, or you have an issue or feature request, let us know. The pipe is maintained by [email protected].
If you’re reporting an issue, please include:
Content type
Image
Digest
Size
27.2 MB
Last updated
over 6 years ago
docker pull helixtech/deployer-php