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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
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
Hide 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
RELEASE
=
3
# 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
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
)
"
TEMPLATES_DIRECTORY
=
$CURRENT_DIRECTORY
/templates
SLAPOS_ORGINAL_DIRECTORY
=
slapos-node
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
if
[
!
-d
"
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
"
]
;
then
cp
-r
$CURRENT_DIRECTORY
/
$SLAPOS_ORGINAL_DIRECTORY
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
fi
# Prepare Makefile and offline script
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/
bash offline.sh
||
(
echo
"Impossible to build SlapOS, exiting."
&&
exit
1
)
# Prepare tarball
cd
$CURRENT_DIRECTORY
tar
-czf
$SLAPOS_DIRECTORY
.tar.gz
$SLAPOS_DIRECTORY
################# Prepare obs ###################################
cd
$OBS_DIRECTORY
# Update directory
osc up
# Remove former configuration
osc
rm
-f
$SLAPOS_ORGINAL_DIRECTORY
*
.tar.gz
osc
rm
-f
slapos.spec
# Prepare new tarball
cp
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
.tar.gz
.
osc add
$SLAPOS_DIRECTORY
.tar.gz
# Prepare new specfile
sed
$VERSION_REGEX
$TEMPLATES_DIRECTORY
/slapos.spec.in
>
slapos.spec
osc add slapos.spec
##################### Prepare configuration file for .deb ############
# Add entry to changelog
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
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
$TEMPLATES_DIRECTORY
tar
-czf
debian.tar.gz debian
cd
$OBS_DIRECTORY
cp
$TEMPLATES_DIRECTORY
/debian.tar.gz
.
#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
"
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
}
function
prepare_download_cache
{
cd
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
/slapos/
rm
-rf
build/
bash offline.sh
||
(
echo
"Impossible to build SlapOS, exiting."
&&
exit
1
)
# Go back to starting point
cd
$CURRENT_DIRECTORY
}
function
prepare_tarball
{
tar
-czf
$SLAPOS_DIRECTORY
.tar.gz
$SLAPOS_DIRECTORY
}
function
prepare_deb_packaging
{
# Add entry to changelog
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
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
$TEMPLATES_DIRECTORY
tar
-czf
debian.tar.gz debian
cd
$OBS_DIRECTORY
cp
$TEMPLATES_DIRECTORY
/debian.tar.gz
.
}
function
obs_upload
{
cd
$OBS_DIRECTORY
# Update directory
osc up
# Remove former configuration
osc
rm
-f
$SLAPOS_ORGINAL_DIRECTORY
*
.tar.gz
osc
rm
-f
slapos.spec
# Prepare new tarball
cp
$CURRENT_DIRECTORY
/
$SLAPOS_DIRECTORY
.tar.gz
.
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
echo
"
$RECIPE_VERSION
"
>
$CURRENT_DIRECTORY
/slapos-recipe-version
...
...
slapos-node/template/slapos-node.cron.d
View file @
a7b38850
...
...
@@ -4,7 +4,7 @@ MAILTO=""
#
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
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
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