Skip to content
This repository was archived by the owner on May 2, 2018. It is now read-only.

Commit 06c82b7

Browse files
committedJul 19, 2011
Refactored build tools to resemble a more standard Drupal install profile.
1 parent 9031db1 commit 06c82b7

File tree

4 files changed

+43
-22
lines changed

4 files changed

+43
-22
lines changed
 

‎.gitignore

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
*.py[co]
2-
settings.py
32

43
# Ignore the product of a make.
5-
build/ding
6-
build/previous
7-
build/latest
4+
/build
5+
/libraries
6+
/modules
7+
/themes
8+

‎README.markdown

+21-4
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@ Go through the following steps:
4040
1. Get a version of the ding-deploy package by either
4141
* Cloning the repository from GitHub
4242
* Downloading a tagged version which corresponds to a Ding release and unpack it
43-
2. Open a console and navigate to the `ding-deploy/build` directory
44-
3. Run `python ding_build [options] [installation path]`. The options include
43+
2. Open a console and navigate to the `ding-deploy` directory
44+
3. Run `python ding_build.py [options] [installation path]`.
45+
46+
If you run `python ding_build.py` without additional parameters, a full
47+
site will be built for you in the `ding-deploy/build/ding` folder.
48+
49+
The options include
4550
* `-d`: **Debug**. Required if you want to track the build progress
4651
* `-D`: **Developer copy**. Build developer copy, using authenticated Git repositories.
4752
* `-m MODE`: **Build mode**. Use 'site' for full Drupal site, 'profile' for just the installation profile. Default is 'site'.
53+
4854
4. Wait. The build process should take ~5 minutes.
4955
5. *Optional* - download a translation:
5056
1. Navigate to your installation path
@@ -64,8 +70,19 @@ Go through the following steps:
6470
Downloading a local installation
6571
--------------------------------
6672

67-
If you want to get a local installation up and running quickly or do not have access to the developer tools mentioned above you can [download a build of Ding from GitHub](http://github.com/dingproject/ding-deploy/downloads).
73+
If you want to get a local installation up and running quickly or do not have access to the developer tools mentioned above you can [download a build of Ding from GitHub](http://github.com/dingproject/ding-deploy/downloads).
6874

6975
If you choose to download a release you can skip straight to step 6 in the walkthrough above.
7076

71-
The list of downloads should contain builds of all our releases since 1.1.1.
77+
The list of downloads should contain builds of all our releases since 1.1.1.
78+
79+
Simple developer site
80+
---------------------
81+
82+
It is also possible to use this Git repository as a standard Drupal
83+
install profile without our special Python build script.
84+
85+
If you want to take this approach, simply check out this folder in your
86+
`drupal/profiles` folder and run
87+
`drush make --no-core --contrib-destination=. ding.make` within it.
88+

‎ding_build.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ def setup_profile(options, make_path):
104104

105105
shutil.copy('ding.profile', path)
106106

107-
def create_symlinks(options, make_path):
107+
def create_symlinks(options, folder_name):
108108
"""
109109
Set up symlinks to latest and previous build.
110110
"""
111111
if options.symlink_prefix:
112-
latest = '%s-latest' % options.symlink_prefix
113-
previous = '%s-previous' % options.symlink_prefix
112+
latest = 'build/%s-latest' % options.symlink_prefix
113+
previous = 'build/%s-previous' % options.symlink_prefix
114114
else:
115-
latest = 'latest'
116-
previous = 'previous'
115+
latest = 'build/latest'
116+
previous = 'build/previous'
117117

118118
# Revome previous symlink, if it exists.
119119
if os.path.lexists(previous):
@@ -124,25 +124,28 @@ def create_symlinks(options, make_path):
124124
os.rename(latest, previous)
125125

126126
# Set up a link from our completed build to the new one.
127-
os.symlink(make_path, latest)
127+
os.symlink(folder_name, latest)
128+
128129

129130
def main():
130131
""" Main function, run when the script is run stand-alone. """
131132
(options, args) = parse_args()
132133
configure_logging(options)
133134

134-
if args:
135-
make_path = args[-1]
136-
else:
137-
make_path = 'ding'
135+
try:
136+
folder_name = args[-1]
137+
except IndexError:
138+
folder_name = 'ding'
139+
140+
make_path = 'build/%s' % folder_name
138141

139142
logging.info('Starting make for mode "%s" in folder "%s"' % (options.mode, make_path))
140143
success = start_make(make_command(options, make_path))
141144

142145
if success:
143146
setup_profile(options, make_path)
144147
if options.create_symlinks:
145-
create_symlinks(options, make_path)
148+
create_symlinks(options, folder_name)
146149
else:
147150
logging.error('Build FAILED for mode "%s" in folder "%s"' % (options.mode, make_path))
148151

‎fabfile.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ def deploy(project=None, commit=None):
110110
)
111111

112112
make_path = time.strftime('ding-%Y%m%d%H%M')[:-1]
113-
cwd = os.path.join(env.build_path, env.project, 'build')
114-
abs_make_path = os.path.join(cwd, make_path)
113+
profile_path = os.path.join(env.build_path, env.project)
114+
abs_make_path = os.path.join(profile_path, 'build', make_path)
115115

116-
with cd(cwd):
116+
with cd(profile_path):
117117
# Update git checkout.
118118
run('git fetch')
119119
run('git checkout %s' % commit)

0 commit comments

Comments
 (0)
This repository has been archived.