release should be easy ....
Here are three options on how to achieve this:
use this module:
set:
SS_RELEASE_TOKEN=" ___ HELLO ___ OR SOMETHING LIKE THAT __"
SS_RELEASE_SCRIPT="run.sh"
in your .env
file.
create a release script in the root of your silverstripe project (e.g. run.sh
)
add a hook to bitbucket https://mysite.co.nz/_resources/vendor/sunnysideup/release/client/ReleaseProjectFromBitbucketHook.php?ts=29083w490809suiaiofd78897
bitbucket
user to serverbitbucket-pipelines.yml
pipelines:
branches:
development:
- step:
script:
- ssh -o StrictHostKeyChecking=no [email protected] 'cd ./container/application; bash release.sh'
master:
- step:
script:
- echo "hello"
release.sh
#!/bin/bash
cd "$(dirname "$0")"
echo "=========================" >> release.log
echo "Time: $(date). START UPDATE: " >> release.log
git describe --all --long > release.log
git fetch --all
git pull
composer install --no-dev
vendor/bin/sake dev/build flush=all
bash npm-build-script.sh
git describe --all --long > release.log
OR (with backup)
#!/bin/bash
cd "$(dirname "$0")"
echo "=========================" >> release.log
echo "Time: $(date). START UPDATE: " >> release.log
wget https://silverstripe.github.io/sspak/sspak.phar
chmod +x sspak.phar
rm backup.sspak
php sspak.phar save --db . backup.sspak
git describe --all --long > release.log
git fetch --all
git status
git pull
composer install --no-dev
vendor/bin/sake dev/build flush=all
npm-build-script.sh
git describe --all --long > release.log
npm-build-script.sh
Once you have a release file on the server, you can then also run this locally:
ssh myserver 'cd container/application/; bash release.sh'
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem