依赖的 Dockerfile
在根目录下创建 Dockerfile 文件和 .gitlab-ci.yaml 文件,并复制以下内容到 Dockerfile
# This Dockerfile creates a static build image for CI
FROM openjdk:11-jdk
# Just matched `app/build.gradle`
ENV ANDROID_COMPILE_SDK "33"
# Just matched `app/build.gradle`
ENV ANDROID_BUILD_TOOLS "33.0.2"
# Just matched `app/build.gradle`
ENV ANDROID_NDK_VERSION "21.1.6352462"
# Version from https://developer.android.com/studio
ENV ANDROID_COMMAND_LINE_TOOLS "commandlinetools-linux-9477386_latest.zip"
# Flutter SDK Version
ENV FLUTTER_SDK_VERSION "3.7.12"
# CMAKE Version
ENV CMAKE_VERSION "3.10.2.4988404"
ENV ANDROID_HOME $PWD/android-sdk-linux/sdk
ENV PATH="${PATH}:${ANDROID_HOME}/platform-tools/:$PWD/flutter/bin/"
# install OS packages
RUN echo "deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src https://mirr

该文描述了如何创建一个Dockerfile来构建包含AndroidSDK、FlutterSDK和CMake的静态CI构建镜像。此外,还展示了.gitlab-ci.yaml文件的配置,用于在GitLab中执行环境设置、构建和部署阶段的CI/CD流程。这个流程包括更新Docker镜像、编译Debug和Release包,并基于推送事件和发布变量决定何时部署。
最低0.47元/天 解锁文章
747

被折叠的 条评论
为什么被折叠?



