From a330a889bf87bccaf2871fa9cf0ddfc43dbed063 Mon Sep 17 00:00:00 2001 From: Jonathan DeLaigle Date: Tue, 17 Nov 2015 09:39:06 -0500 Subject: [PATCH 1/4] This reverts commit 2c73394f47b439e6a65b405b14f141e05b93a0a0. Proposed way of building profiles on probo. --- .probo.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.probo.yaml b/.probo.yaml index c5ccc04..17356ad 100644 --- a/.probo.yaml +++ b/.probo.yaml @@ -1,8 +1,9 @@ steps: - - name: Make and install Bear - plugin: Drupal - makeFile: build-bear.make - profileName: bear - runInstall: true - - name: Run behat tests - command: 'cd /var/www/html/profiles/bear/tests ; composer install ; ./bin/behat --profile probo --tags "~@javascript"' + - name: Create full make file + command: 'cd $SRC_DIR ; cat drupal-org.make >> drupal-org-core.make' + - name: Run make + command: 'cd $SRC_DIR ; drush make drupal-org-core.make /var/www/html' + - name: Sync code in place + command: 'cp -r $SRC_DIR /var/www/html/profiles/bear' + - name: Run install + command: "drush site-install --root=/var/www/html bear --db-url='mysqli://root:strongpassword@localhost/bear'" From 5647a4e6114f739046088f7a67cb596d4926dcc9 Mon Sep 17 00:00:00 2001 From: Jonathan DeLaigle Date: Tue, 17 Nov 2015 11:09:37 -0500 Subject: [PATCH 2/4] Trying second style --- .probo.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.probo.yaml b/.probo.yaml index 17356ad..a0cb590 100644 --- a/.probo.yaml +++ b/.probo.yaml @@ -1,8 +1,8 @@ steps: - - name: Create full make file - command: 'cd $SRC_DIR ; cat drupal-org.make >> drupal-org-core.make' + - name: Run core make + command: 'cd $SRC_DIR ; drush make drupal-org-core.make /var/www/html -y' - name: Run make - command: 'cd $SRC_DIR ; drush make drupal-org-core.make /var/www/html' + command: 'cd $SRC_DIR ; drush make --no-core --contrib-destination=. drupal-org.make . -y' - name: Sync code in place command: 'cp -r $SRC_DIR /var/www/html/profiles/bear' - name: Run install From 6b33934e48634db7709e67cb5fd028d26dfc3bab Mon Sep 17 00:00:00 2001 From: Jonathan DeLaigle Date: Tue, 17 Nov 2015 11:27:03 -0500 Subject: [PATCH 3/4] Fixing format --- .probo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.probo.yaml b/.probo.yaml index a0cb590..8b5e615 100644 --- a/.probo.yaml +++ b/.probo.yaml @@ -2,7 +2,7 @@ steps: - name: Run core make command: 'cd $SRC_DIR ; drush make drupal-org-core.make /var/www/html -y' - name: Run make - command: 'cd $SRC_DIR ; drush make --no-core --contrib-destination=. drupal-org.make . -y' + command: 'cd $SRC_DIR ; drush make --no-core --contrib-destination=. drupal-org.make . -y' - name: Sync code in place command: 'cp -r $SRC_DIR /var/www/html/profiles/bear' - name: Run install From 5c9e45a916c6c92e4dde9434e29c16bd9d9524dd Mon Sep 17 00:00:00 2001 From: Jonathan DeLaigle Date: Wed, 18 Nov 2015 14:56:35 -0500 Subject: [PATCH 4/4] Testing new bash script --- .probo.yaml | 10 ++++------ profile-build.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 6 deletions(-) create mode 100755 profile-build.sh diff --git a/.probo.yaml b/.probo.yaml index 8b5e615..605ac23 100644 --- a/.probo.yaml +++ b/.probo.yaml @@ -1,9 +1,7 @@ steps: - - name: Run core make - command: 'cd $SRC_DIR ; drush make drupal-org-core.make /var/www/html -y' - - name: Run make - command: 'cd $SRC_DIR ; drush make --no-core --contrib-destination=. drupal-org.make . -y' - - name: Sync code in place - command: 'cp -r $SRC_DIR /var/www/html/profiles/bear' + - 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"' diff --git a/profile-build.sh b/profile-build.sh new file mode 100755 index 0000000..009aba5 --- /dev/null +++ b/profile-build.sh @@ -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