Read the version base from the install for the deployment
This commit is contained in:
+6
-5
@@ -40,8 +40,9 @@ jobs:
|
|||||||
- if [ "$TRAVIS_BRANCH" = "dev" ]; then ./.travis/deploy_script.sh; fi
|
- if [ "$TRAVIS_BRANCH" = "dev" ]; then ./.travis/deploy_script.sh; fi
|
||||||
- if [ "$TRAVIS_BRANCH" = "master" ]; then ./.travis/deploy_script.sh; fi
|
- if [ "$TRAVIS_BRANCH" = "master" ]; then ./.travis/deploy_script.sh; fi
|
||||||
on:
|
on:
|
||||||
php: '7.0'
|
all_branches: true
|
||||||
- stage: deploy-release
|
php: '7.0'
|
||||||
|
- stage: release
|
||||||
script: skip
|
script: skip
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
|
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
|
||||||
@@ -54,6 +55,6 @@ jobs:
|
|||||||
file_glob: true
|
file_glob: true
|
||||||
file: build/*
|
file: build/*
|
||||||
on:
|
on:
|
||||||
tags: true
|
tags: true
|
||||||
repo: nabeelio/phpvms
|
repo: nabeelio/phpvms
|
||||||
php: '7.0'
|
php: '7.0'
|
||||||
|
|||||||
@@ -2,26 +2,28 @@
|
|||||||
|
|
||||||
if [ "$TRAVIS" = "true" ]; then
|
if [ "$TRAVIS" = "true" ]; then
|
||||||
|
|
||||||
|
cd $TRAVIS_BUILD_DIR
|
||||||
|
|
||||||
if test "$TRAVIS_TAG"; then
|
if test "$TRAVIS_TAG"; then
|
||||||
PKG_NAME=$TRAVIS_TAG
|
PKG_NAME=$TRAVIS_TAG
|
||||||
else
|
else
|
||||||
PKG_NAME=v7.0.0-$TRAVIS_BRANCH
|
BASE_VERSION=`php artisan phpvms:version --base-only`
|
||||||
|
PKG_NAME=$BASE_VERSION-$TRAVIS_BRANCH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILE_NAME="phpvms-$PKG_NAME"
|
FILE_NAME="phpvms-$PKG_NAME"
|
||||||
TAR_NAME="$FILE_NAME.tar.gz"
|
TAR_NAME="$FILE_NAME.tar.gz"
|
||||||
echo "Writing $TAR_NAME"
|
echo "Writing $TAR_NAME"
|
||||||
|
|
||||||
cd $TRAVIS_BUILD_DIR
|
|
||||||
|
|
||||||
php artisan phpvms:version --write > VERSION
|
php artisan phpvms:version --write > VERSION
|
||||||
VERSION=`cat VERSION`
|
VERSION=`cat VERSION`
|
||||||
echo "Version: $VERSION"
|
echo "Version: $VERSION"
|
||||||
|
|
||||||
echo "Cleaning files"
|
echo "Cleaning files"
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
rm -rf env.php
|
rm -rf env.php config.php
|
||||||
find ./vendor -type d -name ".git" -print0 | xargs rm -rf
|
find ./vendor -type d -name ".git" -print0 | xargs rm -rf
|
||||||
find . -type d -name "sass-cache" -print0 | xargs rm -rf
|
find . -type d -name "sass-cache" -print0 | xargs rm -rf
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use Symfony\Component\Yaml\Yaml;
|
|||||||
|
|
||||||
class Version extends BaseCommand
|
class Version extends BaseCommand
|
||||||
{
|
{
|
||||||
protected $signature = 'phpvms:version {--write}';
|
protected $signature = 'phpvms:version {--write} {--base-only}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the version number that gets written out
|
* Create the version number that gets written out
|
||||||
@@ -31,20 +31,27 @@ class Version extends BaseCommand
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
$version_file = config_path('version.yml');
|
||||||
|
$cfg = Yaml::parse(file_get_contents($version_file));
|
||||||
|
|
||||||
if($this->option('write')) {
|
if($this->option('write')) {
|
||||||
$version_file = config_path('version.yml');
|
|
||||||
|
|
||||||
$cfg = Yaml::parse(file_get_contents($version_file));
|
|
||||||
|
|
||||||
$version = $this->createVersionNumber($cfg);
|
$version = $this->createVersionNumber($cfg);
|
||||||
$cfg['build']['number'] = $version;
|
$cfg['build']['number'] = $version;
|
||||||
|
|
||||||
file_put_contents($version_file, Yaml::dump($cfg, 4, 2));
|
file_put_contents($version_file, Yaml::dump($cfg, 4, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->call('version:show', [
|
# Only show the major.minor.patch version
|
||||||
'--format' => 'compact',
|
if($this->option('base-only')) {
|
||||||
'--suppress-app-name' => true
|
$version = 'v'.$cfg['current']['major'] . '.'
|
||||||
]);
|
.$cfg['current']['minor'] . '.'
|
||||||
|
.$cfg['current']['patch'];
|
||||||
|
|
||||||
|
print $version;
|
||||||
|
} else {
|
||||||
|
$this->call('version:show', [
|
||||||
|
'--format' => 'compact',
|
||||||
|
'--suppress-app-name' => true
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user