Skip to content

Commit 1250470

Browse files
committed
Merge branch 'feature/recursive-make' of github.com:OS2web/os2web-deploy into feature/recursive-make
2 parents 2731da6 + 3db955d commit 1250470

10 files changed

+222
-208
lines changed

README.markdown

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install an OS2web Installation via .make
1212
4. `mv drupal-7.x public_html`
1313
5. `git clone git@github.com:OS2web/os2web-deploy.git -b feature/recursive-make`
1414
6. `cd public_html/profiles`
15-
7. `ln -s ../../os2web-deploy/os2web os2web`
15+
7. `ln -s ../../os2web-deploy/build/master-latest os2web`
1616

1717
Reroll the modules and contrib modules specified in os2web.make:
1818
- `./reroll.core.sh`, `./reroll.turnkey.sh` or `./reroll.dev.sh`
@@ -27,12 +27,13 @@ Overview of the directory map
2727
- `[profiles]`
2828
- `[os2web]` (`symlink ../../os2web-deploy/os2web`)
2929
- `[os2web-deploy]`
30-
- `[os2web]`
31-
- `[modules]`
32-
- `[contrib]`
33-
- `...`
34-
- `[libraries]`
35-
- `[themes]`
30+
- `[build]`
31+
- `[master-lates]`
32+
- `[modules]`
33+
- `[contrib]`
34+
- `...`
35+
- `[libraries]`
36+
- `[themes]`
3637

3738

3839
Configuration of install profile
@@ -43,6 +44,15 @@ Core modules:
4344
- os2web_base
4445
- os2web_settings
4546
- os2web_frontend
47+
- os2web_meetings
48+
- os2web_borger_dk
49+
- os2web_taxonomies
50+
- os2web_taxon_api
51+
- os2web_search
52+
- os2web_selfservicelinks
53+
- os2web_ad_integration
54+
- os2web_kulturnaut_events
55+
- os2web_webform
4656
- - And their dependents
4757

4858
Activated Turnkey modules:

db.sql.gz

-3.94 MB
Binary file not shown.

dump.turnkey.sql.gz

-1.6 MB
Binary file not shown.
File renamed without changes.

os2web.turnkey.profile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function os2web_import_database() {
352352
}
353353

354354
// Import database dump file.
355-
$os2web_file = dirname(__FILE__) . '/os2web/db.sql.gz';
355+
$os2web_file = dirname(__FILE__) . '/db.sql.gz';
356356
$success = import_dump($os2web_file);
357357

358358
if (!$success) {

os2web.turnkey.sql.gz

804 KB
Binary file not shown.

os2web_build.py

Lines changed: 0 additions & 176 deletions
This file was deleted.

reroll.core.sh

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,73 @@
11
#!/bin/sh
2+
DATE=`date +%Y%m%d%H%M`
23

3-
mv os2web old-os2web-`date +%Y%m%d%H%M`
4-
mkdir os2web
4+
# The newly builed dir
5+
BUILD_DIR=master-$DATE
6+
# The previous build dir
7+
BUILD_DIR_PREV=master-previous
8+
# The build dir with latest build
9+
BUILD_DIR_LATEST=master-latest
510

6-
drush make --no-gitinfofile -y --no-core --contrib-destination=os2web os2web.core.make
11+
# The Source Profile name
12+
# This is a special case, where multiple profiles are in same dir.
13+
# [name].install
14+
# [name].profile
15+
# [name].info
16+
PROFILE_SRC=os2web.core
17+
# The destination Profile name
18+
PROFILE_DST=os2web
719

8-
cd os2web
20+
# The root dir of your drupal instance. Used by drush!
21+
DRUPAL_ROOT=$(dirname `pwd`)/public_html
922

10-
ln -s ../os2web.core.info os2web.info
11-
ln -s ../os2web.core.profile os2web.profile
12-
ln -s ../os2web.core.install os2web.install
13-
ln -s ../db.sql.gz db.sql.gz
23+
mkdir build/$BUILD_DIR
24+
25+
drush make --no-gitinfofile -y --no-core --contrib-destination=build/$BUILD_DIR $PROFILE_SRC.make
26+
27+
### Code below can be in seperate file. source execute file from here. ###
28+
# . ./deploy.sh
29+
30+
if [ -d "build/$BUILD_DIR/modules" ]; then
31+
# Drush make completed without errors. If modules doesnt exist, drush make failed.
32+
33+
# Lets copy our drupal profile files
34+
cp $PROFILE_SRC.info build/$BUILD_DIR/$PROFILE_DST.info
35+
cp $PROFILE_SRC.profile build/$BUILD_DIR/$PROFILE_DST.profile
36+
cp $PROFILE_SRC.install build/$BUILD_DIR/$PROFILE_DST.install
37+
cp $PROFILE_SRC.sql.gz build/$BUILD_DIR/db.sql.gz
38+
39+
# Move old build to previous
40+
unlink build/$BUILD_DIR_PREV
41+
mv build/$BUILD_DIR_LATEST build/$BUILD_DIR_PREV
42+
# Make new build the latest
43+
ln -sf $BUILD_DIR build/$BUILD_DIR_LATEST
44+
45+
# Take a copy of the current database,
46+
# and put it in the previous build. Code and database keeps together.
47+
echo "Backing up the database..."
48+
# TODO: skip basic tables like cache --structure-tables-key=#{tables}
49+
# Will make the dump smaller.
50+
drush sql-dump --root=$DRUPAL_ROOT --gzip > build/$BUILD_DIR_PREV/sql-dump.$DATE.sql.gz
51+
52+
echo "Updating database... Site will go in maintenance mode!"
53+
drush --root=$DRUPAL_ROOT vset maintenance_mode 1
54+
drush --root=$DRUPAL_ROOT updb
55+
drush --root=$DRUPAL_ROOT vset maintenance_mode 0
56+
57+
# # Any additionally drush commands?
58+
59+
# Finnally clear the cache
60+
echo "Clearing cache..."
61+
if [ -n "${URI}" ]; then
62+
# Either use URI as a parameter to this script, or hardcode it in the top.
63+
# URI=domain.tld ./reroll.sh
64+
drush --root=$DRUPAL_ROOT --uri=$URI cc all
65+
else
66+
drush --root=$DRUPAL_ROOT cc all
67+
fi
68+
echo "Deploy Complete."
69+
else
70+
# Build failed, remove build
71+
rm -rf build/$BUILD_DIR
72+
echo "Build Failed. Deploy terminated"
73+
fi

reroll.dev.sh

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,73 @@
11
#!/bin/sh
2+
DATE=`date +%Y%m%d%H%M`
23

3-
mv os2web old-os2web-`date +%Y%m%d%H%M`
4-
mkdir os2web
4+
# The newly builed dir
5+
BUILD_DIR=dev-$DATE
6+
# The previous build dir
7+
BUILD_DIR_PREV=dev-previous
8+
# The build dir with latest build
9+
BUILD_DIR_LATEST=dev-latest
510

6-
drush make --no-gitinfofile -y --no-core --contrib-destination=os2web --working-copy os2web.dev.make
11+
# The Source Profile name
12+
# This is a special case, where multiple profiles are in same dir.
13+
# [name].install
14+
# [name].profile
15+
# [name].info
16+
PROFILE_SRC=os2web.turnkey
17+
# The destination Profile name
18+
PROFILE_DST=os2web
719

8-
cd os2web
20+
# The root dir of your drupal instance. Used by drush!
21+
DRUPAL_ROOT=$(dirname `pwd`)/public_html
922

10-
ln -s ../os2web.turnkey.info os2web.info
11-
ln -s ../os2web.turnkey.profile os2web.profile
12-
ln -s ../os2web.turnkey.install os2web.install
13-
ln -s ../dump.turnkey.sql.gz db.sql.gz
23+
mkdir build/$BUILD_DIR
24+
25+
drush make --no-gitinfofile -y --no-core --working-copy --contrib-destination=build/$BUILD_DIR $PROFILE_SRC.dev.make
26+
27+
### Code below can be in seperate file. source execute file from here. ###
28+
# . ./deploy.sh
29+
30+
if [ -d "build/$BUILD_DIR/modules" ]; then
31+
# Drush make completed without errors. If modules doesnt exist, drush make failed.
32+
33+
# Lets copy our drupal profile files
34+
cp $PROFILE_SRC.info build/$BUILD_DIR/$PROFILE_DST.info
35+
cp $PROFILE_SRC.profile build/$BUILD_DIR/$PROFILE_DST.profile
36+
cp $PROFILE_SRC.install build/$BUILD_DIR/$PROFILE_DST.install
37+
cp $PROFILE_SRC.sql.gz build/$BUILD_DIR/db.sql.gz
38+
39+
# Move old build to previous
40+
unlink build/$BUILD_DIR_PREV
41+
mv build/$BUILD_DIR_LATEST build/$BUILD_DIR_PREV
42+
# Make new build the latest
43+
ln -sf $BUILD_DIR build/$BUILD_DIR_LATEST
44+
45+
# Take a copy of the current database,
46+
# and put it in the previous build. Code and database keeps together.
47+
echo "Backing up the database..."
48+
# TODO: skip basic tables like cache --structure-tables-key=#{tables}
49+
# Will make the dump smaller.
50+
drush sql-dump --root=$DRUPAL_ROOT --gzip > build/$BUILD_DIR_PREV/sql-dump.$DATE.sql.gz
51+
52+
echo "Updating database... Site will go in maintenance mode!"
53+
drush --root=$DRUPAL_ROOT vset maintenance_mode 1
54+
drush --root=$DRUPAL_ROOT updb
55+
drush --root=$DRUPAL_ROOT vset maintenance_mode 0
56+
57+
# # Any additionally drush commands?
58+
59+
# Finnally clear the cache
60+
echo "Clearing cache..."
61+
if [ -n "${URI}" ]; then
62+
# Either use URI as a parameter to this script, or hardcode it in the top.
63+
# URI=domain.tld ./reroll.sh
64+
drush --root=$DRUPAL_ROOT --uri=$URI cc all
65+
else
66+
drush --root=$DRUPAL_ROOT cc all
67+
fi
68+
echo "Deploy Complete."
69+
else
70+
# Build failed, remove build
71+
rm -rf build/$BUILD_DIR
72+
echo "Build Failed. Deploy terminated"
73+
fi

0 commit comments

Comments
 (0)