Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Szymanski committed Jun 20, 2019
2 parents 2718366 + 16779ba commit 328464b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Things change, people change, everything changes.

## [0.3.0](https://github.com/elfacht/craft-deploy/compare/0.2.0...0.3.0) - 2019-06-20
### Added
- Added `set -e` to exit if any command fails.
### Changed
- Moved `./craft migrate/all` and `./craft project-config/sync` to `composer install` statement.

## [0.2.0](https://github.com/elfacht/craft-deploy/compare/0.1.2...0.2.0) - 2019-06-19
### Changed
- Moved `./craft migrate/all` and `./craft project-config/sync` to `deploy.sh`.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Following files and folders must be added to `.gitignore` to make the symlinks w

## Important

This script is still beta. Please use it carefully and not on large and heavy prjects. Or do, whatever, your call.
This script is still beta. Please use it carefully and not on large and heavy projects. Or do, whatever, your call.

## What does it do?

Expand All @@ -41,9 +41,9 @@ Creates the necessary `releases`, `shared` and `shared/web` folders on the serve
- Clones your git repo into this folder.
- Runs `composer install` to install Craft CMS.
- Creates symlinks for shared folders and files.
- Runs `./craft migrate/all` and `./craft project-config/sync`.
- Creates a symlink from the `current` folder to the newest release.
- Deletes old releases and keeps max. 5 releases.
- Runs `./craft migrate/all` and `./craft project-config/sync` after release is created.

### gitlab-webhook-push.php

Expand Down
35 changes: 21 additions & 14 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,13 @@ fi
# - Git repo URL
# - Assets directory name (web/[ASSETS_DIR])
#######################################
GIT_REPO="git@gitlab.com:elfacht/craftdeploy.git"
ASSETS_DIR="uploads"
GIT_REPO="[GIT_REPO_URL]"
ASSETS_DIR="[ASSETS_DIR]"

#######################################
# Exit if any command fails
#######################################
set -e

#######################################
# Set timestamp as realease folder name.
Expand Down Expand Up @@ -211,7 +216,10 @@ fi
#######################################
if composer install
then
### Create symlinks
#######################################
# Create symlinks of shared files
# and folders.
#######################################
printf -- "- Create symlinks .."
DONE=0;
while [ $DONE -eq 0 ]; do
Expand All @@ -227,7 +235,16 @@ then
done
printf -- ' DONE!\n';

### Symlink current release
#######################################
# Run Craft CMS migration and project
# sync command.
#######################################
php ../craft migrate/all
php ../craft project-config/sync

#######################################
# Symlink current release
#######################################
cd "../../../"
printf -- "- Create release $CURRENT_RELEASE .."
DONE=0;
Expand Down Expand Up @@ -271,13 +288,3 @@ else
cd "../"
rm -rf $CURRENT_RELEASE
fi

#######################################
# Run Craft CMS migration and project
# sync command.
#######################################
if [ -d "./releases/$CURRENT_RELEASE" ]
then
php current/craft migrate/all
php current/craft project-config/sync
fi

0 comments on commit 328464b

Please sign in to comment.