Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate jenkins packaging scripts #1228

Closed
peabody124 opened this issue Aug 17, 2014 · 11 comments
Closed

Integrate jenkins packaging scripts #1228

peabody124 opened this issue Aug 17, 2014 · 11 comments

Comments

@peabody124
Copy link
Contributor

Jenkins packages builds differently than make package does in most cases. It would be good to first get the scripts jenkins runs uploaded somewhere for inspection and testing, and if possible integrate that into the make package command.

@peabody124
Copy link
Contributor Author

@lilvinz i don't know if those builds scripts are something you can upload.

@lilvinz
Copy link
Contributor

lilvinz commented Aug 21, 2014

Windows recipe:

REM Note, last command's exit code is being returned to jenkins
REM Set path substitution volume
subst w: /D
subst w: %WORKSPACE%

-------

set MSYSGIT=C:\PROGRA~2\Git\bin\
set ARMTOOLCHAIN=C:\PROGRA~2\GNUTOO~1\47031~1.820\BIN
set MSYSTEM=MINGW32
set UNSIS=C:\PROGRA~2\NSIS\Unicode\
set PYTHON=C:\Python27\

REM settings for QT5.3.1 build
set QTMINGW=C:\Qt\Qt5.3.1\tools\mingw482_32\bin\
set PATH=C:\PROGRA~1;C:\Program Files\7-Zip;C:\PROGRA~2\Java\jre7\bin;C:\PROGRA~2\Java\jdk1.7.0_09\bin;C:\PROGRA~2\Android\android-sdk\platform-tools;C:\PROGRA~2\Git\bin\;C:\Qt\Qt5.3.1\tools\mingw482_32\bin\;C:\Qt\Qt5.3.1\5.3\mingw482_32\bin;C:\PROGRA~2\GNUTOO~1\47031~1.820\BIN;C:\Python27\;C:\PROGRA~2\NSIS\Unicode\;C:\Windows\system32;C:\Windows

REM settings for QT4.8.1 build
REM set QTMINGW=C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\
REM set PATH=C:\PROGRA~1;C:\Program Files\7-Zip;C:\PROGRA~2\Java\jre7\bin;C:\PROGRA~2\Java\jdk1.7.0_09\bin;C:\PROGRA~2\Android\android-sdk\platform-tools;C:\PROGRA~2\Git\bin\;C:\QtSDK\mingw\bin\;C:\QtSDK\Desktop\Qt\48D70E~1.1\mingw\bin\;C:\PROGRA~2\GNUTOO~1\47031~1.820\BIN;C:\Python27\;C:\PROGRA~2\NSIS\Unicode\;C:\PROGRA~2\OpenOCD\OPENOC~2\bin\;C:\Windows\system32;C:\Windows

REM Note, last command's exit code is being returned to jenkins

REM copy ssleay32.dll into tools/win32openssl as there is no option to provide a path to it
mkdir tools\win32openssl
copy c:\Windows\SysWoW64\ssleay32.dll tools\win32openssl\
copy c:\Windows\SysWoW64\libeay32.dll tools\win32openssl\

REM Switch to build substitution volume because all_flight will fail else
w: || exit /b 1
REM bu target is currently broken
REM mingw32-make -j8 all_flight || exit /b 1
mingw32-make -j8 all_fw all_bl || exit /b 1

REM Switch back to WORKSPACE because package_resources will fail else
c: || exit /b 1
mingw32-make CLEAN_GROUND=NO package_resources || exit /b 1

REM Switch to build substitution volume because gcs will fail else
w: || exit /b 1
REM mingw32-make -j8 GCS_BUILD_CONF=release GCS_QMAKE_OPTS="CONFIG+=SDL CONFIG+=KML" gcs || exit /b 1
REM no KML on windows yet
mingw32-make -j8 GCS_BUILD_CONF=release gcs || exit /b 1

REM we cant build androidgcs on windows
REM mingw32-make -j4 ANDROIDGCS_BUILD_CONF=release ANDROID="cmd //C android.bat" ANDROID_DX="cmd //C dx.bat" androidgcs || exit /b 1

REM gtest is missing, fix me
REM mingw32-make -j4 all_ut_tap || exit /b 1

-------

REM Note, last command's exit code is being returned to jenkins
REM Remove path substitution volume
subst w: /D

@lilvinz
Copy link
Contributor

lilvinz commented Aug 21, 2014

Linux recipe:

#!/bin/bash

ln -s /opt tools

#make -j1 package
# can't use make package because it doesn't produce ef_* targets.
make -j2 all_flight
make CLEAN_GROUND=NO package_resources
make -j2 GCS_BUILD_CONF=release GCS_QMAKE_OPTS="CONFIG+=SDL CONFIG+=KML" gcs
make -j2 ANDROIDGCS_BUILD_CONF=release androidgcs
make -j2 all_ut_tap

@lilvinz
Copy link
Contributor

lilvinz commented Aug 21, 2014

Post processing:

# make new release dir
mkdir release
mkdir release/flight
mkdir release/androidgcs

# put together everything
cp CREDITS.txt LICENSE.txt release
git log > release/CHANGELOG.txt

for a in fw_ bl_ bu_ ef_
do
  for b in coptercontrol pipxtreme revolution revomini osd freedom quanton flyingf3 discoveryf3 flyingf4 discoveryf4 sparky sparkybgc
  do
    for c in opfw bin tlfw
    do
      if [ -f build/$a$b/$a$b.$c ]; then
        if [ ! -d release/flight/$b ]; then
          mkdir release/flight/$b
        fi
        cp build/$a$b/$a$b.$c release/flight/$b/
      fi
    done
  done
done

cp -r build/ground/gcs release
rm -rf release/gcs/Makefile*
rm -rf release/gcs/*.h
rm -rf release/gcs/src
rm -rf release/gcs/share/Makefile
rm -rf release/gcs/lib/taulabs/*.a

@lilvinz
Copy link
Contributor

lilvinz commented Aug 21, 2014

Archiving Windows:

#we cant build androidgcs on windows
#cp build/androidgcs/bin/*.apk release/androidgcs/

mkdir release/drivers
cp -r package/winx86/redist release/gcs
cp -r "flight/Project/Windows USB" release/drivers/

# set artifact name
BUILD_DATE=$(date -u -d "`git log -n1 --no-color --format=format:%ci HEAD`" +%Y%m%d_%H%M%S)
NORMALIZED_GIT_BRANCH=${GIT_BRANCH//\//-}
RELEASE_NAME=taulabs_${NORMALIZED_GIT_BRANCH:7}_${BUILD_DATE}_${GIT_COMMIT:0:10}_win32

# compress
mv release $RELEASE_NAME
#7z a -mmt2 -t7z $RELEASE_NAME.7z $RELEASE_NAME
7z a -mmt2 -sfx7z.sfx $RELEASE_NAME.exe $RELEASE_NAME
rm -rf $RELEASE_NAME

@lilvinz
Copy link
Contributor

lilvinz commented Aug 21, 2014

Archiving Linux:

#!/bin/bash

cp build/androidgcs/bin/*.apk release/androidgcs/

# set artifact name
BUILD_DATE=$(date -u -d "`git log -n1 --no-color --format=format:%ci HEAD`" +%Y%m%d_%H%M%S)
NORMALIZED_GIT_BRANCH=${GIT_BRANCH//\//-}
RELEASE_NAME=taulabs_${NORMALIZED_GIT_BRANCH:7}_${BUILD_DATE}_${GIT_COMMIT:0:10}_linux_i686

# compress
mv release $RELEASE_NAME
tar cpJf $RELEASE_NAME.tar.xz $RELEASE_NAME

@lilvinz
Copy link
Contributor

lilvinz commented Aug 21, 2014

@peabody124: Most of the complexity is to work around windows issues.

@peabody124
Copy link
Contributor Author

Do you know if the linux packages actually work? I just tested one and ther is no Qt5 bundled with it.

@guilhermito
Copy link
Contributor

Linux recipe can now use:

make -j2 GCS_BUILD_CONF=release GCS_QMAKE_OPTS="CONFIG+=SDL CONFIG+=KML" linux_standalone

Instead of:

make -j2 GCS_BUILD_CONF=release GCS_QMAKE_OPTS="CONFIG+=SDL CONFIG+=KML" gcs

@lilvinz
Copy link
Contributor

lilvinz commented Sep 18, 2014

Thanks, i changed that for all jenkins builders.

This was referenced Sep 20, 2014
@lilvinz
Copy link
Contributor

lilvinz commented Oct 1, 2014

This should be fixed now, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants