Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
slapos.package
Commits
a7b38850
Commit
a7b38850
authored
Jan 10, 2014
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into no_tapvpn
parents
8709ea90
807c9ea7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
60 deletions
+80
-60
prepare_slapos_build.sh
prepare_slapos_build.sh
+79
-59
slapos-node/template/slapos-node.cron.d
slapos-node/template/slapos-node.cron.d
+1
-1
No files found.
prepare_slapos_build.sh
View file @
a7b38850
...
@@ -8,79 +8,99 @@ RECIPE_VERSION=0.203
...
@@ -8,79 +8,99 @@ RECIPE_VERSION=0.203
RELEASE
=
3
RELEASE
=
3
# Define URL to compile
# Define URL to compile
#BUILDOUT_URL=http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-$RECIPE_VERSION:/component/slapos/buildout.cfg
BUILDOUT_URL
=
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-
$RECIPE_VERSION
:/component/slapos/buildout.cfg
OBS_DIRECTORY
=
$CURRENT_DIRECTORY
/home:VIFIBnexedi/SlapOS-Node
# Development version of the build
# Development Section [Uncomment for use]
#OBS_DIRECTORY=$CURRENT_DIRECTORY/home:VIFIBnexedi:branches:home:VIFIBnexedi/SlapOS-Node
BUILDOUT_URL
=
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/slapos:/component/slapos/buildout.cfg
BUILDOUT_URL
=
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/slapos:/component/slapos/buildout.cfg
VERSION_REGEX
=
"s!
\%
BUILDOUT_URL
\%
!
$BUILDOUT_URL
!g;s/
\%
RECIPE_VERSION
\%
/
$RECIPE_VERSION
/g;s/
\%
VERSION
\%
/
$VERSION
/g;s/
\%
RELEASE
\%
/
$RELEASE
/g"
VERSION_REGEX
=
"s!
\%
BUILDOUT_URL
\%
!
$BUILDOUT_URL
!g;s/
\%
RECIPE_VERSION
\%
/
$RECIPE_VERSION
/g;s/
\%
VERSION
\%
/
$VERSION
/g;s/
\%
RELEASE
\%
/
$RELEASE
/g"
CURRENT_DIRECTORY
=
"
$(
pwd
)
"
CURRENT_DIRECTORY
=
"
$(
pwd
)
"
TEMPLATES_DIRECTORY
=
$CURRENT_DIRECTORY
/templates
TEMPLATES_DIRECTORY
=
$CURRENT_DIRECTORY
/templates
SLAPOS_ORGINAL_DIRECTORY
=
slapos-node
SLAPOS_ORGINAL_DIRECTORY
=
slapos-node
SLAPOS_DIRECTORY
=
slapos-node_
$VERSION
+
$RECIPE_VERSION
+
$RELEASE
SLAPOS_DIRECTORY
=
slapos-node_
$VERSION
+
$RECIPE_VERSION
+
$RELEASE
# Edit for release
# Stable one
#OBS_DIRECTORY=$CURRENT_DIRECTORY/home:VIFIBnexedi/SlapOS-Node
# Development one
OBS_DIRECTORY
=
$CURRENT_DIRECTORY
/home:VIFIBnexedi:branches:home:VIFIBnexedi/SlapOS-Node
# Prepare directory for new version if needed
# Prepare directory for new version if needed
if
[
!
-d
"
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
"
]
;
then
if
[
!
-d
"
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
"
]
;
then
cp
-r
$CURRENT_DIRECTORY
/
$SLAPOS_ORGINAL_DIRECTORY
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
cp
-r
$CURRENT_DIRECTORY
/
$SLAPOS_ORGINAL_DIRECTORY
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
fi
fi
# Prepare Makefile and offline script
function
prepare_template_files
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/Makefile.in
>
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
/slapos/Makefile
{
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/offline.sh.in
>
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
/slapos/offline.sh
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/Makefile.in
>
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
/slapos/Makefile
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/offline.sh.in
>
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
/slapos/offline.sh
# Prepare Download Cache for SlapOS
}
cd
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
/slapos/
#rm -rf build/
function
prepare_download_cache
bash offline.sh
||
(
echo
"Impossible to build SlapOS, exiting."
&&
exit
1
)
{
cd
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
/slapos/
# Prepare tarball
rm
-rf
build/
cd
$CURRENT_DIRECTORY
bash offline.sh
||
(
echo
"Impossible to build SlapOS, exiting."
&&
exit
1
)
tar
-czf
$SLAPOS_DIRECTORY
.tar.gz
$SLAPOS_DIRECTORY
# Go back to starting point
cd
$CURRENT_DIRECTORY
}
################# Prepare obs ###################################
cd
$OBS_DIRECTORY
function
prepare_tarball
{
# Update directory
tar
-czf
$SLAPOS_DIRECTORY
.tar.gz
$SLAPOS_DIRECTORY
osc up
}
# Remove former configuration
function
prepare_deb_packaging
osc
rm
-f
$SLAPOS_ORGINAL_DIRECTORY
*
.tar.gz
{
osc
rm
-f
slapos.spec
# Add entry to changelog
# Prepare new tarball
cd
$TEMPLATES_DIRECTORY
/debian
cp
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
.tar.gz
.
dch
-pm
-v
$VERSION
+
$RECIPE_VERSION
+
$RELEASE
--check-dirname-level
=
0
"New version of slapos (
$VERSION
+
$RECIPE_VERSION
+
$RELEASE
)"
osc add
$SLAPOS_DIRECTORY
.tar.gz
# Add cron and logrotate files
# Prepare new specfile
cp
$CURRENT_DIRECTORY
/
$SLAPOS_ORGINAL_DIRECTORY
/template/slapos-node.cron.d
$TEMPLATES_DIRECTORY
/debian/cron.d
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/slapos.spec.in
>
slapos.spec
cp
$CURRENT_DIRECTORY
/
$SLAPOS_ORGINAL_DIRECTORY
/template/slapos-node.logrotate
$TEMPLATES_DIRECTORY
/debian/slapos-node.logrotate
osc add slapos.spec
cd
$TEMPLATES_DIRECTORY
tar
-czf
debian.tar.gz debian
##################### Prepare configuration file for .deb ############
cd
$OBS_DIRECTORY
# Add entry to changelog
cp
$TEMPLATES_DIRECTORY
/debian.tar.gz
.
cd
$TEMPLATES_DIRECTORY
/debian
}
dch
-pm
-v
$VERSION
+
$RECIPE_VERSION
+
$RELEASE
--check-dirname-level
=
0
"New version of slapos (
$VERSION
+
$RECIPE_VERSION
+
$RELEASE
)"
# Add cron and logrotate files
function
obs_upload
cp
$CURRENT_DIRECTORY
/
$SLAPOS_ORGINAL_DIRECTORY
/template/slapos-node.cron.d
$TEMPLATES_DIRECTORY
/debian/cron.d
{
cp
$CURRENT_DIRECTORY
/
$SLAPOS_ORGINAL_DIRECTORY
/template/slapos-node.logrotate
$TEMPLATES_DIRECTORY
/debian/slapos-node.logrotate
cd
$OBS_DIRECTORY
cd
$TEMPLATES_DIRECTORY
tar
-czf
debian.tar.gz debian
# Update directory
cd
$OBS_DIRECTORY
osc up
cp
$TEMPLATES_DIRECTORY
/debian.tar.gz
.
#prepare new .dsc file
# Remove former configuration
osc
rm
-f
slapos
*
.dsc
osc
rm
-f
$SLAPOS_ORGINAL_DIRECTORY
*
.tar.gz
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/slapos.dsc.in
>
$SLAPOS_DIRECTORY
.dsc
osc
rm
-f
slapos.spec
osc add
$SLAPOS_DIRECTORY
.dsc
# Prepare new tarball
## Upload new Package
cp
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
.tar.gz
.
osc commit
-m
"New SlapOS Recipe
$RECIPE_VERSION
"
osc add
$SLAPOS_DIRECTORY
.tar.gz
# Prepare new specfile
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/slapos.spec.in
>
slapos.spec
osc add slapos.spec
# Prepare new .dsc file
osc
rm
-f
slapos
*
.dsc
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/slapos.dsc.in
>
$SLAPOS_DIRECTORY
.dsc
osc add
$SLAPOS_DIRECTORY
.dsc
## Upload new Package
osc commit
-m
"New SlapOS Recipe
$RECIPE_VERSION
"
}
prepare_template_files
prepare_download_cache
prepare_tarball
prepare_deb_packaging
obs_upload
# Save current version
# Save current version
echo
"
$RECIPE_VERSION
"
>
$CURRENT_DIRECTORY
/slapos-recipe-version
echo
"
$RECIPE_VERSION
"
>
$CURRENT_DIRECTORY
/slapos-recipe-version
...
...
slapos-node/template/slapos-node.cron.d
View file @
a7b38850
...
@@ -4,7 +4,7 @@ MAILTO=""
...
@@ -4,7 +4,7 @@ MAILTO=""
#
Run
"Installation/Destruction of Software Releases"
and
"Deploy/Start/Stop Partitions"
once
per
minute
#
Run
"Installation/Destruction of Software Releases"
and
"Deploy/Start/Stop Partitions"
once
per
minute
*
*
*
*
*
root
/
opt
/
slapos
/
bin
/
slapos
node
software
--
verbose
--
logfile
=/
opt
/
slapos
/
log
/
slapos
-
node
-
software
.
log
>
/
dev
/
null
2
>&
1
*
*
*
*
*
root
/
opt
/
slapos
/
bin
/
slapos
node
software
--
verbose
--
logfile
=/
opt
/
slapos
/
log
/
slapos
-
node
-
software
.
log
>
/
dev
/
null
2
>&
1
*
*
*
*
*
root
/
opt
/
slapos
/
bin
/
slapos
node
instance
--
verbose
--
logfile
=/
opt
/
slapos
/
log
/
slapos
-
node
-
instance
.
log
>
/
dev
/
null
2
>&
1
*
*
*
*
*
root
/
opt
/
slapos
/
bin
/
slapos
node
instance
--
promise
-
timeout
20
--
verbose
--
logfile
=/
opt
/
slapos
/
log
/
slapos
-
node
-
instance
.
log
>
/
dev
/
null
2
>&
1
#
Run
"Destroy Partitions to be destroyed"
once
per
hour
#
Run
"Destroy Partitions to be destroyed"
once
per
hour
0
*
*
*
*
root
/
opt
/
slapos
/
bin
/
slapos
node
report
--
maximal_delay
=
3600
--
verbose
--
logfile
=/
opt
/
slapos
/
log
/
slapos
-
node
-
report
.
log
>
/
dev
/
null
2
>&
1
0
*
*
*
*
root
/
opt
/
slapos
/
bin
/
slapos
node
report
--
maximal_delay
=
3600
--
verbose
--
logfile
=/
opt
/
slapos
/
log
/
slapos
-
node
-
report
.
log
>
/
dev
/
null
2
>&
1
...
...
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