https://github.com/kubesphere/devops-agent
https://github.com/kubesphere/devops-agent/blob/v3.2.2/base/hack/install_utils.sh
v3.22 版本基础镜像添加kustomize v4.5.3
gradle jenkins-salve镜像
github仓库下载文件
[root@ur-test-docker builder-gradle]# ls -ltotal 8-rw-r--r-- 1 root root 771 Jun 15 09:27 Dockerfile-rwxr-xr-x 1 root root 520 Jun 15 10:05 set_java[root@ur-test-docker builder-gradle]#
set_java 脚本赋予执行权限
chmod +x set_java
docker build -t kubespheredev/builder-gradle .docker push kubespheredev/builder-gradle:latest
本地文件 android-sdk_r24.4.1-linux.tar
FROM kubespheredev/builder-base:v3.1.0# Installs i386 architecture required for running 32 bit Android toolsRUN yum install -y glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686 && \yum clean all -y# Installs Android SDKENV ANDROID_SDK_FILENAME android-sdk_r24.4.1-linux.tarENV ANDROID_SDK_URL http://dl.google.com/android/${ANDROID_SDK_FILENAME}ENV ANDROID_API_LEVELS android-21,android-27,android-28,android-29,android-30,android-31,android-32ENV ANDROID_BUILD_TOOLS_VERSION 32.0.0ENV ANDROID_HOME /tmp/android-sdk-linuxENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/build-tools-${ANDROID_BUILD_TOOLS_VERSION}COPY ./android-sdk_r24.4.1-linux.tar /tmpRUN cd /tmp && \tar -xzf ${ANDROID_SDK_FILENAME} && \rm ${ANDROID_SDK_FILENAME} && \echo y | android update sdk --no-ui -a --filter tools,platform-tools,${ANDROID_API_LEVELS},build-tools-${ANDROID_BUILD_TOOLS_VERSION}# javaENV JAVA_VERSIOIN 11RUN yum install -y java-${JAVA_VERSIOIN}-openjdk-devel java-${JAVA_VERSIOIN}-openjdk-devel.i686 && \yum -y clean all# gradle7ENV GRADLE_VERSION 7.0.2ENV GRADLE_HOME /usr/local/gradle-${GRADLE_VERSION}ENV PATH ${GRADLE_HOME}/bin:$PATHRUN curl -fSL https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -o gradle.zip && \echo "$(curl -sLf https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip.sha256) gradle.zip" | sha256sum --check && \unzip -q gradle.zip -d /usr/local && \rm -f gradle.zip# Set JDK to be 32bitCOPY set_java $GRADLE_HOMERUN $GRADLE_HOME/set_java && \rm -f $GRADLE_HOME/set_javaENV PATH ${PATH}:${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS_VERSION}CMD ["gradle","--version"]
kubesphere配置
jenkins配置
- 在配置字典页面的搜索框中输入 jenkins-casc-config 并按回车键。
- 点击 jenkins-casc-config 进入其详情页面,点击更多操作,选择编辑 YAML
sh-4.2# gradle -hUSAGE: gradle [option...] [task...]-?, -h, --help Shows this help message.-a, --no-rebuild Do not rebuild project dependencies.-b, --build-file Specify the build file.--build-cache Enables the Gradle build cache. Gradle will try to reuse outputs from previous builds.-c, --settings-file Specify the settings file.--configuration-cache Enables the configuration cache. Gradle will try to reuse the build configuration from previous builds. [incubating]--configuration-cache-problems Configures how the configuration cache handles problems (fail or warn). Defaults to fail. [incubating]--configure-on-demand Configure necessary projects only. Gradle will attempt to reduce configuration time for large multi-project builds. [incubating]--console Specifies which type of console output to generate. Values are 'plain', 'auto' (default), 'rich' or 'verbose'.--continue Continue task execution after a task failure.-D, --system-prop Set system property of the JVM (e.g. -Dmyprop=myvalue).-d, --debug Log in debug mode (includes normal stacktrace).--daemon Uses the Gradle Daemon to run the build. Starts the Daemon if not running.--export-keys Exports the public keys used for dependency verification.-F, --dependency-verification Configures the dependency verification mode (strict, lenient or off)--foreground Starts the Gradle Daemon in the foreground.-g, --gradle-user-home Specifies the gradle user home directory.-I, --init-script Specify an initialization script.-i, --info Set log level to info.--include-build Include the specified build in the composite.-M, --write-verification-metadata Generates checksums for dependencies used in the project (comma-separated list)-m, --dry-run Run the builds with all task actions disabled.--max-workers Configure the number of concurrent workers Gradle is allowed to use.--no-build-cache Disables the Gradle build cache.--no-configuration-cache Disables the configuration cache. [incubating]--no-configure-on-demand Disables the use of configuration on demand. [incubating]--no-daemon Do not use the Gradle daemon to run the build. Useful occasionally if you have configured Gradle to always run with the daemon by default.--no-parallel Disables parallel execution to build projects.--no-scan Disables the creation of a build scan. For more information about build scans, please visit https://gradle.com/build-scans.--no-watch-fs Disables watching the file system.--offline Execute the build without accessing network resources.-P, --project-prop Set project property for the build script (e.g. -Pmyprop=myvalue).-p, --project-dir Specifies the start directory for Gradle. Defaults to current directory.--parallel Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use.--priority Specifies the scheduling priority for the Gradle daemon and all processes launched by it. Values are 'normal' (default) or 'low'--profile Profile build execution time and generates a report in the <build_dir>/reports/profile directory.--project-cache-dir Specify the project-specific cache directory. Defaults to .gradle in the root project directory.-q, --quiet Log errors only.--refresh-dependencies Refresh the state of dependencies.--refresh-keys Refresh the public keys used for dependency verification.--rerun-tasks Ignore previously cached task results.-S, --full-stacktrace Print out the full (very verbose) stacktrace for all exceptions.-s, --stacktrace Print out the stacktrace for all exceptions.--scan Creates a build scan. Gradle will emit a warning if the build scan plugin has not been applied. (https://gradle.com/build-scans)--status Shows status of running and recently stopped Gradle Daemon(s).--stop Stops the Gradle Daemon if it is running.-t, --continuous Enables continuous build. Gradle does not exit and will re-execute tasks when task file inputs change.--update-locks Perform a partial update of the dependency lock, letting passed in module notations change version. [incubating]-v, --version Print version info.-w, --warn Set log level to warn.--warning-mode Specifies which mode of warnings to generate. Values are 'all', 'fail', 'summary'(default) or 'none'--watch-fs Enables watching the file system for changes, allowing data about the file system to be re-used for the next build.--write-locks Persists dependency resolution for locked configurations, ignoring existing locking information if it exists-x, --exclude-task Specify a task to be excluded from execution.sh-4.2#
