From 6af1f376c2581fa08a8ab71d4ce6d6bcbd10f18c Mon Sep 17 00:00:00 2001 From: dany Date: Wed, 5 Oct 2022 21:21:02 +0200 Subject: [PATCH] new build from release archive (#5) Reviewed-on: https://git.iohub.dev/dany/antosaio/pulls/5 --- Dockerfile | 17 +++++++++-------- Jenkinsfile | 25 +++++-------------------- runner.ini | 2 +- start.sh | 10 +++++----- 4 files changed, 20 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0a7628c..516615b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM ubuntu:focal AS deploy-env -RUN apt-get update && apt-get --yes --no-install-recommends install libsqlite3-0 zlib1g libreadline8 libssl1.1 wget libvncclient1 libjpeg-turbo8 openssh-client +ARG tag +RUN apt-get update && apt-get --yes --no-install-recommends install libsqlite3-0 zlib1g libreadline8 libssl1.1 wget libvncclient1 libjpeg-turbo8 openssh-client tar tree RUN apt clean && rm -rf /var/lib/apt/lists/* RUN mkdir /ulib RUN cp -rf /lib/*-linux-*/libsqlite3*.so* /ulib @@ -45,11 +46,14 @@ RUN cp -rf /lib/*-linux-*/libcom_err*.so* /ulib RUN cp -rf /lib/*-linux-*/libkrb5support*.so* /ulib RUN cp -rf /lib/*-linux-*/libkeyutils*.so* /ulib + +# antos RUN mkdir /platform -COPY antos/ / -RUN cp /backend/$(uname -m)/* /platform -rf +COPY antos-release/ / +RUN tar -xzf /build/$tag/AntOS_$(uname -m).tar.gz -C /platform/ +RUN tree /platform + FROM busybox:stable-glibc -ARG tag #copy all necessary libraries COPY --from=deploy-env /ulib/ /lib/ COPY --from=deploy-env /bin/wget /bin/ @@ -61,15 +65,12 @@ COPY profile /etc/profile RUN chmod a+x /bin/bash # copy backend COPY --from=deploy-env /platform/ / -RUN rm /etc/systemd -rf # copy frontend COPY antd-config.ini /opt/www/antd-config.ini COPY runner.ini /opt/www/runner.ini RUN chmod 744 /opt/www/antd-config.ini RUN chmod 744 /opt/www/runner.ini -COPY antos/frontend/$tag/ / -RUN chown -R root:root /opt/www/htdocs/ -RUN rm -rf /etc/systemd + COPY start.sh /start.sh RUN chmod 700 /start.sh ENTRYPOINT /start.sh diff --git a/Jenkinsfile b/Jenkinsfile index 6d15d5a..6d34346 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,5 @@ -def remote = [:] -remote.name = 'workstation' -remote.host = 'workstation' -remote.user = 'dany' -remote.identityFile = '/var/jenkins_home/.ssh/id_rsa' -remote.allowAnyHosts = true -remote.agent = false -remote.logLevel = 'INFO' pipeline{ - agent { node{ label'master' }} - //parameters { - // string(defaultValue: "xsangle", name: 'dockerhub_user', description: 'Docker hub username') - // string(defaultValue: "", name: 'dockerhub_pat', description: 'Docker hub Personal Access Token') - //} + agent { node{ label'workstation' }} options { // Limit build history with buildDiscarder option: // daysToKeepStr: history is only kept up to this many days. @@ -32,16 +20,13 @@ pipeline{ { stage('Build all') { steps { - sshCommand remote: remote, command: ''' + copyArtifacts(projectName: 'gitea-sync/antos-appimage/master', target: 'antos-release'); + sh'''#! /bin/bash set -e - export WORKSPACE=$(realpath "./jenkins/workspace/antosaio-docker") cd $WORKSPACE - [ -d antos ] && rm -rf antos - mkdir antos - cp /var/jenkins_home/workspace/nightly-antosaio/build/* antos -rf - tree antos + tree antos-release docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 - for dir in antos/frontend/* ; do + for dir in antos-release/build/* ; do tag=$(basename $dir) echo "BUILD TAG $tag" docker buildx build \ diff --git a/runner.ini b/runner.ini index f94d252..b058e2b 100644 --- a/runner.ini +++ b/runner.ini @@ -1,4 +1,4 @@ [vterm] exec = /opt/www/bin/vterm -param = /opt/www/tmp/channels/antd_hotline.sock +param = /app/data/tmp/channels/antd_hotline.sock debug = 0 \ No newline at end of file diff --git a/start.sh b/start.sh index b098fbc..d9c04d5 100755 --- a/start.sh +++ b/start.sh @@ -20,9 +20,9 @@ unset ANTOS_PASSWORD [ ! -f "/app/antd-config.ini" ] && cp /opt/www/antd-config.ini /app/antd-config.ini [ ! -f "/app/runner.ini" ] && cp /opt/www/runner.ini /app/runner.ini -/usr/bin/antd /app/antd-config.ini >/dev/null 2>&1 | \ +# start syslog +syslogd -O /tmp/messages + +usr/bin/antd /app/antd-config.ini >/dev/null 2>&1 | \ ( sleep 2 && /opt/www/bin/runner /app/runner.ini >/dev/null 2>&1 &) -#/usr/bin/antd /app/antd-config.ini & -#sleep 2 -#[ -f /app/runner.ini ] && /opt/www/bin/runner /app/runner.ini & -#wait \ No newline at end of file +# /bin/sh \ No newline at end of file