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
Lisa Casino
slapos.package
Commits
4bbf1385
Commit
4bbf1385
authored
Jun 14, 2013
by
Vivien Alger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finally pinpointed the true problem, missed a fi
parent
14eed090
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
101 deletions
+19
-101
prepare_slapos_build.sh
prepare_slapos_build.sh
+15
-7
templates/re6stnet.sh
templates/re6stnet.sh
+4
-3
templates/rpm/slapos.spec.base.in
templates/rpm/slapos.spec.base.in
+0
-78
templates/rpm/slapos.spec.end.in
templates/rpm/slapos.spec.end.in
+0
-13
No files found.
prepare_slapos_build.sh
View file @
4bbf1385
...
...
@@ -43,8 +43,16 @@ function spec_generation
sed
$VERSION_REGEX
$RPM_DIRECTORY
/slapos.spec.base.in
>
$SLAPOS_SPEC
# Scriplet insertion
# cat $RE6STNET_SCRIPT >> $SLAPOS_SPEC
# cat $RPM_DIRECTORY/slapos.spec.end.in >> $SLAPOS_SPEC
echo
"%post"
>>
$SLAPOS_SPEC
cat
$RE6STNET_SCRIPT
>>
$SLAPOS_SPEC
cat
$RPM_DIRECTORY
/post.sh
>>
$SLAPOS_SPEC
echo
"%preun"
>>
$SLAPOS_SPEC
cat
$RPM_DIRECTORY
/preun.sh
>>
$SLAPOS_SPEC
echo
"%postun"
>>
$SLAPOS_SPEC
cat
$RPM_DIRECTORY
/postun.sh
>>
$SLAPOS_SPEC
}
function
prepare_deb_packaging
...
...
@@ -110,22 +118,22 @@ if [ ! -d "$CURRENT_DIRECTORY/$SLAPOS_DIRECTORY" ]; then
fi
# Prepare Makefile and offline script
prepare_template_files
#
prepare_template_files
# Prepare Download Cache for SlapOS
prepare_download_cache
#
prepare_download_cache
# Prepare tarball
prepare_tarball
#
prepare_tarball
# Generate spec file
spec_generation
# Prepare deb packaging
prepare_deb_packaging
#
prepare_deb_packaging
# Upload to obs
obs_upload
#
obs_upload
# Save current version
echo
"
$RECIPE_VERSION
"
>
$CURRENT_DIRECTORY
/slapos-recipe-version
...
...
templates/re6stnet.sh
View file @
4bbf1385
SLAPOS_CFG_PATH
=
/etc/opt/slapos/slapos.cfg
function
re6st_conf_generation
()
re6st_conf_generation
()
{
# Generate re6st configuration
read
-p
"Please enter the registry you wish to use for re6st[http://re6stnet.nexedi.com]: "
REGISTRY
...
...
@@ -12,7 +12,7 @@ function re6st_conf_generation()
effect"
}
function
remove_VPN_conf
()
remove_VPN_conf
()
{
# Remove VPN configuration
if
[
-e
/etc/openvpn/vifib.conf
]
;
then
...
...
@@ -27,7 +27,7 @@ function remove_VPN_conf()
fi
}
function
modify_interfaces_in_SlapOS_conf
()
modify_interfaces_in_SlapOS_conf
()
{
# Modify slapos.cfg to use lo
cp
$SLAPOS_CFG_PATH
$SLAPOS_CFG_PATH
.old
...
...
@@ -60,4 +60,5 @@ if [ -e $SLAPOS_CFG_PATH ]; then
echo
"You seem to have no separate interface for ipv6, please proceed
\
with the configuration of re6st and SlapOS Node by yourself."
fi
fi
fi
templates/rpm/slapos.spec.base.in
View file @
4bbf1385
...
...
@@ -93,81 +93,3 @@ mkdir -p $RPM_BUILD_ROOT/opt/slapos/log
%files
/
%defattr(-,root,root)
%post
SLAPOS_CFG_PATH=/etc/opt/slapos/slapos.cfg
function re6st_conf_generation()
{
# Generate re6st configuration
read -p "Please enter the registry you wish to use for re6st[http://re6stnet.nexedi.com]: " REGISTRY
REGISTRY=${REGISTRY:-http://re6stnet.nexedi.com}
read -p "Please enter your email for token generation: " EMAIL
re6st-conf --registry $REGISTRY --email $EMAIL -r emailAddress $EMAIL -d /etc/re6stnet
echo "File /etc/re6stnet/re6stnet.conf generated"
echo "You now need to reboot your server manually for the changes to take\
effect"
}
function remove_VPN_conf()
{
# Remove VPN configuration
if [ -e /etc/openvpn/vifib.conf ]; then
rm /etc/openvpn/vifib.conf
rm -Rf /etc/openvpn/vifib-keys
echo "Removed vifib OpenVPN configuration files"
fi
if [ -e /etc/opt/slapos/openvpn-needed ]; then
rm /etc/opt/slapos/openvpn-needed
echo "Removed /etc/opt/slapos/openvpn-needed"
fi
}
function modify_interfaces_in_SlapOS_conf()
{
# Modify slapos.cfg to use lo
cp $SLAPOS_CFG_PATH $SLAPOS_CFG_PATH.old
echo "Copied old slapos.cfg to $SLAPOS_CFG_PATH.old"
sed 's/\(interface_name =\).*/\1 lo/g' $SLAPOS_CFG_PATH.old > $SLAPOS_CFG_PATH.tmp
sed 's/.*ipv6_interface =.*//g' $SLAPOS_CFG_PATH.tmp > $SLAPOS_CFG_PATH
rm $SLAPOS_CFG_PATH.tmp
}
#XXX Vivien: fugly logic, feel free to modify it if you can do better
# or if install/upgrade procedure was simplified
if [ -e $SLAPOS_CFG_PATH ]; then
# In case of an upgrade test for native ipv6 inside slapos.cfg
if grep -qe "ipv6_interface" $SLAPOS_CFG_PATH && ! grep -qe "#ipv6_interface" $SLAPOS_CFG_PATH; then
# If using vifib VPN
remove_VPN_conf
modify_interfaces_in_SlapOS_conf
re6st_conf_generation
elif [ ! -e /etc/re6stnet/re6stnet.conf ]; then
if grep -qe "interface_name = lo" $SLAPOS_CFG_PATH; then
# New node with new configuration case
re6st_conf_generation
else
# Manual configuration by user before upgrade
echo "You seem to have no separate interface for ipv6, please proceed \
with the configuration of re6st and SlapOS Node by yourself."
fi
fi
echo """To generate slapos configuration run '#slapos node register'"""
if [ -f /bin/systemctl ]; then
systemctl enable slapos-node.service
systemctl start slapos-node.service
fi
%preun
if [ -f /bin/systemctl ]; then
systemctl stop slapos-node.service
fi
%postun
if [ -f /bin/systemctl ]; then
systemctl restart slapos-node.service
fi
templates/rpm/slapos.spec.end.in
deleted
100644 → 0
View file @
14eed090
echo """To generate slapos configuration run '#slapos node register'"""
if [ -f /bin/systemctl ]; then
systemctl enable slapos-node.service
systemctl start slapos-node.service
fi
%preun
if [ -f /bin/systemctl ]; then
systemctl stop slapos-node.service
fi
%postun
if [ -f /bin/systemctl ]; then
systemctl restart slapos-node.service
fi
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