Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the systematic Packaging of android Project

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Demand

Realize the systematic packaging of android project and the archiving management of each version of apk and upload it to dandelion platform automatically through dandelion platform API

two。 Mode of realization

Jenkins slave node installs android sdk and gradle

3. Pipeline

Node ('slave-201') {stage ("pull code from gitlab") {checkout ([$class:' GitSCM', branches: [[name:'* *], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'certified ID'] Url: 'project address']])} stage ("replace update configuration file and signature file") {sh''/ usr/bin/cd ${WORKSPACE} / usr/bin/rm-rf ${WORKSPACE} / app/build.gradle / usr/bin/cp / root/jenkins/android/build.gradle ${WORKSPACE} / app''} stage ("compile Package and sign package ") {sh''export JAVA_HOME=/usr/local/jdk8 export ANDROID_HOME=/usr/local/android export GRADLE_HOME=/usr/local/gradle cd app/ usr/local/gradle/bin/gradle clean / usr/local/gradle/bin/gradle assembleRelease'''} stage (" Archive ") {archiveArtifacts artifacts:' app/build/outputs/apk/release/app-release.apk' Fingerprint: true} stage ('publish to dandelion platform') {sh'''curl-F 'file=@app/build/outputs/apk/release/app-release.apk'-F' _ api_key=apikey'-F "buildInstallType=2"-F "buildPassword=password" https://www.pgyer.com/apiv2/app/upload''}}

4. Construction result

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report