Skip to content

feat: introduce deploy command#1202

Merged
hwbrzzl merged 3 commits intogoravel:masterfrom
cggonzal:feature/introduce-deploy-command
Sep 21, 2025
Merged

feat: introduce deploy command#1202
hwbrzzl merged 3 commits intogoravel:masterfrom
cggonzal:feature/introduce-deploy-command

Conversation

@cggonzal
Copy link
Contributor

@cggonzal cggonzal commented Sep 17, 2025

📑 Description

As discussed here, this PR introduces the deploy command that can be used to deploy a Goravel app to a server with a command like:

go run . artisan deploy

This PR introduces the deploy command but does not implement the command. A later PR will implement the logic of the command. This PR was created so that the feature could be broken up into smaller pieces as was discussed.

✅ Checks

  • Added test cases for my code

@cggonzal cggonzal requested a review from a team as a code owner September 17, 2025 04:06
@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 0% with 96 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.29%. Comparing base (fa0d50c) to head (a7b4369).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
console/console/deploy_command.go 0.00% 96 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1202      +/-   ##
==========================================
+ Coverage   67.91%   68.29%   +0.38%     
==========================================
  Files         233      233              
  Lines       14712    15200     +488     
==========================================
+ Hits         9991    10381     +390     
- Misses       4363     4459      +96     
- Partials      358      360       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cggonzal cggonzal changed the title introduce deploy command feat: introduce deploy command Sep 17, 2025
@cggonzal
Copy link
Contributor Author

@hwbrzzl I don't have tests for this code since the core logic is not implemented. The idea is to do that in the next PR.

Would you still like some form of tests in this PR?

I'll have to delete whatever tests I merge here in the next PR since the next one will implement and have tests for the core logic...

@hwbrzzl
Copy link
Contributor

hwbrzzl commented Sep 17, 2025

Thanks @cggonzal Let's create the related issue and sub-issues first to check what features should be implemented first.

@cggonzal cggonzal mentioned this pull request Sep 17, 2025
1 task
Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, nice.

console.NewKeyGenerateCommand(configFacade),
console.NewMakeCommand(),
console.NewBuildCommand(configFacade),
console.NewDeployCommand(configFacade),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to register it for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the registration. See latest commit.


// Extend The console command extend.
func (r *DeployCommand) Extend() command.Extend {
return command.Extend{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some options can be added in a further PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a TODO comment to do this in a later PR.

Comment on lines +43 to +54
// get all environment variables
app_name := r.config.Env("APP_NAME")
ip_address := r.config.Env("DEPLOY_IP_ADDRESS")
ssh_port := r.config.Env("DEPLOY_SSH_PORT")
ssh_user := r.config.Env("DEPLOY_SSH_USER")
ssh_key_path := r.config.Env("DEPLOY_SSH_KEY_PATH")
os := r.config.Env("DEPLOY_OS")
arch := r.config.Env("DEPLOY_ARCH")
static := r.config.Env("DEPLOY_STATIC")

// if any of the required environment variables are missing, prompt the user to enter them
if app_name == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initiate variables logic can be separated into an independent function in a further PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a TODO comment to do this in a later PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, and please modify app_name to appName in the next PR.

@cggonzal
Copy link
Contributor Author

@hwbrzzl I've made changes based on your comments.

Two of the comments will be addressed in a later PR once the core logic is working.

Let me know if there should be other changes before merging this.

Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@hwbrzzl hwbrzzl merged commit a7a2841 into goravel:master Sep 21, 2025
13 of 14 checks passed
@cggonzal cggonzal deleted the feature/introduce-deploy-command branch September 21, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants