Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
deploydev fix (#4789)
Browse files Browse the repository at this point in the history
* Adding config file generation as a requirement for index mako generation
* changing build target from all to build in deploydev.sh
* Adding apache target for deploydev build
  • Loading branch information
pakb authored Feb 27, 2019
1 parent 97b0c56 commit 858948f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ user: env .build-artefacts/requirements.timestamp
make appconfig && source $(USER_SOURCE) && make src/config.dev.mako all

.PHONY: build
build: showVariables .build-artefacts/devlibs .build-artefacts/requirements.timestamp $(SRC_JS_FILES) appconfig debug release dist
build: showVariables .build-artefacts/devlibs .build-artefacts/requirements.timestamp $(SRC_JS_FILES) appconfig apache debug release dist


.PHONY: .build-artefacts/nvm-version
Expand Down
23 changes: 10 additions & 13 deletions scripts/deploydev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,34 @@ else
echo "Could not backup the project."
fi

function reset_rootdir_to_previous_state () {
echo $1 1>&2
rm -rf $DEPLOYDIR
mv -f $TEMPDIR $DEPLOYDIR
exit $2
}

if cd $ROOTDIR; then
git clone https://github.com/geoadmin/mf-geoadmin3.git $DEPLOYDIR
else
echo "Could not change directory. Restoring previous project." 1>&2
rm -rf $DEPLOYDIR
mv -f $TEMPDIR $DEPLOYDIR
exit 1
reset_rootdir_to_previous_state "Could not change directory. Restoring previous project." 1
fi

# Create a fresh clone of the project
if cd $DEPLOYDIR; then
# remove all local changes and get latest GITBRANCH from remote
git fetch origin && git reset --hard && git checkout $GITBRANCH && git reset --hard origin/$GITBRANCH
else
echo "Could not change directory. Restoring previous project." 1>&2
rm -rf $DEPLOYDIR
mv -f $TEMPDIR $DEPLOYDIR
exit 1
reset_rootdir_to_previous_state "Could not change directory. Restoring previous project." 1
fi

# build the project
source rc_dev && make cleanall dev

exit_code=$?

if [ "$exit_code" -gt "0" ]
then
echo "Failed to build the app. Restoring previous project." 1>&2
rm -rf $DEPLOYDIR
mv -f $TEMPDIR $DEPLOYDIR
exit $exit_code
reset_rootdir_to_previous_state "Failed to build the app. Restoring previous project." $exit_code
else
echo "Build is successfull. Deleting old project."
rm -rf $TEMPDIR
Expand Down

0 comments on commit 858948f

Please sign in to comment.