Skip to content

Commit 01039b6

Browse files
committed
Initial commit
0 parents  commit 01039b6

File tree

9 files changed

+4436
-0
lines changed

9 files changed

+4436
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor
2+
**/**.cache
3+
build

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Deployed Version Laravel
2+
This package helps with determining which version ofyour app is currently running. This is useful during a deploy, to see when it is finished, and also when you rollback to ensure that the correct version is used.
3+
4+
By "version" I refer to a git commit hash, but you can use any convention and value you like (for instance version number in composer.json).
5+
6+
## Installation
7+
Add the package to your Laravel project.
8+
9+
`composer require krisell/deployed-version-laravel`
10+
11+
The package is configured for automatic discovery, so unless you have other settings, you do not need to manually add the service provider.
12+
13+
## Usage
14+
The package adds a route `/version` which displays the value of the environment-variable VERSION.
15+
16+
You need to set the value of this variable during your buld or deploy process.
17+
18+
```bash
19+
VERSION=YOUR_VERSION_VALUE
20+
```
21+
22+
One way to achieve this is to run the following script, but you may do it however you like:
23+
24+
```bash
25+
echo "VERSION=$(git -C gitdir rev-parse HEAD)" >> .env.current-build
26+
```
27+
28+
.env.current-build refers to a copy of the .env-file, to ensure that the addition is not persistent.
29+
30+
## Licence
31+
MIT
32+
33+
## Author
34+
Martin Krisell ([email protected])

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "krisell/deployed-version-laravel",
3+
"description": "Adds a route to show currently running version",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Martin Krisell",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {},
13+
"autoload": {
14+
"psr-4": {
15+
"Krisell\\DeployedVersionLaravel\\": "src/"
16+
}
17+
},
18+
"require-dev": {
19+
"orchestra/testbench": "^3.8",
20+
"phpunit/phpunit": "^8.3"
21+
},
22+
"extra": {
23+
"laravel": {
24+
"providers": [
25+
"Krisell\\DeployedVersionLaravel\\DeployedVersionServiceProvider"
26+
]
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)