Skip to content

Commit

Permalink
feat: added version into the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Jun 14, 2024
1 parent 996fde4 commit 9326ed5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ Vanguard uses Duster by Tighten to ensure a consistent code style across the pro

Vanguard has a few artisan commands that are specific to the project that can be run. Here is a list of the commands and what they do:

| Command | Description |
|-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `vanguard:generate-ssh-key` | Generates an SSH key required for backup operations. |
| `vanguard:validate-s3-connection {id}` | Able to check whether a backup destination that uses S3 can be reached. This takes the primary key of the backup destination as an id. |
| `vanguard:encrypt-database-passwords` | Used to convert any previously non-encrypted database passwords to encrypted. This was only necessary once. |
| Command | Description |
|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `vanguard:generate-ssh-key` | Generates an SSH key required for backup operations. |
| `vanguard:version` | Checks the version of Vanguard. |
| `vanguard:validate-s3-connection {id}` | Able to check whether a backup destination that uses S3 can be reached. This takes the primary key of the backup destination as an id. |
| `vanguard:encrypt-database-passwords` | Used to convert any previously non-encrypted database passwords to encrypted. This was only necessary once. |

**Note:** There are other commands, but they are not intended to be run manually and are used internally by Vanguard's scheduler.

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.2
6 changes: 3 additions & 3 deletions app/Console/Commands/CheckVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Console\Commands;

use File;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;

class CheckVersion extends Command
{
Expand All @@ -16,8 +16,8 @@ public function handle(): void

$versionFile = base_path('VERSION');

if (! File::exists($versionFile)) {
$this->components->error('Unable to determine the current version. The version file is missing.');
if (!File::exists($versionFile)) {
$this->components->error("Unable to determine the current version. The version file is missing.");

return;
}
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/Console/Commands/CheckVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
->assertExitCode(0);
});


it('returns the current version number from the file', function () {
File::shouldReceive('exists')->with(base_path('VERSION'))->andReturn(true);
File::shouldReceive('get')->with(base_path('VERSION'))->andReturn('1.0.0');
Expand Down

0 comments on commit 9326ed5

Please sign in to comment.