Skip to content

Commit ebf2910

Browse files
author
composer-lock-update
committed
Refactor yaml anchors.
1 parent b5dabf8 commit ebf2910

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

bitbucket-pipelines.yml

+20-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
bash_env: &bash_env
2-
- cp bash_env.txt $BASH_ENV
3-
- source $BASH_ENV
1+
# These are yaml anchors, reused later
2+
x-bash-env-steps:
3+
- &bash_env_cp cp bash_env.txt $BASH_ENV
4+
- &bash_env_source source $BASH_ENV
45

6+
# This is a larger yaml anchor, reused for each pipeline
57
default_steps: &default_steps
68
- step:
79
name: Configure Environment Variables
8-
image: quay.io/pantheon-public/build-tools-ci:6.x
910
script:
1011
- CI_BRANCH=$BITBUCKET_BRANCH CI_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER PR_NUMBER=$BITBUCKET_PR_ID
1112
- /build-tools-ci/scripts/set-environment
@@ -18,22 +19,25 @@ default_steps: &default_steps
1819
caches:
1920
- composer
2021
script:
21-
<<: *bash_env
22+
- *bash_env_cp
23+
- *bash_env_source
2224
- ./.ci/test/static/run
2325
- step:
2426
name: Build PHP
2527
caches:
2628
- composer
2729
script:
28-
<<: *bash_env
30+
- *bash_env_cp
31+
- *bash_env_source
2932
- ./.ci/build/php
3033
artifacts:
3134
- web/**
3235
- vendor/**
3336
- step:
3437
name: Deploy to Pantheon
3538
script:
36-
<<: *bash_env
39+
- *bash_env_cp
40+
- *bash_env_source
3741
- ./.ci/deploy/pantheon/dev-multidev
3842
artifacts:
3943
- web/**
@@ -42,13 +46,14 @@ default_steps: &default_steps
4246
name: Test Visual Regression
4347
image: backstopjs/backstopjs:4.1.9
4448
caches:
45-
- npm
49+
- node
4650
variables:
4751
CI_BUILD_URL: $CI_PIPELINE_IID
4852
CI_REPOSITORY_URL: $CI_MERGE_REQUEST_IID
4953
ARTIFACTS_DIR_URL: https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/$CI_JOB_ID/artifacts
5054
script:
51-
<<: *bash_env
55+
- *bash_env_cp
56+
- *bash_env_source
5257
- ./.ci/test/visual-regression/run
5358
artifacts:
5459
- backstop_data/**
@@ -57,7 +62,8 @@ default_steps: &default_steps
5762
caches:
5863
- composer
5964
script:
60-
<<: *bash_env
65+
- *bash_env_cp
66+
- *bash_env_source
6167
- ./.ci/test/behat/initialize
6268
# Start headless Chrome
6369
- google-chrome --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --no-sandbox </dev/null &>/dev/null &
@@ -74,8 +80,8 @@ options:
7480

7581
pipelines:
7682
pull-requests:
77-
'**':
78-
<<: *default_steps
83+
# Using the default_steps anchor means no other items can be added
84+
'**': *default_steps
7985
branches:
80-
master:
81-
<<: *default_steps
86+
# Using the default_steps anchor means no other items can be added
87+
master: *default_steps

0 commit comments

Comments
 (0)