Skip to content

Commit

Permalink
Merge cb500a6 into bd9580a
Browse files Browse the repository at this point in the history
  • Loading branch information
herpiko authored Jan 10, 2022
2 parents bd9580a + cb500a6 commit 6560036
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func BuildPackage(payload string) (next string, err error) {

// Building the package
cmdStr = "docker run -v " + irgshConfig.Builder.Workdir + "/artifacts/" + raw["taskUUID"].(string)
cmdStr += ":/tmp/build --privileged=true -i pbocker bash -c /build.sh"
cmdStr += ":/tmp/build --privileged=true -i pbocker bash -c /build.sh" // See builder/init.go to modify this script
fmt.Println(cmdStr)
_, err = systemutil.CmdExec(
cmdStr,
Expand Down
4 changes: 3 additions & 1 deletion cmd/builder/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,14 @@ func InitBuilder() (err error) {
return
}

// build.sh script is written here.
// We're only taking the *.deb and *.buildinfo (if any) files from pbuilder result
cmdStr = `echo 'FROM debian:latest' > ` + irgshConfig.Builder.Workdir + `/pbocker/Dockerfile && \
echo 'RUN apt-get update && apt-get -y install pbuilder' >> ` + irgshConfig.Builder.Workdir + `/pbocker/Dockerfile && \
echo 'RUN echo "MIRRORSITE=` + irgshConfig.Builder.UpstreamDistUrl + `" > /root/.pbuilderrc' >> ` + irgshConfig.Builder.Workdir + `/pbocker/Dockerfile && \
echo 'RUN echo "USENETWORK=yes"' >> ` + irgshConfig.Builder.Workdir + `/pbocker/Dockerfile && \
echo 'COPY base.tgz /var/cache/pbuilder/' >> ` + irgshConfig.Builder.Workdir + `/pbocker/Dockerfile && \
echo 'RUN echo "pbuilder --build /tmp/build/*.dsc && cp -vR /var/cache/pbuilder/result/* /tmp/build/" > /build.sh && chmod a+x /build.sh' >> ` + irgshConfig.Builder.Workdir + `/pbocker/Dockerfile`
echo 'RUN echo "pbuilder --build /tmp/build/*.dsc \n cp -vR /var/cache/pbuilder/result/*.deb /tmp/build/ \n cp -vR /var/cache/pbuilder/result/*.buildinfo /tmp/build/ || true" > /build.sh && chmod a+x /build.sh' >> ` + irgshConfig.Builder.Workdir + `/pbocker/Dockerfile`
_, err = systemutil.CmdExec(
cmdStr,
"Preparing Dockerfile",
Expand Down

0 comments on commit 6560036

Please sign in to comment.