From e99f7259710500e930c7637804e5312ba7d6dc82 Mon Sep 17 00:00:00 2001 From: zontreck Date: Sat, 5 Oct 2024 19:52:25 -0700 Subject: [PATCH] Adds an arch builder environment --- AndroidSDK/Dockerfile | 6 +++--- ArchAgent/Dockerfile | 18 ++++++++++++++++++ ArchAgent/entrypoint.sh | 5 +++++ ArchBase/Dockerfile | 13 +++++++++++-- ArchBuilder/Dockerfile | 25 +++++++++++++++++++++++++ DebianBuilder/Dockerfile | 2 +- Jenkinsfile | 34 ++++++++++++++++++++++++++++++++++ Megapahit/arch/Dockerfile | 10 ++-------- build.bat | 12 +++++++++++- build.sh | 3 +++ docker-compose.yml | 7 +++++++ localbuild.sh | 1 + run.sh | 8 +++++++- 13 files changed, 128 insertions(+), 16 deletions(-) create mode 100644 ArchAgent/Dockerfile create mode 100644 ArchAgent/entrypoint.sh create mode 100644 ArchBuilder/Dockerfile diff --git a/AndroidSDK/Dockerfile b/AndroidSDK/Dockerfile index dec0eae..f76ff03 100644 --- a/AndroidSDK/Dockerfile +++ b/AndroidSDK/Dockerfile @@ -8,7 +8,7 @@ RUN curl -sO https://dl.google.com/android/repository/commandlinetools-linux-${A RUN unzip -qq /commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip -d $ANDROID_SDK_ROOT RUN rm -v /commandlinetools-linux-${ANDROID_SDK_VER}_latest.zip - +ADD packages.txt / FROM git.zontreck.com/ariascreations/buildenvironments:debianbuild @@ -32,7 +32,7 @@ WORKDIR /root RUN curl -s "https://get.sdkman.io" | bash -ADD packages.txt $HOME +COPY --from=ADK /packages.txt $HOME/packages.txt # Use SDK Manager to install necessary components RUN $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --update \ @@ -42,4 +42,4 @@ RUN $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} -- # Install Gradle RUN source "${HOME}/.sdkman/bin/sdkman-init.sh" \ - && sdk install gradle ${GRADLE_VERSION} + && sdk install gradle ${GRADLE_VERSION} diff --git a/ArchAgent/Dockerfile b/ArchAgent/Dockerfile new file mode 100644 index 0000000..6fee37f --- /dev/null +++ b/ArchAgent/Dockerfile @@ -0,0 +1,18 @@ +FROM git.zontreck.com/ariascreations/buildenvironments:archdev + + +WORKDIR /root/.gradle +ADD ./secret/gradle.properties ./gradle.properties + +WORKDIR /root/.ssh +ADD ./secret/id_rsa ./id_rsa +ADD ./secret/id_rsa.pub ./id_rsa.pub + +RUN chmod 0600 id_rsa + +WORKDIR / + +ADD ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ] \ No newline at end of file diff --git a/ArchAgent/entrypoint.sh b/ArchAgent/entrypoint.sh new file mode 100644 index 0000000..4d1c0fb --- /dev/null +++ b/ArchAgent/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +echo $PUB | dart pub token add https://git.zontreck.com/api/packages/AriasCreations/pub + +java -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -jar /agent.jar -url "https://ci.zontreck.com" -secret "$ARCHAGENT" -name "Arch" -workDir "/builder" diff --git a/ArchBase/Dockerfile b/ArchBase/Dockerfile index 14e6a3f..e626f76 100644 --- a/ArchBase/Dockerfile +++ b/ArchBase/Dockerfile @@ -6,8 +6,17 @@ LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com" SHELL [ "/bin/bash", "-c" ] ENV HOME /root ENV DOCKER 1 +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 USER root WORKDIR / -RUN echo yes | pacman -Syu -RUN echo yes | pacman -S rsync zip unzip file \ No newline at end of file +RUN pacman --noconfirm -Syu +RUN pacman --noconfirm -S rsync zip unzip file + + +RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment +RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +RUN echo "LANG=en_US.UTF-8" >> /etc/locale.conf + +RUN pacman --noconfirm -S locales +RUN locale-gen en_US.UTF-8 \ No newline at end of file diff --git a/ArchBuilder/Dockerfile b/ArchBuilder/Dockerfile new file mode 100644 index 0000000..cd3f8b3 --- /dev/null +++ b/ArchBuilder/Dockerfile @@ -0,0 +1,25 @@ +FROM git.zontreck.com/ariascreations/buildenvironments:arch + +RUN pacman --noconfirm -S base-devel gcc nasm git curl wget make cmake automake autoconf archiso squashfs-tools file + +RUN pacman --noconfirm -S ninja jdk17-openjdk sudo + +RUN useradd -m yay +RUN usermod -a yay -G wheel +RUN echo "yay ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +WORKDIR /tmp + +RUN git clone https://aur.archlinux.org/yay.git +RUN chown -R yay:yay /tmp/yay +WORKDIR /tmp/yay + +RUN su - yay -c "cd /tmp/yay && makepkg --noconfirm -si" + + +WORKDIR / + +RUN pacman --noconfirm -S python3 python-pip +RUN python3 -m pip config set global.break-system-packages true +RUN python3 -m pip install --upgrade pip + +RUN yay --noconfirm -S pkg-config lldb cargo gradle mercurial \ No newline at end of file diff --git a/DebianBuilder/Dockerfile b/DebianBuilder/Dockerfile index 3b27fd5..f2415e8 100644 --- a/DebianBuilder/Dockerfile +++ b/DebianBuilder/Dockerfile @@ -3,7 +3,7 @@ FROM git.zontreck.com/ariascreations/buildenvironments:debian ENV GRADLE_VERSION 8.3 RUN apt-get install -y build-essential -RUN apt-get install -y cmake ninja-build openjdk-17-jdk nasm git curl wget openjdk-17-jre clang pkg-config libgtk-3-dev lldb libglu1-mesa libpulse0 cargo python3-dev libffi-dev libssl-dev apt-utils fonts-liberation libgtk-4-1 libgbm1 libu2f-udev libvulkan1 xdg-utils gradle nasm +RUN apt-get install -y cmake ninja-build openjdk-17-jdk nasm git curl wget openjdk-17-jre clang pkg-config libgtk-3-dev lldb libglu1-mesa libpulse0 cargo python3-dev libffi-dev libssl-dev apt-utils fonts-liberation libgtk-4-1 libgbm1 libu2f-udev libvulkan1 xdg-utils gradle nasm mercurial WORKDIR /root/.ssh diff --git a/Jenkinsfile b/Jenkinsfile index 138fc22..ac65db2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -181,6 +181,40 @@ pipeline { } } + stage("Build Arch Base") { + agent { + label "dockermain" + } + + steps { + script { + sh ''' + #!/bin/bash + + docker build -t git.zontreck.com/ariascreations/buildenvironments:arch ArchBase + docker push git.zontreck.com/ariascreations/buildenvironments:arch + ''' + } + } + } + + stage("Build Arch Develop") { + agent { + label "dockermain" + } + + steps { + script { + sh ''' + #!/bin/bash + + docker build -t git.zontreck.com/ariascreations/buildenvironments:archdev ArchBuilder + docker push git.zontreck.com/ariascreations/buildenvironments:archdev + ''' + } + } + } + stage("Clean Up Caches") { agent { label "dockermain" diff --git a/Megapahit/arch/Dockerfile b/Megapahit/arch/Dockerfile index 37e65c9..d6b6999 100644 --- a/Megapahit/arch/Dockerfile +++ b/Megapahit/arch/Dockerfile @@ -1,11 +1,5 @@ -FROM git.zontreck.com/ariascreations/buildenvironments:arch - -RUN echo yes | pacman -S python3 python-pip -RUN python3 -m pip config set global.break-system-packages true -RUN python3 -m pip install --upgrade pip - -RUN pip install llbase autobuild llsd +FROM git.zontreck.com/ariascreations/buildenvironments:archdev ADD fmodstudioapi20223linux.tar.gz /fmod.tar.gz -RUN echo yes | pacman -S base-devel cmake git \ No newline at end of file +RUN pip install llbase autobuild \ No newline at end of file diff --git a/build.bat b/build.bat index 6e5e59d..88a9b7d 100644 --- a/build.bat +++ b/build.bat @@ -20,4 +20,14 @@ docker build -t git.zontreck.com/ariascreations/buildenvironments:linuxfs Firest docker push git.zontreck.com/ariascreations/buildenvironments:linuxfs docker build -t git.zontreck.com/ariascreations/buildenvironments:linux LinuxGeneralCompiler -docker push git.zontreck.com/ariascreations/buildenvironments:linux \ No newline at end of file +docker push git.zontreck.com/ariascreations/buildenvironments:linux + + +docker build -t git.zontreck.com/ariascreations/buildenvironments:arch ArchBase +docker push git.zontreck.com/ariascreations/buildenvironments:arch + +docker build -t git.zontreck.com/ariascreations/buildenvironments:archdev ArchBuilder +docker push git.zontreck.com/ariascreations/buildenvironments:archdev + +docker build -t git.zontreck.com/ariascreations/buildenvironments:archmegapahit Megapahit/arch +docker push git.zontreck.com/ariascreations/buildenvironments:archmegapahit \ No newline at end of file diff --git a/build.sh b/build.sh index 53996a6..1d4b1cf 100644 --- a/build.sh +++ b/build.sh @@ -26,5 +26,8 @@ docker push git.zontreck.com/ariascreations/buildenvironments:linux docker build -t git.zontreck.com/ariascreations/buildenvironments:arch ArchBase docker push git.zontreck.com/ariascreations/buildenvironments:arch +docker build -t git.zontreck.com/ariascreations/buildenvironments:archdev ArchBuilder +docker push git.zontreck.com/ariascreations/buildenvironments:archdev + docker build -t git.zontreck.com/ariascreations/buildenvironments:archmegapahit Megapahit/arch docker push git.zontreck.com/ariascreations/buildenvironments:archmegapahit \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index ed9c211..d688c1c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,13 @@ services: env_file: .env networks: - buildenv + arch: + image: git.zontreck.com/ariascreations/buildenvironments:archagent + container_name: arch + restart: unless-stopped + env_file: .env + networks: + - buildenv networks: buildenv: \ No newline at end of file diff --git a/localbuild.sh b/localbuild.sh index a9e53f1..e43f988 100755 --- a/localbuild.sh +++ b/localbuild.sh @@ -9,4 +9,5 @@ docker build -t git.zontreck.com/ariascreations/buildenvironments:linuxfs Firest docker build -t git.zontreck.com/ariascreations/buildenvironments:linux LinuxGeneralCompiler docker build -t git.zontreck.com/ariascreations/buildenvironments:arch ArchBase +docker build -t git.zontreck.com/ariascreations/buildenvironments:archdev ArchBuilder docker build -t git.zontreck.com/ariascreations/buildenvironments:archmegapahit Megapahit/arch \ No newline at end of file diff --git a/run.sh b/run.sh index 1247eb4..cdcb8fb 100644 --- a/run.sh +++ b/run.sh @@ -14,9 +14,15 @@ cp "$PRIVKEY" LinuxGeneralCompiler/FinalStage/secret/id_rsa cp "$PUBKEY" LinuxGeneralCompiler/FinalStage/secret/id_rsa.pub cp "$GRADLEPROP" LinuxGeneralCompiler/FinalStage/secret/gradle.properties +cp -rv LinuxGeneralCompiler/FinalStage/secret ArchAgent/secret + +echo -ne "\nARCHAGENT=" >> .env +cat "$ARCHAGENT" >> .env + docker build -t linuxagent LinuxGeneralCompiler/FinalStage +docker build -t archagent ArchAgent rm -rf LinuxGeneralCompiler/FinalStage/secret - +rm -rf ArchAgent/secret docker-compose up -d \ No newline at end of file