Remove secret values

This commit is contained in:
zontreck 2024-09-13 01:21:03 -07:00
parent 917713c312
commit a4c6f91e47
8 changed files with 239 additions and 16 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.env

View file

@ -3,6 +3,8 @@ FROM ubuntu:jammy
LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com" LABEL author="Tara Piccari" maintainer="tarapiccari@gmail.com"
SHELL [ "/bin/bash", "-c" ] SHELL [ "/bin/bash", "-c" ]
ENV AGENT NAN
ENV DOCKER 1 ENV DOCKER 1
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
@ -32,11 +34,12 @@ WORKDIR /firestorm
RUN echo "#!/bin/bash" >> installables.sh RUN echo "#!/bin/bash" >> installables.sh
RUN echo "autobuild installables edit fmodstudio platform=linux64 hash=$(md5sum linux-fmod.tar.bz2) url=file:///firestorm/linux-fmod.tar.bz2" >> installables.sh RUN echo "autobuild installables edit fmodstudio platform=linux64 hash=$(md5sum linux-fmod.tar.bz2) url=file:///firestorm/linux-fmod.tar.bz2" >> installables.sh
ADD agent.secret /agent.secret
WORKDIR / WORKDIR /
ADD ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN curl -sO https://ci.zontreck.com/jnlpJars/agent.jar RUN curl -sO https://ci.zontreck.com/jnlpJars/agent.jar
ENTRYPOINT [ "java", "-Dfile.encoding=UTF-8", "-Dsun.jnu.encoding=UTF-8", "-jar", "/agent.jar", "-url", "https://ci.zontreck.com", "-secret", "@/agent.secret", "-name", "LinuxFS", "-workDir", "/builder" ] ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

View file

@ -0,0 +1,3 @@
#!/bin/bash
java -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -jar /agent.jar -url "https://ci.zontreck.com" -secret "$AGENT" -name "Linux" -workDir "/builder"

178
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,178 @@
pipeline {
agent any
options {
buildDiscarder(
logRotator(
numToKeepStr: '5'
)
)
}
stages {
stage("Clean Up Repo") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
git reset --hard
git clean -xfd
'''
}
}
stage("Clean Docker Caches") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker system prune --volumes -f
'''
}
}
stage("Stop Workers") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker-compose down
docker stop linuxbuilder || true
docker stop linuxfs || true
'''
}
}
stage("Build Debian Base") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker build -t git.zontreck.com/ariascreations/buildenvironments:debian DebianBase
docker push git.zontreck.com/ariascreations/buildenvironments:debian
'''
}
}
stage("Builder Debian Compiler") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker build -t git.zontreck.com/ariascreations/buildenvironments:debianbuild DebianBuilder
docker push git.zontreck.com/ariascreations/buildenvironments:debianbuild
'''
}
}
stage("Build ADK") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker build -t git.zontreck.com/ariascreations/buildenvironments:adk AndroidSDK
docker push git.zontreck.com/ariascreations/buildenvironments:adk
'''
}
}
stage("Build Flutter") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker build -t git.zontreck.com/ariascreations/buildenvironments:flutter FlutterSdk
docker push git.zontreck.com/ariascreations/buildenvironments:flutter
'''
}
}
stage("Build AppImage Layer") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker build -t git.zontreck.com/ariascreations/buildenvironments:appimage AppImage
docker push git.zontreck.com/ariascreations/buildenvironments:appimage
'''
}
}
stage("Build Linux Node") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker build -t git.zontreck.com/ariascreations/buildenvironments:linux LinuxGeneralCompiler
docker push git.zontreck.com/ariascreations/buildenvironments:linux
'''
}
}
stage("Build Linux Firestorm Node") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker build -t git.zontreck.com/ariascreations/buildenvironments:linuxfs FirestormLinux
docker push git.zontreck.com/ariascreations/buildenvironments:linuxfs
'''
}
}
stage("Clean Docker Caches") {
agent {
label dockermain
}
script {
sh '''
#!/bin/bash
docker system prune --volumes -f
'''
}
}
}
}

View file

@ -1,19 +1,16 @@
FROM git.zontreck.com/ariascreations/buildenvironments:appimage FROM git.zontreck.com/ariascreations/buildenvironments:appimage
COPY ./agent.secret /agent.secret ENV PUB NAN
ENV AGENT NAN
ENV GRADLEPROP NAN
ENV PRIVKEY NAN
ENV PUBKEY NAN
WORKDIR /
RUN curl -sO https://ci.zontreck.com/jnlpJars/agent.jar RUN curl -sO https://ci.zontreck.com/jnlpJars/agent.jar
ADD pub.secret /
RUN cat /pub.secret | dart pub token add https://git.zontreck.com/api/packages/AriasCreations/pub
WORKDIR /root/.ssh
ADD ./id_rsa ./id_rsa
ADD ./id_rsa.pub ./id_rsa.pub
RUN chmod 0600 id_rsa
WORKDIR /root/.gradle
ADD ./gradle.properties ./
WORKDIR / WORKDIR /
ADD ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "java", "-Dfile.encoding=UTF-8", "-Dsun.jnu.encoding=UTF-8", "-jar", "/agent.jar", "-url", "https://ci.zontreck.com", "-secret", "@/agent.secret", "-name", "Linux", "-workDir", "/builder" ] ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

View file

@ -0,0 +1,13 @@
#!/bin/bash
echo $PUB | dart pub token add https://git.zontreck.com/api/packages/AriasCreations/pub
mkdir -pv ~/.gradle
echo $GRADLEPROP | base64 -d > ~/.gradle/gradle.properties
mkdir -pv ~/.ssh
echo "$PRIVKEY" | base64 -d > ~/.ssh/id_rsa
echo "$PUBKEY" | base64 -d > ~/.ssh/id_rsa.pub
chmod 0600 ~/.ssh/id_rsa
java -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -jar /agent.jar -url "https://ci.zontreck.com" -secret "$AGENT" -name "Linux" -workDir "/builder"

View file

@ -5,12 +5,20 @@ services:
image: git.zontreck.com/ariascreations/buildenvironments:linux image: git.zontreck.com/ariascreations/buildenvironments:linux
container_name: linuxbuilder container_name: linuxbuilder
restart: unless-stopped restart: unless-stopped
environment:
- AGENT=${AGENT}
- GRADLEPROP=${GRADLEPROP}
- PUB=${PUB}
- PRIVKEY=${PRIVKEY}
- PUBKEY=${PUBKEY}
networks: networks:
- buildenv - buildenv
linuxfs: linuxfs:
image: git.zontreck.com/ariascreations/buildenvironments:linuxfs image: git.zontreck.com/ariascreations/buildenvironments:linuxfs
container_name: linuxfs container_name: linuxfs
restart: unless-stopped restart: unless-stopped
environment:
- AGENT=${FSAGENT}
networks: networks:
- buildenv - buildenv

20
run.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/bash
echo "AGENT=$AGENT" > .env
echo -ne "GRADLEPROP=" >> .env
cat $GRADLEPROP | base64 >> .env
echo "PUB=$PUB" >> .env
echo -ne "PRIVKEY=" >> .env
cat $PRIVKEY | base64 >> .env
echo -ne "PUBKEY=" >> .env
cat $PUBKEY | base64 >> .env
echo "FSAGENT=$FSAGENT" >> .env
docker-compose up -d