Scrub secrets

Noah 2022-09-24 17:48:48 -07:00
parent a9dbb8c418
commit 2551b33336
6 changed files with 35 additions and 218 deletions

View File

@ -13,7 +13,6 @@ ENV GOPROXY direct
ENV PATH /opt/go/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/go/bin
# Debian: Update all software and get dependencies.
# RUN dnf -y update
RUN apt update && apt -y upgrade && apt -y dist-upgrade
RUN apt -y install git zip tar libsdl2-dev libsdl2-ttf-dev \
libsdl2-mixer-dev gcc-mingw-w64-i686 gcc make wget \
@ -25,18 +24,16 @@ RUN useradd builder -u 1000 -m -G users && \
# Download and install modern Go.
WORKDIR /root
RUN wget https://golang.org/dl/go1.17.1.linux-386.tar.gz -O go.tgz && \
RUN wget https://go.dev/dl/go1.19.1.linux-386.tar.gz -O go.tgz && \
tar -xzvf go.tgz && \
cp -r go /opt/go
# Docker cache invalidation here.
# ADD . /home/builder
# Git clone all the repos. XXX: passwords exposed here
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-rtp /git/rtp
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-vendor /git/vendor
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-masters /git/masters
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle /go/src/git.kirsle.net/apps/doodle
# Git clone all the repos.
RUN git clone https://git.kirsle.net/SketchyMaze/rtp /git/rtp
RUN git clone https://git.kirsle.net/SketchyMaze/vendor /git/vendor
RUN git clone https://git.kirsle.net/SketchyMaze/assets /git/assets
RUN git clone https://git.kirsle.net/SketchyMaze/doodle /go/src/git.kirsle.net/SketchyMaze/doodle
RUN git clone https://git.kirsle.net/SketchyMaze/doodads /go/src/git.kirsle.net/SketchyMaze/doodle/deps/doodads
# MinGW setup for Windows executable cross-compile.
WORKDIR /git/vendor/mingw-libs
@ -53,7 +50,7 @@ RUN git clone https://git.kirsle.net/go/render /git/go/render
RUN git clone https://git.kirsle.net/go/audio /git/go/audio
# Enter Doodle's directory, patch the go.mod and fetch the guidebook.
WORKDIR /go/src/git.kirsle.net/apps/doodle
WORKDIR /go/src/git.kirsle.net/SketchyMaze/doodle
RUN echo "replace git.kirsle.net/go/ui => /git/go/ui" >> go.mod && \
echo "replace git.kirsle.net/go/render => /git/go/render" >> go.mod && \
echo "replace git.kirsle.net/go/audio => /git/go/audio" >> go.mod && \
@ -63,9 +60,12 @@ RUN echo "replace git.kirsle.net/go/ui => /git/go/ui" >> go.mod && \
# Install Go dependencies and such.
RUN make setup
# Install the doodad tool into our $PATH.
RUN make install
# Copy default vendored assets in.
RUN cp -r /git/vendor/fonts ./assets/fonts && \
cp -r /git/masters/levelpacks/levelpacks ./assets/levelpacks && \
cp -r /git/assets/levelpacks/levelpacks ./assets/levelpacks && \
mkdir rtp && cp -r /git/rtp/* rtp/
RUN ls -hal && pwd
@ -87,5 +87,5 @@ RUN gem install fpm; exit 0
RUN make mingw32-release
CMD ["cp", "-r", "-v", \
"/go/src/git.kirsle.net/apps/doodle/dist/release/", \
"/go/src/git.kirsle.net/SketchyMaze/doodle/dist/release/", \
"/mnt/export/"]

View File

@ -1,102 +0,0 @@
##
# Fully build and distribute Linux and Windows binaries for Project: Doodle.
#
# Artifact outputs will be in the dist/mw/ folder.
#
# Windows binary cross-compiled with mingw from the Fedora
# docker container.
##
FROM fedora:latest
ENV GOPATH /go
ENV GOPROXY direct
ENV PATH /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/go/bin
# Fedora: Update all software and get dependencies.
# RUN dnf -y update
RUN dnf -y install git zip tar golang SDL2-devel SDL2_ttf-devel \
SDL2_mixer-devel mingw64-gcc make wget \
flatpak-builder ruby-devel gcc rpm-build libffi-devel
# Create a user to build the packages.
RUN useradd builder -u 1000 -m -G users && \
mkdir /go /git && chown -R builder:users /go /git
# Docker cache invalidation here.
# ADD . /home/builder
# Git clone all the repos. XXX: passwords exposed here
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-rtp /git/rtp
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-vendor /git/vendor
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-masters /git/masters
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle /go/src/git.kirsle.net/apps/doodle
# MinGW setup for Windows executable cross-compile.
WORKDIR /git/vendor/mingw-libs
RUN for i in *.tar.gz; do tar -xzvf $i; done
RUN cp -rv SDL2-2.0.9/x86_64-w64-mingw32 /usr && \
cp -rv SDL2_mixer-2.0.4/x86_64-w64-mingw32 /usr && \
cp -rv SDL2_ttf-2.0.15/x86_64-w64-mingw32 /usr
RUN mkdir -p /usr/lib/golang/pkg/windows_amd64 && \
chown -R builder:users /usr/lib/golang/pkg/windows_amd64
# Pre-download my Go render engine libraries
RUN git clone https://git.kirsle.net/go/ui /git/go/ui
RUN git clone https://git.kirsle.net/go/render /git/go/render
RUN git clone https://git.kirsle.net/go/audio /git/go/audio
# Enter Doodle's directory, patch the go.mod and fetch the guidebook.
WORKDIR /go/src/git.kirsle.net/apps/doodle
RUN echo "replace git.kirsle.net/go/ui => /git/go/ui" >> go.mod && \
echo "replace git.kirsle.net/go/render => /git/go/render" >> go.mod && \
echo "replace git.kirsle.net/go/audio => /git/go/audio" >> go.mod && \
cat go.mod && \
wget -O - https://download.sketchymaze.com/guidebook.tar.gz | tar -xzvf -
# Install Go dependencies and such.
RUN make setup
# Copy default vendored assets in.
RUN cp -r /git/vendor/fonts ./assets/fonts && \
cp -r /git/masters/levelpacks/levelpacks ./assets/levelpacks && \
mkdir rtp && cp -r /git/rtp/* rtp/
RUN ls -hal && pwd
RUN mkdir -p bin && cp /git/vendor/DLL/*.dll bin/
# Package rpm and deb for Linux.
# TODO: fpm doesn't like to install in Docker right now
# RUN dnf -y install ruby-devel gcc rpm-build libffi-devel
RUN gem install fpm; exit 0
# Run the big mingw-release, which:
# - builds the doodads
# - embeds the bindata files
# - builds the program for Linux
# - builds for Windows via MinGW
# - runs `make dist/` creating an uber build for both OS's
# - runs release.sh to carve out the Linux and Windows versions and
# zip them all up nicely.
RUN make mingw-release
###
# Build the Flatpak release for Linux.
# RUN git clone https://code.sketchymaze.com/game/flatpak /git/flatpak
# # Fetch flatpak dependencies.
# RUN flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo && \
# flatpak install -y org.freedesktop.Sdk//21.08 && \
# flatpak install -y org.freedesktop.Sdk.Extension.golang//21.08
# # Path the go.mod `replace` directives to Flatpak's sandbox paths,
# # then build the Flatpak.
# RUN sed -i 's/=> \/git\/go\//=> \/run\/build\/sketchymaze\/deps\//g' go.mod && \
# cat go.mod
# WORKDIR /git/flatpak
# RUN make bundle; exit 0
# WORKDIR /go/src/git.kirsle.net/apps/doodle
CMD ["sudo", "cp", "-r", "-v", \
"/go/src/git.kirsle.net/apps/doodle/dist/release/", \
# "/git/flatpak/*.flatpak", \
"/mnt/export/"]

View File

@ -13,7 +13,6 @@ ENV GOPROXY direct
ENV PATH /opt/go/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/go/bin
# Debian: Update all software and get dependencies.
# RUN dnf -y update
RUN apt update && apt -y upgrade && apt -y dist-upgrade
RUN apt -y install git zip tar libsdl2-dev libsdl2-ttf-dev \
libsdl2-mixer-dev gcc-mingw-w64-x86-64 gcc make wget \
@ -25,18 +24,16 @@ RUN useradd builder -u 1000 -m -G users && \
# Download and install modern Go.
WORKDIR /root
RUN wget https://go.dev/dl/go1.17.7.linux-amd64.tar.gz -O go.tgz && \
RUN wget https://go.dev/dl/go1.19.1.linux-amd64.tar.gz -O go.tgz && \
tar -xzvf go.tgz && \
cp -r go /opt/go
# Docker cache invalidation here.
# ADD . /home/builder
# Git clone all the repos. XXX: passwords exposed here
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-rtp /git/rtp
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-vendor /git/vendor
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-masters /git/masters
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle /go/src/git.kirsle.net/apps/doodle
# Git clone all the repos.
RUN git clone https://git.kirsle.net/SketchyMaze/rtp /git/rtp
RUN git clone https://git.kirsle.net/SketchyMaze/vendor /git/vendor
RUN git clone https://git.kirsle.net/SketchyMaze/assets /git/assets
RUN git clone https://git.kirsle.net/SketchyMaze/doodle /go/src/git.kirsle.net/SketchyMaze/doodle
RUN git clone https://git.kirsle.net/SketchyMaze/doodads /go/src/git.kirsle.net/SketchyMaze/doodle/deps/doodads
# MinGW setup for Windows executable cross-compile.
WORKDIR /git/vendor/mingw-libs
@ -53,7 +50,7 @@ RUN git clone https://git.kirsle.net/go/render /git/go/render
RUN git clone https://git.kirsle.net/go/audio /git/go/audio
# Enter Doodle's directory, patch the go.mod and fetch the guidebook.
WORKDIR /go/src/git.kirsle.net/apps/doodle
WORKDIR /go/src/git.kirsle.net/SketchyMaze/doodle
RUN echo "replace git.kirsle.net/go/ui => /git/go/ui" >> go.mod && \
echo "replace git.kirsle.net/go/render => /git/go/render" >> go.mod && \
echo "replace git.kirsle.net/go/audio => /git/go/audio" >> go.mod && \
@ -61,13 +58,14 @@ RUN echo "replace git.kirsle.net/go/ui => /git/go/ui" >> go.mod && \
wget -O - https://download.sketchymaze.com/guidebook.tar.gz | tar -xzvf -
# Install Go dependencies and such.
RUN touch /tmp/bre
RUN find /opt/go/bin
RUN make setup
# Install the doodad tool into our $PATH.
RUN make install
# Copy default vendored assets in.
RUN cp -r /git/vendor/fonts ./assets/fonts && \
cp -r /git/masters/levelpacks/levelpacks ./assets/levelpacks && \
cp -r /git/assets/levelpacks/levelpacks ./assets/levelpacks && \
mkdir rtp && cp -r /git/rtp/* rtp/
RUN ls -hal && pwd
@ -89,5 +87,5 @@ RUN gem install fpm; exit 0
RUN make mingw-release
CMD ["cp", "-r", "-v", \
"/go/src/git.kirsle.net/apps/doodle/dist/release/", \
"/go/src/git.kirsle.net/SketchyMaze/doodle/dist/release/", \
"/mnt/export/"]

View File

@ -1,82 +0,0 @@
##
# Fully build and distribute MacOS releases cross-compiled from Linux.
#
# Artifact outputs will be in the dist/mac/ folder.
#
# WORK IN PROGRESS.
##
FROM manjaro:latest
MAINTAINER Noah Petherbridge <root@kirsle.net>
ENV GOPATH /go
ENV GOPROXY direct
ENV PATH /bin:/sbin:/usr/bin:/usr/sbin:/go/bin
# Manjaro: Update all software and get dependencies.
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm go sdl2 sdl2_ttf sdl2_mixer pkg-config
# Get the OS X cross compile toolchain.
RUN git clone https://github.com/tpoechtrager/osxcross /git/osxcross &&
cd /git/osxcross &&
makepkg -si
# Create a user to build the packages.
RUN useradd builder -u 1000 -m -G users && \
mkdir /go /git && chown -R builder:users /go /git
# Docker cache invalidation here.
# ADD . /home/builder
# Git clone all the repos. XXX: passwords exposed here
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-rtp /git/rtp
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-vendor /git/vendor
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-masters /git/masters
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle /go/src/git.kirsle.net/apps/doodle
# Pre-download my Go render engine libraries
RUN git clone https://git.kirsle.net/go/ui /git/go/ui
RUN git clone https://git.kirsle.net/go/render /git/go/render
RUN git clone https://git.kirsle.net/go/audio /git/go/audio
# Enter Doodle's directory.
WORKDIR /go/src/git.kirsle.net/apps/doodle
RUN echo "replace git.kirsle.net/go/ui => /git/go/ui" >> go.mod && \
echo "replace git.kirsle.net/go/render => /git/go/render" >> go.mod && \
echo "replace git.kirsle.net/go/audio => /git/go/audio" >> go.mod && \
cat go.mod
# Install Go dependencies and such.
RUN go get -u git.kirsle.net/go/bindata/...
RUN make bindata-dev
RUN make setup
# Copy default vendored assets in.
RUN cp -r /git/vendor/fonts ./assets/fonts && \
cp -r /git/masters/levels ./assets/levels && \
mkdir rtp && cp -r /git/rtp/* rtp/
# MinGW setup for Windows executable cross-compile.
WORKDIR /git/vendor/mingw-libs
RUN for i in *.tar.gz; do tar -xzvf $i; done
RUN cp -rv SDL2-2.0.9/x86_64-w64-mingw32 /usr && \
cp -rv SDL2_mixer-2.0.4/x86_64-w64-mingw32 /usr && \
cp -rv SDL2_ttf-2.0.15/x86_64-w64-mingw32 /usr
RUN mkdir -p /usr/lib/go/pkg/windows_amd64 && \
chown -R builder:users /usr/lib/go/pkg/windows_amd64
WORKDIR /go/src/git.kirsle.net/apps/doodle
RUN make mingw
RUN cp /git/vendor/DLL/*.dll bin/
RUN make dist
# Package rpm and deb for Linux.
# TODO: fpm doesn't like to install in Docker right now
# RUN dnf -y install ruby-devel gcc rpm-build libffi-devel
# RUN gem install fpm; exit 0
# WORKDIR /go/src/git.kirsle.net/apps/doodle/dist/doodle-latest
# RUN pwd
# RUN ../../scripts/fpm-bundle.sh
CMD ["sudo", "cp", "-r", "-v", "/go/src/git.kirsle.net/apps/doodle/dist/", "/mnt/export/"]

View File

@ -8,19 +8,22 @@ SHELL := /bin/bash
.PHONY: clean
clean:
rm -rf ./dist
docker system prune -a
podman system prune -a
podman system reset
.PHONY: 64bit
64bit:
mkdir -p ./dist/64bit
echo pwd is $(shell pwd)
docker build -t doodle_64bit -f ./64bit.dockerfile .
docker run --rm --mount type=bind,src=$(shell pwd)/dist/64bit,dst=/mnt/export doodle_64bit
podman build -t doodle_64bit -f ./64bit.dockerfile .
podman run --rm --mount type=bind,src=$(shell pwd)/dist/64bit,dst=/mnt/export doodle_64bit
.PHONY: 32bit
32bit:
mkdir -p ./dist/32bit
echo pwd is $(shell pwd)
docker build -t doodle_32bit -f ./32bit.dockerfile .
docker run --rm --mount type=bind,src=$(shell pwd)/dist/32bit,dst=/mnt/export doodle_32bit
podman build -t doodle_32bit -f ./32bit.dockerfile .
podman run --rm --mount type=bind,src=$(shell pwd)/dist/32bit,dst=/mnt/export doodle_32bit
.PHONY: all
all: 64bit 32bit

View File

@ -14,7 +14,7 @@ Run `make setup` to add flathub (--if-not-exists) and download the dependency
layers.
```
make mingw
make 64bit
```
Podman tip: `podman system reset` to nuke all of it, cached images and build