Commit 9430906c authored by Michael Koch's avatar Michael Koch
Browse files

Add .gitlab-ci.yml, change Makefile

parent cee69295
Pipeline #7969 failed
image: ubuntu:latest
stages:
- build
build:
stage: build
only:
- tags
- triggers
- schedules
script:
- apt update
- curl -sL https://deb.nodesource.com/setup_13.x | bash -
- apt install -y apt-transport-https curl gnupg git-core rpm wine nodejs make
- sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
- sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_unstable.list > /etc/apt/sources.list.d/dart_unstable.list'
- apt update
- apt install -y dart
- export PATH="$PATH:/usr/lib/dart/bin"
- pub global activate webdev
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- npm install
- make build-kiosk
artifacts:
paths:
- dist/kiosk
\ No newline at end of file
......@@ -16,6 +16,8 @@
# along with AStA Copyclient. If not, see <http://www.gnu.org/licenses/>.
include includes/make.mk
include includes/version.mk
include includes/directprint.mk
default: install run
......@@ -40,7 +42,9 @@ endif
clean:
rm -rf dist
deploy:
deploy-all: deploy-win deploy-linux deploy-kiosk deploy-directprint deploy-mac
install-all:
cd ../astansible; make setup_copyclient
build-all: install build-kiosk build-directprint build-linux build-windows
......@@ -51,29 +55,32 @@ build-windows: build-win
build-win:
./build/change_config.sh disable_kiosk
./build/change_config.sh disable_starthidden
-@rm -rf dist 2>/dev/null || true
./build/build_angular.sh
./node_modules/.bin/electron-builder --win --ia32 --x64
mv ./dist/AStA\ Copyclient\ *.exe ./dist/AStA\ Copyclient.exe
makensis ./build/build_installer.nsi
mkdir -p ./dist/public/windows/${VERSION}
mv ./dist/setup-copyclient.exe ./dist/public/windows/${VERSION}/setup-copyclient.exe
deploy-win:
ssh ${deploy_user}@${deploy_host} 'mkdir -p ${dist_folder}/public/windows/${VERSION}'
ssh ${deploy_user}@${deploy_host} 'mkdir -p ${dist_folder}/public/windows/current'
scp dist/setup-copyclient.exe ${deploy_user}@${deploy_host}:${dist_folder}/public/windows/${VERSION}/setup-copyclient_${VERSION}.exe
scp ./dist/public/windows/${VERSION}/setup-copyclient.exe ${deploy_user}@${deploy_host}:${dist_folder}/public/windows/${VERSION}/setup-copyclient_${VERSION}.exe
ssh ${deploy_user}@${deploy_host} 'ln -sf ${dist_folder}/public/windows/${VERSION}/setup-copyclient_${VERSION}.exe ${dist_folder}/public/windows/current/setup-copyclient.exe'
build-mac:
./build/change_config.sh disable_kiosk
./build/change_config.sh disable_starthidden
-@rm -rf dist 2>/dev/null || true
./build/build_angular.sh
CSC_IDENTITY_AUTO_DISCOVERY=false
sudo rm -rf dist
./node_modules/.bin/electron-builder --mac --x64
productsign --sign "Developer ID Installer: ASTA Allgemeiner Studentenausschuss Uni Paderborn (VK3N2H79U2)" dist/AStA\ Copyclient-${VERSION}.pkg dist/AStA\ Copyclient-${VERSION}_signed.pkg
xcrun altool --notarize-app --primary-bundle-id "de.upb.asta.copyclient-mac" -t osx -f dist/AStA\ Copyclient-${VERSION}_signed.pkg -u ${APPLE_ACCOUNT} -p ${APPLE_PASSWORD}
sleep 180
xcrun altool --notarization-history -u ${APPLE_ACCOUNT} -p ${APPLE_PASSWORD}
xcrun stapler staple dist/AStA\ Copyclient-${VERSION}_signed.pkg
deploy-mac:
ssh ${deploy_user}@${deploy_host} 'mkdir -p ${dist_folder}/public/mac/${VERSION}'
ssh ${deploy_user}@${deploy_host} 'mkdir -p ${dist_folder}/public/mac/current'
scp dist/AStA\ Copyclient-${VERSION}_signed.pkg ${deploy_user}@${deploy_host}:${dist_folder}/public/mac/${VERSION}/asta-copyclient_${VERSION}.pkg
......@@ -83,16 +90,23 @@ build-linux:
./build/change_config.sh disable_kiosk
./build/change_config.sh disable_starthidden
./build/change_config.sh build_all_linux
-@rm -rf dist 2>/dev/null || true
./build/build_angular.sh
env SHELL=bash ./node_modules/.bin/electron-builder --linux --x64
mkdir -p ./dist/public/linux/${VERSION}
mv ./dist/asta-copyclient*.deb ./dist/public/linux/${VERSION}/asta-copyclient.deb
mv ./dist/asta-copyclient*.rpm ./dist/public/linux/${VERSION}/asta-copyclient.rpm
mv ./dist/asta-copyclient*.snap ./dist/public/linux/${VERSION}/asta-copyclient.snap
mv ./dist/asta-copyclient*.pacman ./dist/public/linux/${VERSION}/asta-copyclient_archlinux.tar.xz
mv ./dist/asta-copyclient*.tar.gz ./dist/public/linux/${VERSION}/asta-copyclient_generic.tar.gz
deploy-linux:
ssh ${deploy_user}@${deploy_host} 'mkdir -p ${dist_folder}/public/linux/${VERSION}'
ssh ${deploy_user}@${deploy_host} 'mkdir -p ${dist_folder}/public/linux/current'
scp dist/asta-copyclient*.deb ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.deb
scp dist/asta-copyclient*.rpm ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.rpm
scp dist/asta-copyclient*.snap ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.snap
scp dist/asta-copyclient*.pacman ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}_archlinux.tar.xz
scp dist/asta-copyclient*.tar.gz ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}_generic.tar.gz
scp ./dist/public/linux/${VERSION}/asta-copyclient.deb ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.deb
scp ./dist/public/linux/${VERSION}/asta-copyclient.rpm ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.rpm
scp ./dist/public/linux/${VERSION}/asta-copyclient.snap ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.snap
scp ./dist/public/linux/${VERSION}/asta-copyclient_archlinux.tar.xz ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}_archlinux.tar.xz
scp ./dist/public/linux/${VERSION}/asta-copyclient_generic.tar.gz ${deploy_user}@${deploy_host}:${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}_generic.tar.gz
ssh ${deploy_user}@${deploy_host} "ln -sf ${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.deb ${dist_folder}/public/linux/current/asta-copyclient.deb"
ssh ${deploy_user}@${deploy_host} "ln -sf ${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.rpm ${dist_folder}/public/linux/current/asta-copyclient.rpm"
ssh ${deploy_user}@${deploy_host} "ln -sf ${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}.snap ${dist_folder}/public/linux/current/asta-copyclient.snap"
......@@ -100,7 +114,6 @@ build-linux:
ssh ${deploy_user}@${deploy_host} "ln -sf ${dist_folder}/public/linux/${VERSION}/asta-copyclient_${VERSION}_generic.tar.gz ${dist_folder}/public/linux/current/asta-copyclient_generic.tar.gz"
build-debug:
-@rm -rf dist 2>/dev/null || true
./build/build_angular.sh left 44336
env SHELL=bash ./node_modules/.bin/electron-builder --linux --x64
......@@ -108,21 +121,30 @@ build-directprint:
./build/change_config.sh enable_kiosk
./build/change_config.sh disable_starthidden
./build/change_config.sh build_only_deb
-@rm -rf dist 2>/dev/null || true
for id in ${directprint_left}; do \
./build/build_angular.sh left $$id; \
env SHELL=bash ./node_modules/.bin/electron-builder --linux --x64; \
mkdir -p ./dist/directprint/${VERSION}/$$id; \
mv ./dist/asta-copyclient*.deb ./dist/directprint/${VERSION}/$$id/asta-copyclient.deb; \
done
for id in ${directprint_right}; do \
./build/build_angular.sh right $$id; \
env SHELL=bash ./node_modules/.bin/electron-builder --linux --x64; \
mkdir -p ./dist/directprint/${VERSION}/$$id; \
mv ./dist/asta-copyclient*.deb ./dist/directprint/${VERSION}/$$id/asta-copyclient.deb; \
done
deploy-directprint:
for id in ${directprint_left}; do \
ssh ${deploy_user}@${deploy_host} "mkdir -p ${dist_folder}/directprint/${VERSION}/$$id"; \
ssh ${deploy_user}@${deploy_host} "mkdir -p ${dist_folder}/directprint/current/$$id"; \
scp dist/asta-copyclient*.deb ${deploy_user}@${deploy_host}:${dist_folder}/directprint/${VERSION}/$$id/asta-copyclient.deb; \
scp ./dist/directprint/${VERSION}/$$id/asta-copyclient.deb ${deploy_user}@${deploy_host}:${dist_folder}/directprint/${VERSION}/$$id/asta-copyclient.deb; \
ssh ${deploy_user}@${deploy_host} "ln -sf ${dist_folder}/directprint/${VERSION}/$$id/asta-copyclient.deb ${dist_folder}/directprint/current/$$id/asta-copyclient.deb"; \
done
for id in ${directprint_right}; do \
./build/build_angular.sh right $$id; \
env SHELL=bash ./node_modules/.bin/electron-builder --linux --x64; \
ssh ${deploy_user}@${deploy_host} "mkdir -p ${dist_folder}/directprint/${VERSION}/$$id"; \
ssh ${deploy_user}@${deploy_host} "mkdir -p ${dist_folder}/directprint/current/$$id"; \
scp dist/asta-copyclient*.deb ${deploy_user}@${deploy_host}:${dist_folder}/directprint/${VERSION}/$$id/asta-copyclient.deb; \
scp ./dist/directprint/${VERSION}/$$id/asta-copyclient.deb ${deploy_user}@${deploy_host}:${dist_folder}/directprint/${VERSION}/$$id/asta-copyclient.deb; \
ssh ${deploy_user}@${deploy_host} "ln -sf ${dist_folder}/directprint/${VERSION}/$$id/asta-copyclient.deb ${dist_folder}/directprint/current/$$id/asta-copyclient.deb"; \
done
......@@ -130,10 +152,13 @@ build-kiosk:
./build/change_config.sh enable_kiosk
./build/change_config.sh enable_starthidden
./build/change_config.sh build_only_deb
-@rm -rf dist 2>/dev/null || true
./build/build_angular.sh
env SHELL=bash ./node_modules/.bin/electron-builder --linux --x64
mkdir -p ./dist/kiosk/${VERSION}
mv ./dist/asta-copyclient*.deb ./dist/kiosk/${VERSION}/asta-copyclient.deb
deploy-kiosk:
ssh ${deploy_user}@${deploy_host} "mkdir -p ${dist_folder}/kiosk/${VERSION}"
ssh ${deploy_user}@${deploy_host} "mkdir -p ${dist_folder}/kiosk/current"
scp dist/asta-copyclient*.deb ${deploy_user}@${deploy_host}:${dist_folder}/kiosk/${VERSION}/asta-copyclient_${VERSION}.deb
scp ./dist/kiosk/${VERSION}/asta-copyclient.deb ${deploy_user}@${deploy_host}:${dist_folder}/kiosk/${VERSION}/asta-copyclient_${VERSION}.deb
ssh ${deploy_user}@${deploy_host} "ln -sf ${dist_folder}/kiosk/${VERSION}/asta-copyclient_${VERSION}.deb ${dist_folder}/kiosk/current/asta-copyclient.deb"
directprint_left=44333 44328 44336 44338
directprint_right=44330 44325 44322
\ No newline at end of file
......@@ -15,9 +15,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with AStA Copyclient. If not, see <http://www.gnu.org/licenses/>.
VERSION=1.2.3
directprint_left=12345 67890
directprint_right=09876 54321
deploy_user=foo
deploy_host=bar
dist_folder=/path/to/dist
......
VERSION=0.3.11
\ 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