Skip to content

Commit 1d06d47

Browse files
authored
Added: bitbucket pipelines example (#3979)
1 parent 14f9e1a commit 1d06d47

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/ci-cd.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,53 @@ deploy:
7676
- master
7777
```
7878

79+
## Bitbucket Pipelines
80+
81+
Firstly, [generate a new SSH key and add it to your workspace for the server](https://support.atlassian.com/bitbucket-cloud/docs/configure-ssh-and-two-step-verification/). There are instructions on the SSH Keys page that can help you add this key to your server.
82+
83+
You may also need to [define your environment variables](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-monitor-deployments/#Step-1--Define-your-environments) that you need to use in your deploy commands.
84+
85+
Create a bitbucket-pipelines.yml file with the following content:
86+
87+
```yml
88+
pipelines:
89+
branches:
90+
develop:
91+
- stage:
92+
# this is the target deployment name and it will inherit the environment from it
93+
deployment: staging
94+
name: Deploy Staging
95+
steps:
96+
- step:
97+
name: Composer Install
98+
image: composer/composer:2.2
99+
caches:
100+
- composer
101+
script:
102+
- composer install --quiet
103+
artifacts:
104+
# we need to save all these files so that they can be picked up in the actual deployment
105+
- vendor/**
106+
- step:
107+
name: NPM Install
108+
image: node:22-bullseye-slim
109+
caches:
110+
- node
111+
script:
112+
- npm install --silent
113+
artifacts:
114+
# we need to save all these files so that they can be picked up in the actual deployment
115+
- public/build/**
116+
- step:
117+
name: Deployer Deploy
118+
timeout: 6m # if it takes longer than this, error out
119+
# @see https://hub.docker.com/r/deployphp/deployer/tags?name=v7.5
120+
image: deployphp/deployer:v7.5.8
121+
script:
122+
# pass $DEVELOP and $STAGING variables from the "staging" deployment environment
123+
- php /bin/deployer.phar deploy --branch=$DEVELOP stage=$STAGING
124+
```
125+
79126
### Deployment concurrency
80127

81128
Only one deployment job runs at a time with the [`resource_group` keyword](https://docs.gitlab.com/ee/ci/yaml/index.html#resource_group) in .gitlab-ci.yml.

0 commit comments

Comments
 (0)