mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-22 21:31:07 -05:00
Fix GitlabCI repository url and improve Android dockerfiles
This commit is contained in:
parent
a9fe1ba6de
commit
7ae314440f
@ -13,7 +13,6 @@ workflow:
|
|||||||
- if: $CI_COMMIT_BRANCH
|
- if: $CI_COMMIT_BRANCH
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
REPO_ARGS_CMD: '[ -n "$CI_MERGE_REQUEST_ID" ] && echo --build-arg REPO_URL=\"$CI_MERGE_REQUEST_SOURCE_PROJECT_URL\" --build-arg REPO_BRANCH=\"$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME\" || echo --build-arg REPO_URL=\"$CI_REPOSITORY_URL\" --build-arg REPO_BRANCH=\"$CI_COMMIT_BRANCH\"'
|
|
||||||
UBUNTU_TESTING_IMAGE_TAG: "$CI_REGISTRY_IMAGE/gitlabci_outputs/ubuntu_testing:$CI_COMMIT_SHA"
|
UBUNTU_TESTING_IMAGE_TAG: "$CI_REGISTRY_IMAGE/gitlabci_outputs/ubuntu_testing:$CI_COMMIT_SHA"
|
||||||
|
|
||||||
build-ubuntu-test-image:
|
build-ubuntu-test-image:
|
||||||
@ -27,7 +26,7 @@ build-ubuntu-test-image:
|
|||||||
- >
|
- >
|
||||||
docker build
|
docker build
|
||||||
-t $UBUNTU_TESTING_IMAGE_TAG
|
-t $UBUNTU_TESTING_IMAGE_TAG
|
||||||
$($REPO_ARGS_CMD)
|
$($CI_PROJECT_DIR/build_scripts/GitlabCI/getRepoArgs.sh)
|
||||||
--file $CI_PROJECT_DIR/build_scripts/GitlabCI/gitlabCI.Dockerfile
|
--file $CI_PROJECT_DIR/build_scripts/GitlabCI/gitlabCI.Dockerfile
|
||||||
Dockercontext
|
Dockercontext
|
||||||
- docker push $UBUNTU_TESTING_IMAGE_TAG
|
- docker push $UBUNTU_TESTING_IMAGE_TAG
|
||||||
@ -74,7 +73,8 @@ build-android-arm-apk:
|
|||||||
script:
|
script:
|
||||||
- mkdir Dockercontext
|
- mkdir Dockercontext
|
||||||
- >
|
- >
|
||||||
docker build -t retroshare:android_arm_latest $($REPO_ARGS_CMD)
|
docker build -t retroshare:android_arm_latest
|
||||||
|
$($CI_PROJECT_DIR/build_scripts/GitlabCI/getRepoArgs.sh)
|
||||||
--file $CI_PROJECT_DIR/build_scripts/GitlabCI/Android.Dockerfile
|
--file $CI_PROJECT_DIR/build_scripts/GitlabCI/Android.Dockerfile
|
||||||
Dockercontext
|
Dockercontext
|
||||||
# see https://stackoverflow.com/a/59055906
|
# see https://stackoverflow.com/a/59055906
|
||||||
@ -92,7 +92,8 @@ build-android-arm64-apk:
|
|||||||
script:
|
script:
|
||||||
- mkdir Dockercontext
|
- mkdir Dockercontext
|
||||||
- >
|
- >
|
||||||
docker build -t retroshare:android_arm64_latest $($REPO_ARGS_CMD)
|
docker build -t retroshare:android_arm64_latest
|
||||||
|
$($CI_PROJECT_DIR/build_scripts/GitlabCI/getRepoArgs.sh)
|
||||||
--build-arg ANDROID_PLATFORM_VER=21
|
--build-arg ANDROID_PLATFORM_VER=21
|
||||||
--build-arg ANDROID_NDK_ARCH=arm64
|
--build-arg ANDROID_NDK_ARCH=arm64
|
||||||
--file $CI_PROJECT_DIR/build_scripts/GitlabCI/Android.Dockerfile
|
--file $CI_PROJECT_DIR/build_scripts/GitlabCI/Android.Dockerfile
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
# docker login registry.gitlab.com
|
# docker login registry.gitlab.com
|
||||||
# docker push ${CI_IMAGE_NAME}
|
# docker push ${CI_IMAGE_NAME}
|
||||||
|
|
||||||
|
## To extract the generated APK easily you can run after the build complete
|
||||||
|
# docker cp \
|
||||||
|
# $(docker create --rm ${CI_IMAGE_NAME}):/retroshare-service-android-build/android-build/build/outputs/apk/debug/android-build-debug.apk \
|
||||||
|
# /tmp/RetroShare_Android_Service.apk
|
||||||
|
|
||||||
|
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
@ -85,6 +90,7 @@ RUN qmake ../RetroShare/jsonapi-generator/src/ \
|
|||||||
|
|
||||||
RUN mkdir /retroshare-service-android-build
|
RUN mkdir /retroshare-service-android-build
|
||||||
WORKDIR /retroshare-service-android-build
|
WORKDIR /retroshare-service-android-build
|
||||||
|
ARG RS_SERVICE_QMAKE_EXTRA_OPTS
|
||||||
RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/qmake ../RetroShare \
|
RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/qmake ../RetroShare \
|
||||||
-spec android-clang \
|
-spec android-clang \
|
||||||
CONFIG+=retroshare_service CONFIG+=rs_jsonapi \
|
CONFIG+=retroshare_service CONFIG+=rs_jsonapi \
|
||||||
@ -93,7 +99,8 @@ RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/qmake ../RetroShare \
|
|||||||
NATIVE_LIBS_TOOLCHAIN_PATH=$NATIVE_LIBS_TOOLCHAIN_PATH \
|
NATIVE_LIBS_TOOLCHAIN_PATH=$NATIVE_LIBS_TOOLCHAIN_PATH \
|
||||||
CONFIG+=no_retroshare_gui CONFIG+=no_rs_service_webui_terminal_password \
|
CONFIG+=no_retroshare_gui CONFIG+=no_rs_service_webui_terminal_password \
|
||||||
CONFIG+=no_rs_service_terminal_login \
|
CONFIG+=no_rs_service_terminal_login \
|
||||||
CONFIG+=no_rs_sam3 CONFIG+=no_rs_sam3_libsam3
|
CONFIG+=no_rs_sam3 CONFIG+=no_rs_sam3_libsam3 \
|
||||||
|
$RS_SERVICE_QMAKE_EXTRA_OPTS
|
||||||
RUN make -j$(nproc)
|
RUN make -j$(nproc)
|
||||||
RUN make install INSTALL_ROOT=/retroshare-service-android-build/android-build/
|
RUN make install INSTALL_ROOT=/retroshare-service-android-build/android-build/
|
||||||
RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/androiddeployqt \
|
RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/androiddeployqt \
|
||||||
|
@ -25,6 +25,7 @@ WORKDIR /retroshare-service-android-build
|
|||||||
|
|
||||||
# ARG declared before FROM get wiped after it, so we need declaring it again
|
# ARG declared before FROM get wiped after it, so we need declaring it again
|
||||||
ARG ANDROID_NDK_ARCH=arm
|
ARG ANDROID_NDK_ARCH=arm
|
||||||
|
ARG RS_SERVICE_QMAKE_EXTRA_OPTS
|
||||||
RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/qmake ../RetroShare \
|
RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/qmake ../RetroShare \
|
||||||
-spec android-clang \
|
-spec android-clang \
|
||||||
CONFIG+=retroshare_service CONFIG+=rs_jsonapi \
|
CONFIG+=retroshare_service CONFIG+=rs_jsonapi \
|
||||||
@ -33,7 +34,8 @@ RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/qmake ../RetroShare \
|
|||||||
NATIVE_LIBS_TOOLCHAIN_PATH=$NATIVE_LIBS_TOOLCHAIN_PATH \
|
NATIVE_LIBS_TOOLCHAIN_PATH=$NATIVE_LIBS_TOOLCHAIN_PATH \
|
||||||
CONFIG+=no_retroshare_gui CONFIG+=no_rs_service_webui_terminal_password \
|
CONFIG+=no_retroshare_gui CONFIG+=no_rs_service_webui_terminal_password \
|
||||||
CONFIG+=no_rs_service_terminal_login \
|
CONFIG+=no_rs_service_terminal_login \
|
||||||
CONFIG+=no_rs_sam3 CONFIG+=no_rs_sam3_libsam3
|
CONFIG+=no_rs_sam3 CONFIG+=no_rs_sam3_libsam3 \
|
||||||
|
$RS_SERVICE_QMAKE_EXTRA_OPTS
|
||||||
RUN make -j$(nproc)
|
RUN make -j$(nproc)
|
||||||
RUN make install INSTALL_ROOT=/retroshare-service-android-build/android-build/
|
RUN make install INSTALL_ROOT=/retroshare-service-android-build/android-build/
|
||||||
|
|
||||||
|
9
build_scripts/GitlabCI/getRepoArgs.sh
Executable file
9
build_scripts/GitlabCI/getRepoArgs.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ -n "$CI_MERGE_REQUEST_ID" ] &&
|
||||||
|
echo \
|
||||||
|
--build-arg REPO_URL="$CI_MERGE_REQUEST_SOURCE_PROJECT_URL" \
|
||||||
|
--build-arg REPO_BRANCH="$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ||
|
||||||
|
echo \
|
||||||
|
--build-arg REPO_URL="$CI_REPOSITORY_URL" \
|
||||||
|
--build-arg REPO_BRANCH="$CI_COMMIT_BRANCH"
|
Loading…
Reference in New Issue
Block a user