chore: add jenkins pipeline
arcad/arcast/pipeline/head There was a failure building this commit Details

This commit is contained in:
wpetit 2024-04-23 10:02:26 +02:00
parent 378e0fae3e
commit 0a572d02bc
2 changed files with 53 additions and 2 deletions

48
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,48 @@
@Library('cadoles') _
// Utilisation du pipeline "standard"
// Voir https://forge.cadoles.com/Cadoles/Jenkins/src/branch/master/doc/tutorials/standard-make-pipeline.md
standardMakePipeline([
'dockerfileExtension': '''
ARG GOLANG_VERSION=1.22.0
ENV ANDROID_HOME=/opt/android-sdk-linux
ENV ANDROID_NDK_HOME=${ANDROID_HOME}/ndk-bundle
ENV PATH=${PATH}:/usr/local/go/bin/:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
# Install utilities
RUN apt-get update -y \
&& apt-get install -y wget curl tar build-essential ca-certificates git openjdk-11-jdk-headless unzip locales jq moreutils
# Set locale
RUN locale-gen en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
# Install Golang
RUN wget -O golang.tar.gz https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf golang.tar.gz
# Install Android SDK/NDK
RUN mkdir -p /opt/android-sdk-linux
WORKDIR /opt/android-sdk-linux
RUN wget -O commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip \
&& mkdir -p ${ANDROID_HOME}/cmdline-tools/latest \
&& unzip -q commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools/latest \
&& mv ${ANDROID_HOME}/cmdline-tools/latest/cmdline-tools/* ${ANDROID_HOME}/cmdline-tools/latest/ \
&& rm -f commandlinetools.zip
RUN echo y | cmdline-tools/latest/bin/sdkmanager --install \
'platforms;android-29' \
'ndk-bundle' \
'build-tools;34.0.0' \
'tools' \
'platform-tools' \
'extras;android;m2repository' \
'extras;google;m2repository' \
'extras;google;google_play_services'
''',
'credentials': [
usernamePassword(credentialsId: 'kipp-credentials', usernameVariable: 'MKT_GITEA_RELEASE_USERNAME', passwordVariable: 'MKT_GITEA_RELEASE_PASSWORD')
]
])

View File

@ -68,7 +68,10 @@ tools/gogio/bin/gogio:
mkdir -p tools/gogio/bin mkdir -p tools/gogio/bin
GOBIN=$(PWD)/tools/gogio/bin go install gioui.org/cmd/gogio@latest GOBIN=$(PWD)/tools/gogio/bin go install gioui.org/cmd/gogio@latest
gitea-release: .mktools build
release: gitea-release
gitea-release: .mktools build release-android
rm -rf .gitea-release rm -rf .gitea-release
mkdir -p .gitea-release mkdir -p .gitea-release
@ -81,7 +84,7 @@ gitea-release: .mktools build
cp ./bin/desktop_arm64 .gitea-release/arcad_player_linux_arm64 cp ./bin/desktop_arm64 .gitea-release/arcad_player_linux_arm64
cp ./bin/client .gitea-release/arcad_client_linux_amd64 cp ./bin/client .gitea-release/arcad_client_linux_amd64
cp ./android/app/build/outputs/apk/debug/app-debug.apk .gitea-release/arcast_player_debug.apk cp ./android/app/build/outputs/apk/release/app-release-unsigned.apk .gitea-release/arcast_player.apk
MKT_GITEA_RELEASE_PROJECT="arcast" \ MKT_GITEA_RELEASE_PROJECT="arcast" \
MKT_GITEA_RELEASE_ORG="arcad" \ MKT_GITEA_RELEASE_ORG="arcad" \