diff --git a/LinuxGeneralCompiler/Dockerfile b/LinuxGeneralCompiler/Dockerfile index 4991430..2c98a84 100644 --- a/LinuxGeneralCompiler/Dockerfile +++ b/LinuxGeneralCompiler/Dockerfile @@ -2,9 +2,6 @@ FROM git.zontreck.com/ariascreations/buildenvironments:appimage 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 diff --git a/LinuxGeneralCompiler/FinalStage/Dockerfile b/LinuxGeneralCompiler/FinalStage/Dockerfile new file mode 100644 index 0000000..108e34b --- /dev/null +++ b/LinuxGeneralCompiler/FinalStage/Dockerfile @@ -0,0 +1,14 @@ +FROM git.zontreck.com/ariascreations/buildenvironments:linux + +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 / + +ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ] \ No newline at end of file diff --git a/LinuxGeneralCompiler/entrypoint.sh b/LinuxGeneralCompiler/entrypoint.sh index 4680fff..b8ed0ba 100644 --- a/LinuxGeneralCompiler/entrypoint.sh +++ b/LinuxGeneralCompiler/entrypoint.sh @@ -2,12 +2,4 @@ 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" diff --git a/docker-compose.yml b/docker-compose.yml index a4f42f5..b8e13c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: linuxbuilder: - image: git.zontreck.com/ariascreations/buildenvironments:linux + image: LinuxAgent container_name: linuxbuilder restart: unless-stopped env_file: .env diff --git a/run.sh b/run.sh index 8193907..2e65ca5 100644 --- a/run.sh +++ b/run.sh @@ -3,20 +3,18 @@ echo -ne "AGENT=" > .env cat "$AGENT" >> .env -echo -ne "\nGRADLEPROP=" >> .env -cat "$GRADLEPROP" | base64 >> .env - -echo -ne "\nPUB" >> .env +echo -ne "\nPUB=" >> .env cat "$PUB" >> .env -echo -ne "\nPRIVKEY=" >> .env -cat "$PRIVKEY" | base64 >> .env - -echo -ne "\nPUBKEY=" >> .env -cat "$PUBKEY" | base64 >> .env - -echo -ne"\nFSAGENT=" >> .env +echo -ne "\nFSAGENT=" >> .env cat "$FSAGENT" >> .env +mkdir -pv LinuxGeneralCompiler/FinalStage/secret +cp "$PRIVKEY" LinuxGeneralCompiler/FinalStage/secret/id_rsa +cp "$PUBKEY" LinuxGeneralCompiler/FinalStage/secret/id_rsa.pub +cp "$GRADLEPROP" LinuxGeneralCompiler/FinalStage/secret/gradle.properties + +docker build -t LinuxAgent LinuxGeneralCompiler/FinalStage + docker-compose up -d \ No newline at end of file