Skip to content

Commit c178365

Browse files
committed
[#1428] Updated deployment bypass mechanism to use list-based variables.
- Replaced individual `VORTEX_DEPLOY_SKIP_PR_<NUMBER>` and `VORTEX_DEPLOY_SKIP_BRANCH_<SAFE_BRANCH>` variables with comma-separated list variables - Added `VORTEX_DEPLOY_SKIP_PRS` for PR numbers (single or comma-separated) - Added `VORTEX_DEPLOY_SKIP_BRANCHES` for branch names (single or comma-separated) - Updated `scripts/vortex/deploy.sh` with new list-based skip logic - Updated PHPUnit tests to cover new skip scenarios - Updated documentation for deployment workflows and variables - Updated GitHub Actions workflow to include new environment variables - Updated CI variables configuration - Updated installer baseline fixtures This is a breaking change. Projects using the old mechanism will need to migrate from: VORTEX_DEPLOY_SKIP_PR_123: "1" VORTEX_DEPLOY_SKIP_BRANCH_FEATURE_TEST: "1" To: VORTEX_DEPLOY_ALLOW_SKIP: "1" VORTEX_DEPLOY_SKIP_PRS: "123" VORTEX_DEPLOY_SKIP_BRANCHES: "feature/test"
1 parent dafe633 commit c178365

File tree

9 files changed

+471
-58
lines changed

9 files changed

+471
-58
lines changed

.github/workflows/build-test-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,5 +475,8 @@ jobs:
475475
VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME: ${{ vars.VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME }}
476476
VORTEX_DEPLOY_WEBHOOK_URL: ${{ vars.VORTEX_DEPLOY_WEBHOOK_URL }}
477477
VORTEX_DEPLOY_SKIP: ${{ vars.VORTEX_DEPLOY_SKIP }}
478+
VORTEX_DEPLOY_ALLOW_SKIP: ${{ vars.VORTEX_DEPLOY_ALLOW_SKIP }}
479+
VORTEX_DEPLOY_SKIP_PRS: ${{ vars.VORTEX_DEPLOY_SKIP_PRS }}
480+
VORTEX_DEPLOY_SKIP_BRANCHES: ${{ vars.VORTEX_DEPLOY_SKIP_BRANCHES }}
478481
timeout-minutes: 30
479482
#;> DEPLOYMENT

.vortex/docs/.utils/variables/extra/ci.variables.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
# Skip all deployments.
77
VORTEX_DEPLOY_SKIP=
88

9+
# Flag to allow skipping of a deployment using additional flags.
10+
VORTEX_DEPLOY_ALLOW_SKIP=
11+
12+
# Pull request numbers to skip deployment for (single value or comma-separated list).
13+
VORTEX_DEPLOY_SKIP_PRS=
14+
15+
# Branch names to skip deployment for (single value or comma-separated list).
16+
VORTEX_DEPLOY_SKIP_BRANCHES=
17+
918
# Proceed with container image deployment after it was exported.
1019
VORTEX_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED=
1120

.vortex/docs/content/workflows/deployment.mdx

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,31 +75,45 @@ variable to `1`.
7575
This is especially useful in continuous integration pipelines where you may want to build and test
7676
without triggering a deployment.
7777

78-
### Skipping deployments for a specific Pull Requests or branches
78+
### Skipping deployments for specific Pull Requests or branches
7979

80-
To skip a specific Pull Request or branch using the `$VORTEX_DEPLOY_SKIP`
81-
variable, you would define additional environment variables with a specific
82-
naming convention in your continuous integration pipeline configuration.
80+
To skip specific Pull Requests or branches, set `$VORTEX_DEPLOY_ALLOW_SKIP` to `1`
81+
and provide lists in the following variables:
8382

84-
Here's an example of how this can be done:
83+
#### Skipping specific Pull Requests
8584

86-
#### Skipping a specific Pull Request
85+
Set `$VORTEX_DEPLOY_SKIP_PRS` to a single PR number or comma-separated list:
8786

88-
Suppose you want to skip the deployment for Pull Request number 42. You would
89-
set the following environment variable:
87+
```bash
88+
# Skip a single PR
89+
VORTEX_DEPLOY_ALLOW_SKIP=1
90+
VORTEX_DEPLOY_SKIP_PRS=42
9091

91-
```bash
92-
VORTEX_DEPLOY_SKIP_PR_42=1
93-
```
92+
# Skip multiple PRs
93+
VORTEX_DEPLOY_ALLOW_SKIP=1
94+
VORTEX_DEPLOY_SKIP_PRS=42,123,456
95+
```
9496

95-
#### Skipping a specific branch
97+
#### Skipping specific branches
9698

97-
Suppose you want to skip the deployment for a branch named `feature-x`. You
98-
would first create a "safe" version of the branch name by replacing any
99-
special characters with underscores.
99+
Set `$VORTEX_DEPLOY_SKIP_BRANCHES` to a single branch name or comma-separated list:
100100

101-
Set the following environment variable:
101+
```bash
102+
# Skip a single branch
103+
VORTEX_DEPLOY_ALLOW_SKIP=1
104+
VORTEX_DEPLOY_SKIP_BRANCHES=feature/test
102105

103-
```bash
104-
VORTEX_DEPLOY_SKIP_BRANCH_FEATURE_X=1
105-
```
106+
# Skip multiple branches
107+
VORTEX_DEPLOY_ALLOW_SKIP=1
108+
VORTEX_DEPLOY_SKIP_BRANCHES=feature/test,hotfix/urgent,project/experimental
109+
```
110+
111+
#### Combined usage
112+
113+
You can use both variables together:
114+
115+
```bash
116+
VORTEX_DEPLOY_ALLOW_SKIP=1
117+
VORTEX_DEPLOY_SKIP_PRS=42,123
118+
VORTEX_DEPLOY_SKIP_BRANCHES=feature/test,hotfix/urgent
119+
```

.vortex/docs/content/workflows/variables.mdx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ Flag to allow skipping of a deployment using additional flags.
852852

853853
Default value: `UNDEFINED`
854854

855-
Defined or used in: `scripts/vortex/deploy.sh`
855+
Defined or used in: `CI config`, `scripts/vortex/deploy.sh`
856856

857857
### `VORTEX_DEPLOY_ARTIFACT_DST_BRANCH`
858858

@@ -1042,6 +1042,22 @@ Default value: `UNDEFINED`
10421042

10431043
Defined or used in: `CI config`
10441044

1045+
### `VORTEX_DEPLOY_SKIP_BRANCHES`
1046+
1047+
Branch names to skip deployment for (single value or comma-separated list).
1048+
1049+
Default value: `UNDEFINED`
1050+
1051+
Defined or used in: `CI config`, `scripts/vortex/deploy.sh`
1052+
1053+
### `VORTEX_DEPLOY_SKIP_PRS`
1054+
1055+
Pull request numbers to skip deployment for (single value or comma-separated list).
1056+
1057+
Default value: `UNDEFINED`
1058+
1059+
Defined or used in: `CI config`, `scripts/vortex/deploy.sh`
1060+
10451061
### `VORTEX_DEPLOY_SSH_FILE`
10461062

10471063
Default SSH file used if custom fingerprint is not provided.

.vortex/installer/tests/Fixtures/install/_baseline/.github/workflows/build-test-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,4 +438,7 @@ jobs:
438438
VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME: ${{ vars.VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME }}
439439
VORTEX_DEPLOY_WEBHOOK_URL: ${{ vars.VORTEX_DEPLOY_WEBHOOK_URL }}
440440
VORTEX_DEPLOY_SKIP: ${{ vars.VORTEX_DEPLOY_SKIP }}
441+
VORTEX_DEPLOY_ALLOW_SKIP: ${{ vars.VORTEX_DEPLOY_ALLOW_SKIP }}
442+
VORTEX_DEPLOY_SKIP_PRS: ${{ vars.VORTEX_DEPLOY_SKIP_PRS }}
443+
VORTEX_DEPLOY_SKIP_BRANCHES: ${{ vars.VORTEX_DEPLOY_SKIP_BRANCHES }}
441444
timeout-minutes: 30

.vortex/installer/tests/Fixtures/install/deploy_types_none_gha/.github/workflows/build-test-deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@ -369,73 +369,3 @@
1+
@@ -369,76 +369,3 @@
22
timeout-minutes: 120 # Cancel the action after 15 minutes, regardless of whether a connection has been established.
33
with:
44
detached: true
@@ -71,4 +71,7 @@
7171
- VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME: ${{ vars.VORTEX_DEPLOY_ARTIFACT_GIT_USER_NAME }}
7272
- VORTEX_DEPLOY_WEBHOOK_URL: ${{ vars.VORTEX_DEPLOY_WEBHOOK_URL }}
7373
- VORTEX_DEPLOY_SKIP: ${{ vars.VORTEX_DEPLOY_SKIP }}
74+
- VORTEX_DEPLOY_ALLOW_SKIP: ${{ vars.VORTEX_DEPLOY_ALLOW_SKIP }}
75+
- VORTEX_DEPLOY_SKIP_PRS: ${{ vars.VORTEX_DEPLOY_SKIP_PRS }}
76+
- VORTEX_DEPLOY_SKIP_BRANCHES: ${{ vars.VORTEX_DEPLOY_SKIP_BRANCHES }}
7477
- timeout-minutes: 30

0 commit comments

Comments
 (0)