Skip to content

Commit 23b2079

Browse files
authored
[#1] Implemented branch deployment feature.
2 parents c20bab6 + 5692c6a commit 23b2079

File tree

9 files changed

+422
-34
lines changed

9 files changed

+422
-34
lines changed

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
2929

3030
- Checkout Github issues for outstanding issues
3131
- Implement each issue in a feature branch based on main
32+
- Commit messages are written in past tense and are 1 line to explain what has been fixed, added, enhanced.
3233
- Create a pull request with changes using the PR template located in `.github/PULL_REQUEST_TEMPLATE.md`
3334
- Add tests as required to prove the work

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ This will start the interactive mode, which will guide you through:
4848
- Deleting environments (except protected ones)
4949
- Generating login links for environments
5050
- Clearing Drupal caches
51+
- Deploying branches to environments
5152
- Viewing GitHub PR links for PR environments
5253

5354
## Features
@@ -58,6 +59,8 @@ This will start the interactive mode, which will guide you through:
5859
- GitHub PR integration for PR environments
5960
- One-click login link generation for Drupal environments
6061
- Quick Drupal cache clearing for any environment
62+
- Branch deployment with autocomplete selection
63+
- SSH key configuration for Lagoon authentication
6164
- Comprehensive logging of all operations
6265
- Extensible architecture for adding new commands
6366

@@ -92,6 +95,17 @@ The CLI can clear Drupal caches on any environment:
9295
- Executes the `drush cr` command on the selected environment
9396
- Shows the command output in the terminal
9497

98+
## Branch Deployment
99+
100+
The CLI can deploy any branch from a project's git repository:
101+
- Automatically fetches and lists all available branches with autocomplete search
102+
- Prioritizes main branches (main, master, develop) at the top of the list
103+
- Initiates deployment of the selected branch to the Lagoon environment
104+
- Provides real-time feedback about the deployment status
105+
- Validates branch names to prevent command injection
106+
107+
Note: Branch deployment is asynchronous and may take several minutes to complete. You can check the status in the Lagoon UI.
108+
95109
## Logging
96110

97111
All operations performed by the CLI are logged to daily log files in the `.logs` directory:

index.js renamed to index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import { program } from 'commander';
3-
import { startInteractiveMode } from './src/interactive';
3+
import { startInteractiveMode } from './src/interactive.mjs';
44

55
program
66
.name('lagoon-wrapper')

package-lock.json

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
"name": "lagoon-cli-wrapper",
33
"version": "1.0.0",
44
"description": "A CLI wrapper for Lagoon CLI",
5-
"main": "index.js",
6-
"type": "module",
5+
"main": "index.mjs",
76
"scripts": {
8-
"start": "node index.js",
7+
"start": "node index.mjs",
98
"lint": "eslint . --ext .mjs",
109
"lint:fix": "eslint . --ext .mjs --fix",
1110
"lint:report": "eslint . --ext .mjs -f json -o eslint-report.json"
@@ -24,7 +23,11 @@
2423
"eslint-plugin-n": "^17.17.0",
2524
"globals": "^16.1.0",
2625
"inquirer": "^9.2.12",
26+
"inquirer-autocomplete-prompt": "^3.0.1",
2727
"js-yaml": "^4.1.0",
2828
"ora": "^7.0.1"
29+
},
30+
"engine": {
31+
"node": ">22"
2932
}
3033
}

0 commit comments

Comments
 (0)