Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .probo.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
steps:
- name: Make and install Bear
plugin: Drupal
makeFile: build-bear.make
profileName: bear
runInstall: true
- name: Run the profile script
command: './$SRC_DIR/profile-build.sh'
- name: Run install
command: "drush site-install --root=/var/www/html bear --db-url='mysqli://root:strongpassword@localhost/bear'"
- name: Run behat tests
command: 'cd /var/www/html/profiles/bear/tests ; composer install ; ./bin/behat --profile probo --tags "~@javascript"'
41 changes: 41 additions & 0 deletions profile-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

PROFILE_NAME='bear'
MAKE_FILE=''
SRC_DIR='/src'
DESTINATION='/var/www/html'

function checkMakeFile() {
# Matches the following:
# projects[bear]
# projects[] = 'bear'
# projects[] = "bear"
# projects[] = bear
# projects[]=bear
if grep "\[$PROFILE_NAME\]" $1 > /dev/null || grep "['\"]\?$PROFILE_NAME['\"]\?$" $1 > /dev/null; then
echo 'Error: Project should not be listed in make file.' >&2
exit 1
fi
return
}

if [ "$SRC_DIR/$MAKE_FILE" != '' ] && [ -f "$SRC_DIR/$MAKE_FILE" ]; then
checkMakeFile "$SRC_DIR/$MAKE_FILE"

drush make "$SRC_DIR/$MAKE_FILE" $DESTINATION
elif [ -f "$SRC_DIR/drupal-org-core.make" ] && [ -f "$SRC_DIR/drupal-org.make" ]; then
checkMakeFile "$SRC_DIR/drupal-org-core.make"
checkMakeFile "$SRC_DIR/drupal-org.make"

drush make "$SRC_DIR/drupal-org-core.make" $DESTINATION
cd $SRC_DIR
drush make "drupal-org.make" --contrib-destination=. --no-core . -y
cd -
fi

if [ ! -d "$DESTINATION/profiles/$PROFILE_NAME" ]; then
cp -r $SRC_DIR "$DESTINATION/profiles/$PROFILE_NAME"
else
echo 'Error: Unable to copy profile to destination because it already exists.' >&2
exit 1
fi