Browse Source

Move the remote access to a dedicated repository

merge-requests/1990/head
Nicolas Pomepuy 2 years ago
parent
commit
03a915d53f
  1. 3
      .gitignore
  2. 2
      application/webserver/build.gradle
  3. 88
      buildsystem/compile-remoteaccess.sh
  4. 16
      buildsystem/gitlab/.gitlab-ci.yml

3
.gitignore

@ -15,6 +15,9 @@ medialibrary/jni/libs
medialibrary/.libs
medialibrary/prefix
# Remote access
remoteaccess/**
# Android .so
/android-libs/**/*.so
.modules/

2
application/webserver/build.gradle

@ -34,7 +34,7 @@ android {
}
task webCopy(type: Copy) {
from '../../buildsystem/network-sharing-server/dist'
from '../../remoteaccess/dist'
into 'assets/dist'
}

88
buildsystem/compile-remoteaccess.sh

@ -0,0 +1,88 @@
#! /bin/sh
#
# *************************************************************************
# compile-remoteaccess.sh
# **************************************************************************
# Copyright © 2024 VLC authors and VideoLAN
# Author: Nicolas POMEPUY
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
# ***************************************************************************
#
#
#
set -e
#############
# FUNCTIONS #
#############
diagnostic()
{
echo "$@" 1>&2;
}
while [ $# -gt 0 ]; do
case $1 in
help|--help|-h)
echo "Use -c to build the remote access project"
exit 0
;;
-c)
BUILD_REMOTE_ACCCESS=1
;;
*)
diagnostic "$0: Invalid option '$1'."
diagnostic "$0: Try --help for more information."
exit 1
;;
esac
shift
done
##############################
# Retrieve the remote access #
##############################
diagnostic "Setting up the Remote Access project"
REMOTE_ACCESS_TESTED_HASH=b99f099666e4101a36e4454c38ab6e982fde149b
REMOTE_ACCESS_REPOSITORY=https://code.videolan.org/Aza/remoteaccess
: ${VLC_REMOTE_ACCESS_PATH:="$(pwd -P)/remoteaccess"}
if [ ! -d "$VLC_REMOTE_ACCESS_PATH" ] || [ ! -d "$VLC_REMOTE_ACCESS_PATH/.git" ]; then
diagnostic "Remote access sources: not found, cloning"
branch="main"
if [ ! -d "$VLC_REMOTE_ACCESS_PATH" ]; then
git clone --single-branch --branch ${branch} "${REMOTE_ACCESS_REPOSITORY}"
cd remoteaccess
else # folder exist with only the artifacts
cd remoteaccess
git init
git remote add origin "${REMOTE_ACCESS_REPOSITORY}"
git pull origin ${branch}
fi
git reset --hard ${REMOTE_ACCESS_TESTED_HASH} || fail "Remote access sources: REMOTE_ACCESS_TESTED_HASH ${REMOTE_ACCESS_TESTED_HASH} not found"
cd ..
fi
if [ "$BUILD_REMOTE_ACCCESS" = 1 ]; then
diagnostic "Building the Remote Access project"
cd "$VLC_REMOTE_ACCESS_PATH"
npm install
npm run build
cd ..
fi

16
buildsystem/gitlab/.gitlab-ci.yml

@ -9,7 +9,7 @@ variables:
VLC_ANDROID_IMAGE_30: registry.videolan.org/vlc-debian-android-3.0:20230621085943
VLC_ANDROID_IMAGE_40: registry.videolan.org/vlc-debian-android:20230614051113
VLC_WEB_BUILD_IMAGE: registry.videolan.org/videolan-alpine-node:20230523124511
WEBSERVER_DIR: "./buildsystem/network-sharing-server/"
WEBSERVER_DIR: "./remoteaccess"
default:
interruptible: true
@ -34,7 +34,7 @@ stages:
# a medialib build
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- buildsystem/network-sharing-server/**/*
- buildsystem/compile-remoteaccess.sh
- if: '$CI_COMMIT_TAG =~ /^(\d+\.)?(\d+\.)?(\*|\d+)/'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
@ -46,11 +46,12 @@ webserver-install-dependencies:
extends: .webserver-base
stage: webserver-install-dependencies
script:
- ./buildsystem/compile-remoteaccess.sh
- cd "$WEBSERVER_DIR"
- npm install
artifacts:
paths:
- buildsystem/network-sharing-server/node_modules/
- remoteaccess/
when: on_success
expire_in: 1h
@ -64,7 +65,7 @@ webserver-build:
- npm run build
artifacts:
paths:
- buildsystem/network-sharing-server/dist/
- remoteaccess/
when: on_success
expire_in: 1h
@ -74,6 +75,7 @@ webserver-vulnerabilities:
needs:
- job: "webserver-install-dependencies"
script:
- ./buildsystem/compile-remoteaccess.sh
- cd "$WEBSERVER_DIR"
- npx audit-ci@^6 --config ./audit-ci.jsonc
@ -110,7 +112,7 @@ webserver-vulnerabilities:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- buildsystem/network-sharing-server/**/*
- buildsystem/compile-remoteaccess.sh
needs:
- job: "webserver-build"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
@ -131,7 +133,7 @@ continuous-app-build:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- buildsystem/network-sharing-server/**/*
- buildsystem/compile-remoteaccess.sh
needs:
- job: "webserver-build"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
@ -144,7 +146,7 @@ continuous-app-build-v4:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- buildsystem/network-sharing-server/**/*
- buildsystem/compile-remoteaccess.sh
needs:
- job: "webserver-build"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

Loading…
Cancel
Save