Commit 46525e18 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

Merge remote-tracking branch 'origin/464-create-artefacts-from-pipeline'

parents a14bbe3c f4a6272e
......@@ -3,6 +3,8 @@ stages:
- Stylecheck_doc_stage
- Build_and_test_release_stage
- Build_and_test_debug_stage
- Build_appimage_stage
- Upload_artifacts_stage
create_directory_and_cmake___release:
stage: Initialization_stage
......@@ -10,7 +12,7 @@ create_directory_and_cmake___release:
key: "CacheRelease"
paths:
- build/release
image: ladbukkit/openwalnut_build_environment:1.1.1
image: ladbukkit/openwalnut_build_environment:1.3.1
script:
- ls
- mkdir -p build
......@@ -27,7 +29,7 @@ create_directory_and_cmake___debug:
key: "CacheDebug"
paths:
- build/debug
image: ladbukkit/openwalnut_build_environment:1.1.1
image: ladbukkit/openwalnut_build_environment:1.3.1
script:
- ls
- mkdir -p build
......@@ -44,7 +46,7 @@ stylecheck_job:
key: "CacheRelease"
paths:
- build/release
image: ladbukkit/openwalnut_build_environment:1.1.1
image: ladbukkit/openwalnut_build_environment:1.3.1
script:
- pwd
- cd build/release
......@@ -58,7 +60,7 @@ doc_job:
key: "CacheDebug"
paths:
- build/debug
image: ladbukkit/openwalnut_build_environment:1.1.1
image: ladbukkit/openwalnut_build_environment:1.3.1
script:
- doxygen --version
- pwd
......@@ -73,7 +75,7 @@ buildAndTest:
key: "CacheRelease"
paths:
- build/release
image: ladbukkit/openwalnut_build_environment:1.1.1
image: ladbukkit/openwalnut_build_environment:1.3.1
script:
- pwd
- cd build/release
......@@ -88,7 +90,7 @@ buildAndTestDebug:
key: "CacheDebug"
paths:
- build/debug
image: ladbukkit/openwalnut_build_environment:1.1.1
image: ladbukkit/openwalnut_build_environment:1.3.1
script:
- pwd
- cd build/debug
......@@ -96,3 +98,33 @@ buildAndTestDebug:
- ls
- make -j 8
- make vtest
buildAppImage:
stage: Build_appimage_stage
cache:
key: "CacheAppImage"
paths:
- tools/AppImage/AppImageBuild
image: ladbukkit/openwalnut_build_environment:1.3.1
script:
- pwd
- cd tools/AppImage
- pwd
- ls
- chmod +x appimage.sh
- ./appimage.sh build
uploadArtifacts:
stage: Upload_artifacts_stage
cache:
key: "CacheAppImage"
paths:
- tools/AppImage/AppImageBuild
image: ladbukkit/openwalnut_build_environment:1.3.1
script:
- pwd
- cd tools/upload
- pwd
- ls
- chmod +x seafile.sh
- ./seafile.sh
......@@ -29,7 +29,7 @@ BUILD_DIR=AppImageBuild
Build()
{
echo "* Creating build folder"
mkdir $BUILD_DIR
mkdir -p $BUILD_DIR
cd $BUILD_DIR
echo "* Configure build system"
......@@ -63,21 +63,19 @@ Package()
echo "* Copy AppRun"
cp ../AppRun ./AppDir/AppRun
echo "* Download Packager"
wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -N https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
echo "* Downloading appimagetool"
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
echo "* Packaging"
export LD_LIBRARY_PATH="$(pwd)/AppDir/usr/lib/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
ARCH=x86_64 ./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
-d openwalnut.desktop \
-i ../../../artwork/Icons/openwalnut_128x128.png \
--plugin qt \
--output appimage
ARCH=x86_64 linuxdeploy \
--appdir AppDir \
-d openwalnut.desktop \
-i ../../../artwork/Icons/openwalnut_128x128.png \
--plugin qt
ARCH=x86_64 ./appimagetool-x86_64.AppImage --appimage-extract-and-run ./AppDir
cd ..
}
......@@ -100,6 +98,7 @@ UsageExit()
echo " COMMANDS:"
echo " clean: removes created build sub-directories"
echo " build: does the building and packaging."
echo " package: only packages"
echo ""
exit 2
}
......@@ -112,7 +111,10 @@ case "$1" in
build)
BuildAll || exit $?
;;
package)
Package || exit $?
;;
*)
UsageExit
;;
esac
esac
\ No newline at end of file
#!/bin/bash
#---------------------------------------------------------------------------
#
# Project: OpenWalnut ( http://www.openwalnut.org )
#
# Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
# For more information see http://www.openwalnut.org/copying
#
# This file is part of OpenWalnut.
#
# OpenWalnut is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenWalnut is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
#
#---------------------------------------------------------------------------
DOC_UPLOAD="https://seafile.rlp.net/ajax/u/d/4f71896e2f744c8796fb/upload/?r=b7d1e764-0c95-4b94-aa00-c8c67c869a9a"
APP_UPLOAD="https://seafile.rlp.net/ajax/u/d/39a0552b276f4f0797da/upload/?r=b7d1e764-0c95-4b94-aa00-c8c67c869a9a"
UPLOAD_REGEX="\\{\"url\": \"([^\"]*)\"\\}"
GIT_BRANCH=$(git branch --remote --verbose --no-abbrev --contains | sed -rne 's/^[^\/]*\/([^\ ]+).*$/\1/p')
GIT_COMMIT=$(git rev-parse --short HEAD)
DATE=$(date '+%Y-%m-%d_%H-%M')
DOC_NAME="doc_${GIT_BRANCH}_${DATE}_${GIT_COMMIT}.tar.gz"
APP_NAME="OpenWalnut_${GIT_BRANCH}_${DATE}_${GIT_COMMIT}.AppImage"
uploadDoc() {
echo "TAR DOC"
tar -czvf $DOC_NAME ../../doc/developer/html
echo "UPLOAD DOC"
getDocUpload=$(curl "$DOC_UPLOAD" -H "Accept: application/json" -H "X-Requested-With: XMLHttpRequest")
link=""
if [[ $getDocUpload =~ $UPLOAD_REGEX ]]
then
link="${BASH_REMATCH[1]}"
fi
docUploadDone=$(curl "$link" -F file=@./$DOC_NAME -F parent_dir="/Documentation/")
echo "$docUploadDone"
echo "REMOVE DOC"
rm -f $DOC_NAME
if [[ $docUploadDone == *"error"* ]]
then
exit -1
fi
}
uploadAppImage() {
echo "COPY APPIMAGE"
cp ../AppImage/AppImageBuild/OpenWalnut*.AppImage ./$APP_NAME
echo "UPLOAD APPIMAGE"
getAppUpload=$(curl "$APP_UPLOAD" -H "Accept: application/json" -H "X-Requested-With: XMLHttpRequest")
link=""
if [[ $getAppUpload =~ $UPLOAD_REGEX ]]
then
link="${BASH_REMATCH[1]}"
fi
appUploadDone=$(curl "$link" -F file=@./$APP_NAME -F parent_dir="/AppImage/")
echo "$appUploadDone"
echo "REMOVE APPIMAGE"
rm -f $APP_NAME
if [[ $docUploadDone == *"error"* ]]
then
exit -1
fi
}
if [[ "$GIT_BRANCH" == "master" ]]
then
uploadDoc
else
echo "DOC OMMITED: not master branch"
fi
uploadAppImage
\ 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