Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
79476eca
Commit
79476eca
authored
Mar 26, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a post-install script that points the link to the correct revision
parent
e5dba8c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
6 deletions
+32
-6
rakefile
+32
-6
No files found.
rakefile
View file @
79476eca
require
'rake/clean'
require
'tempfile'
# Build Constants
REPO_ROOT
=
File
.
dirname
(
__FILE__
)
BUILD_DIR
=
File
.
join
(
REPO_ROOT
,
"build"
)
# Packaging constants
DEPLOY_DIR
=
"/opt/wwc"
PACKAGE_NAME
=
"mitx"
LINK_PATH
=
File
.
join
(
DEPLOY_DIR
,
PACKAGE_NAME
)
VERSION
=
"0.1"
# Set up the clean and clobber tasks
CLOBBER
.
include
(
'build'
)
CLEAN
.
include
(
"
#{
BUILD_DIR
}
/*.deb"
)
CLEAN
.
include
(
"
#{
BUILD_DIR
}
/*.deb"
,
"
#{
BUILD_DIR
}
/util"
)
task
:package
do
commit
=
(
ENV
[
"GIT_COMMIT"
]
||
`git rev-parse HEAD`
).
chomp
()
...
...
@@ -13,20 +22,37 @@ task :package do
build_number
=
(
ENV
[
"BUILD_NUMBER"
]
||
"dev"
).
chomp
()
if
branch
==
"master"
package_name
=
"mitx
"
deploy_name
=
"
#{
PACKAGE_NAME
}
-
#{
commit
}
"
else
package_name
=
"mitx-
#{
branch
}
"
deploy_name
=
"
#{
PACKAGE_NAME
}
-
#{
branch
}
-
#{
commit
}
"
end
INSTALL_DIR_PATH
=
File
.
join
(
DEPLOY_DIR
,
deploy_name
)
FileUtils
.
mkdir_p
(
BUILD_DIR
)
Dir
.
chdir
(
BUILD_DIR
)
do
postinstall
=
Tempfile
.
new
(
'postinstall'
)
postinstall
.
write
<<-
POSTINSTALL
.
gsub
(
/^\s*/
,
''
)
#! /bin/sh
set -e
set -x
service gunicorn stop
rm
#{
LINK_PATH
}
ln -s
#{
INSTALL_DIR_PATH
}
#{
LINK_PATH
}
service gunicorn start
POSTINSTALL
postinstall
.
close
()
FileUtils
.
chmod
(
0755
,
postinstall
.
path
)
args
=
[
"fakeroot"
,
"fpm"
,
"-s"
,
"dir"
,
"-t"
,
"deb"
,
"--exclude=build"
,
"--exclude=rakefile"
,
"--exclude=.git"
,
"--exclude=**/*.pyc"
,
"--prefix=/opt/wwc/mitx-
#{
commit
}
"
,
"--after-install=
#{
postinstall
.
path
}
"
,
"--prefix=
#{
INSTALL_DIR_PATH
}
"
,
"-C"
,
"
#{
REPO_ROOT
}
"
,
"--depends=python-mysqldb"
,
"--depends=python-django"
,
...
...
@@ -42,8 +68,8 @@ task :package do
"--depends=python-markdown"
,
"--depends=python-pygments"
,
"--depends=mysql-client"
,
"--name=
#{
package_name
}
-
#{
commit
}
"
,
"--version=
0.1
"
,
"--name=
#{
deploy_name
}
"
,
"--version=
#{
VERSION
}
"
,
"--iteration=
#{
build_number
}
"
,
"-a"
,
"all"
,
"."
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment