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
c61c6425
Commit
c61c6425
authored
Mar 27, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a publish task that pushes rpms to gp
parent
e99e5b36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
rakefile
+19
-18
No files found.
rakefile
View file @
c61c6425
...
...
@@ -10,24 +10,25 @@ DEPLOY_DIR = "/opt/wwc"
PACKAGE_NAME
=
"mitx"
LINK_PATH
=
File
.
join
(
DEPLOY_DIR
,
PACKAGE_NAME
)
VERSION
=
"0.1"
COMMIT
=
(
ENV
[
"GIT_COMMIT"
]
||
`git rev-parse HEAD`
).
chomp
()
BRANCH
=
(
ENV
[
"GIT_BRANCH"
]
||
`git symbolic-ref -q HEAD`
).
chomp
().
gsub
(
'refs/heads/'
,
''
).
gsub
(
'origin/'
,
''
).
gsub
(
'/'
,
'_'
)
BUILD_NUMBER
=
(
ENV
[
"BUILD_NUMBER"
]
||
"dev"
).
chomp
()
if
BRANCH
==
"master"
DEPLOY_NAME
=
"
#{
PACKAGE_NAME
}
-
#{
COMMIT
}
"
else
DEPLOY_NAME
=
"
#{
PACKAGE_NAME
}
-
#{
BRANCH
}
-
#{
COMMIT
}
"
end
INSTALL_DIR_PATH
=
File
.
join
(
DEPLOY_DIR
,
DEPLOY_NAME
)
PACKAGE_REPO
=
"packages@gp.mitx.mit.edu:/opt/pkgrepo.incoming"
# Set up the clean and clobber tasks
CLOBBER
.
include
(
'build'
)
CLEAN
.
include
(
"
#{
BUILD_DIR
}
/*.deb"
,
"
#{
BUILD_DIR
}
/util"
)
task
:package
do
commit
=
(
ENV
[
"GIT_COMMIT"
]
||
`git rev-parse HEAD`
).
chomp
()
branch
=
(
ENV
[
"GIT_BRANCH"
]
||
`git symbolic-ref -q HEAD`
).
chomp
()
branch
=
branch
.
gsub
(
'refs/heads/'
,
''
).
gsub
(
'origin/'
,
''
).
gsub
(
'/'
,
'_'
)
build_number
=
(
ENV
[
"BUILD_NUMBER"
]
||
"dev"
).
chomp
()
if
branch
==
"master"
deploy_name
=
"
#{
PACKAGE_NAME
}
-
#{
commit
}
"
else
deploy_name
=
"
#{
PACKAGE_NAME
}
-
#{
branch
}
-
#{
commit
}
"
end
INSTALL_DIR_PATH
=
File
.
join
(
DEPLOY_DIR
,
deploy_name
)
task
:package
do
FileUtils
.
mkdir_p
(
BUILD_DIR
)
Dir
.
chdir
(
BUILD_DIR
)
do
...
...
@@ -47,10 +48,6 @@ task :package do
FileUtils
.
chmod
(
0755
,
postinstall
.
path
)
args
=
[
"fakeroot"
,
"fpm"
,
"-s"
,
"dir"
,
"-t"
,
"deb"
,
"--exclude=build"
,
"--exclude=rakefile"
,
"--exclude=.git"
,
"--exclude=**/*.pyc"
,
"--after-install=
#{
postinstall
.
path
}
"
,
"--prefix=
#{
INSTALL_DIR_PATH
}
"
,
"-C"
,
"
#{
REPO_ROOT
}
"
,
...
...
@@ -68,11 +65,15 @@ task :package do
"--depends=python-markdown"
,
"--depends=python-pygments"
,
"--depends=mysql-client"
,
"--name=
#{
deploy_name
}
"
,
"--name=
#{
DEPLOY_NAME
}
"
,
"--version=
#{
VERSION
}
"
,
"--iteration=
#{
build_number
}
"
,
"--iteration=
#{
BUILD_NUMBER
}
"
,
"-a"
,
"all"
,
"."
]
system
(
*
args
)
||
raise
(
"fpm failed to build the .deb"
)
end
end
task
:publish
=>
:package
do
sh
(
"scp
#{
BUILD_DIR
}
/
#{
DEPLOY_NAME
}
_
#{
VERSION
}
-
#{
BUILD_NUMBER
}
_all.deb
#{
PACKAGE_REPO
}
"
)
end
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