Commit 0c627968 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

prepare will fetch last version of obs directory before modifying it

parent 78b366b8
...@@ -10,7 +10,7 @@ SLAPOS_DIRECTORY=slapos-node_$VERSION+$RECIPE_VERSION+0 ...@@ -10,7 +10,7 @@ SLAPOS_DIRECTORY=slapos-node_$VERSION+$RECIPE_VERSION+0
OBS_DIRECTORY=$CURRENT_DIRECTORY/home:VIFIBnexedi:branches:home:VIFIBnexedi/SlapOS-Node 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
...@@ -19,7 +19,7 @@ fi ...@@ -19,7 +19,7 @@ fi
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/Makefile.in > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/Makefile sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/Makefile.in > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/Makefile
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/offline.sh.in > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/offline.sh sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/offline.sh.in > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/offline.sh
# Prepare Download Cache for SlapOS # Prepare Download Cache for SlapOS
cd $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/ cd $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/
#rm -rf build/ #rm -rf build/
bash offline.sh bash offline.sh
...@@ -32,6 +32,9 @@ tar -czf $SLAPOS_DIRECTORY.tar.gz $SLAPOS_DIRECTORY ...@@ -32,6 +32,9 @@ tar -czf $SLAPOS_DIRECTORY.tar.gz $SLAPOS_DIRECTORY
################# Prepare obs ################################### ################# Prepare obs ###################################
cd $OBS_DIRECTORY cd $OBS_DIRECTORY
# Update directory
osc up
# Remove former configuration # Remove former configuration
osc rm -f $SLAPOS_ORGINAL_DIRECTORY*.tar.gz osc rm -f $SLAPOS_ORGINAL_DIRECTORY*.tar.gz
osc rm -f slapos.spec osc rm -f slapos.spec
...@@ -49,18 +52,18 @@ osc add slapos.spec ...@@ -49,18 +52,18 @@ osc add slapos.spec
cd $TEMPLATES_DIRECTORY/debian cd $TEMPLATES_DIRECTORY/debian
dch -pm -v $VERSION+$RECIPE_VERSION+0 --check-dirname-level=0 "New version of slapos ($VERSION+$RECIPE_VERSION)" dch -pm -v $VERSION+$RECIPE_VERSION+0 --check-dirname-level=0 "New version of slapos ($VERSION+$RECIPE_VERSION)"
cd $TEMPLATES_DIRECTORY cd $TEMPLATES_DIRECTORY
tar -czf debian.tar.gz debian tar -czf debian.tar.gz debian
cd $OBS_DIRECTORY cd $OBS_DIRECTORY
cp $TEMPLATES_DIRECTORY/debian.tar.gz . cp $TEMPLATES_DIRECTORY/debian.tar.gz .
#prepare new .dsc file #prepare new .dsc file
osc rm -f slapos*.dsc osc rm -f slapos*.dsc
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/slapos.dsc.in > $SLAPOS_DIRECTORY.dsc sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s/\%VERSION\%/$VERSION/g" $TEMPLATES_DIRECTORY/slapos.dsc.in > $SLAPOS_DIRECTORY.dsc
osc add $SLAPOS_DIRECTORY.dsc osc add $SLAPOS_DIRECTORY.dsc
## Upload new Package ## Upload new Package
osc commit -m " New SlapOS Recipe $RECIPE_VERSION" osc commit -m " New SlapOS Recipe $RECIPE_VERSION"
# Save current version # Save current version
echo "$RECIPE_VERSION" > $CURRENT_DIRECTORY/slapos-recipe-version echo "$RECIPE_VERSION" > $CURRENT_DIRECTORY/slapos-recipe-version
echo "$VERSION" > $CURRENT_DIRECTORY/slapos-version echo "$VERSION" > $CURRENT_DIRECTORY/slapos-version
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment