Skip to content

Commit

Permalink
chore: update dos games (#2845)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
  • Loading branch information
AustinAbro321 authored Aug 7, 2024
1 parent 2485de9 commit 02f2932
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 63 deletions.
14 changes: 2 additions & 12 deletions examples/dos-games/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,9 @@ RUN wget https://js-dos.com/6.22/current/js-dos.js && \
wget https://js-dos.com/6.22/current/wdosbox.js && \
wget https://js-dos.com/6.22/current/wdosbox.wasm.js

RUN wget -O aladdin.zip "https://web.archive.org/web/20190303222445if_/https://www.dosgames.com/files/DOSBOX_ALADDIN.ZIP"
RUN wget -O doom.zip "https://archive.org/download/DoomsharewareEpisode/doom.ZIP"
RUN wget -O mario-brothers.zip "https://image.dosgamesarchive.com/games/mario-bro.zip"
RUN wget -O prince-of-persia.zip "https://web.archive.org/web/20181030180256if_/http://image.dosgamesarchive.com/games/pop1.zip"
RUN wget -O quake.zip "https://web.archive.org/web/20190303223506if_/https://www.dosgames.com/files/DOSBOX_QUAKE.ZIP"
RUN wget -O warcraft-ii.zip "https://web.archive.org/web/20190303222732if_/https://www.dosgames.com/files/DOSBOX_WAR2.ZIP"

RUN wget -O aladdin.png "https://image.dosgamesarchive.com/screenshots/aladdem-4.png" && \
wget -O doom.png "https://image.dosgamesarchive.com/screenshots/doom01.png" && \
wget -O mario-brothers.png "https://image.dosgamesarchive.com/screenshots/marionl-6.png" && \
wget -O prince-of-persia.png "https://image.dosgamesarchive.com/screenshots/prince102.png" && \
wget -O quake.png "https://image.dosgamesarchive.com/screenshots/quake13.png" && \
wget -O warcraft-ii.png "https://image.dosgamesarchive.com/screenshots/war2demo3.png"
RUN wget -O doom.png "https://image.dosgamesarchive.com/screenshots/doom01.png"


COPY index.html .
Expand All @@ -34,4 +24,4 @@ COPY --from=0 /binary /binary
WORKDIR /site
ENTRYPOINT ["/binary/darkhttpd", "/site", "--port", "8000"]

# docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag defenseunicorns/zarf-game:multi-tile .
# docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/zarf-dev/doom-game:0.0.1 .
22 changes: 3 additions & 19 deletions examples/dos-games/image/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
}

.column img {
margin-top: 8px;
margin-top: 16px;
vertical-align: middle;
width: 100%;
height: auto;
}

/* Responsive layout - makes a two column-layout instead of four columns */
Expand All @@ -70,22 +71,14 @@
}
}
</style>
</style>
</head>

<body>
<canvas id="jsdos" style="display: none;"></canvas>
<script>
const game = location.search.substr(1)
const gamePaths = {
'aladdin': 'ALADDIN.EXE',
'doom': 'DOOM.EXE',
'mario-brothers': 'MARIO.BAT',
'mega-man-x': 'MMXDEMO.EXE',
'prince-of-persia': 'pop1demo.exe',
'quake': 'QUAKE.EXE',
'sim-city-2k': 'SC2000.EXE',
'warcraft-ii': 'WAR2.EXE',
}

if (gamePaths[game]) {
Expand All @@ -101,15 +94,6 @@

<div class="row">
<div class="column">
<a href="?aladdin"><img src="aladdin.png" style="width:100%"></a>
<a href="?doom"><img src="doom.png" style="width:100%"></a>
</div>
<div class="column">
<a href="?mario-brothers"><img src="mario-brothers.png" style="width:100%"></a>
<a href="?prince-of-persia"><img src="prince-of-persia.png" style="width:100%"></a>
</div>
<div class="column">
<a href="?quake"><img src="quake.png" style="width:100%"></a>
<a href="?warcraft-ii"><img src="warcraft-ii.png" style="width:100%"></a>
<a href="?doom"><img src="doom.png" ></a>
</div>
</div>
2 changes: 1 addition & 1 deletion examples/dos-games/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: multi-game
image: "defenseunicorns/zarf-game:multi-tile-dark"
image: ghcr.io/zarf-dev/doom-game:0.0.1
ports:
- name: http
containerPort: 8000
Expand Down
2 changes: 1 addition & 1 deletion examples/dos-games/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ components:
- manifests/deployment.yaml
- manifests/service.yaml
images:
- defenseunicorns/zarf-game:multi-tile-dark
- ghcr.io/zarf-dev/doom-game:0.0.1
actions:
onDeploy:
after:
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/packager/prepare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func TestFindImages(t *testing.T) {
require.NoError(t, err)
expectedImages := map[string][]string{
"baseline": {
"defenseunicorns/zarf-game:multi-tile-dark",
"index.docker.io/defenseunicorns/zarf-game:sha256-0b694ca1c33afae97b7471488e07968599f1d2470c629f76af67145ca64428af.sig",
"ghcr.io/zarf-dev/doom-game:0.0.1",
"ghcr.io/zarf-dev/doom-game:sha256-7464ecc8a7172fce5c2ad631fc2a1b8572c686f4bf15c4bd51d7d6c9f0c460a7.sig",
},
}
require.Equal(t, len(expectedImages), len(images))
Expand Down
12 changes: 6 additions & 6 deletions src/test/e2e/06_create_sbom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ func TestCreateSBOM(t *testing.T) {
require.NoError(t, err, stdOut, stdErr)
require.Contains(t, stdErr, "Creating SBOMs for 1 images and 0 components with files.")
// Test that the game package generates the SBOMs we expect (images only)
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "sbom-viewer-docker.io_defenseunicorns_zarf-game_multi-tile-dark.html"))
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_doom-game_0.0.1.html"))
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "compare.html"))
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "docker.io_defenseunicorns_zarf-game_multi-tile-dark.json"))
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "ghcr.io_zarf-dev_doom-game_0.0.1.json"))

// Clean the SBOM path so it is force to be recreated
e2e.CleanFiles(sbomPath)

stdOut, stdErr, err = e2e.Zarf(t, "package", "inspect", pkgName, "--sbom-out", sbomPath)
require.NoError(t, err, stdOut, stdErr)
// Test that the game package generates the SBOMs we expect (images only)
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "sbom-viewer-docker.io_defenseunicorns_zarf-game_multi-tile-dark.html"))
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_doom-game_0.0.1.html"))
require.NoError(t, err)
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "compare.html"))
require.NoError(t, err)
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "docker.io_defenseunicorns_zarf-game_multi-tile-dark.json"))
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "ghcr.io_zarf-dev_doom-game_0.0.1.json"))
require.NoError(t, err)

stdOut, _, err = e2e.Zarf(t, "package", "inspect", pkgName, "--list-images")
require.NoError(t, err)
require.Equal(t, "- defenseunicorns/zarf-game:multi-tile-dark\n", stdOut)
require.Equal(t, "- ghcr.io/zarf-dev/doom-game:0.0.1\n", stdOut)

// Pull the current zarf binary version to find the corresponding init package
version, stdErr, err := e2e.Zarf(t, "version")
Expand All @@ -54,7 +54,7 @@ func TestCreateSBOM(t *testing.T) {
stdOut, stdErr, err = e2e.Zarf(t, "package", "inspect", initName, "--sbom-out", sbomPath)
require.NoError(t, err, stdOut, stdErr)
// Test that we preserve the filepath
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "sbom-viewer-docker.io_defenseunicorns_zarf-game_multi-tile-dark.html"))
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_doom-game_0.0.1.html"))
require.NoError(t, err)
// Test that the init package generates the SBOMs we expect (images + component files)
_, err = os.ReadFile(filepath.Join(sbomPath, "init", "sbom-viewer-docker.io_gitea_gitea_1.21.5-rootless.html"))
Expand Down
8 changes: 4 additions & 4 deletions src/test/packages/12-lint/linted-import/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ components:

- name: import-test
images:
- registry.com:9001/whatever/image:latest
- busybox@sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79
- busybox:###ZARF_PKG_TMPL_BUSYBOX_IMAGE###
- busybox:###ZARF_PKG_TMPL_UNSET###
- registry.com:9001/whatever/image:latest
- busybox@sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79
- busybox:###ZARF_PKG_TMPL_BUSYBOX_IMAGE###
- busybox:###ZARF_PKG_TMPL_UNSET###

- name: oci-games-url
import:
Expand Down
26 changes: 13 additions & 13 deletions src/test/packages/12-lint/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ components:

- name: full-repo
repos:
- https://github.com/zarf-dev/zarf-public-test.git
- https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@v0.0.1
- https://gitlab.com/gitlab-org/build/omnibus-mirror/pcre2/-/tree/vreverse?ref_type=heads
- https://github.com/zarf-dev/zarf-public-test.git
- https://dev.azure.com/defenseunicorns/zarf-public-test/_git/zarf-public-test@v0.0.1
- https://gitlab.com/gitlab-org/build/omnibus-mirror/pcre2/-/tree/vreverse?ref_type=heads
images:
- registry.com:9001/whatever/image:1.0.0
- busybox@sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79
- busybox:###ZARF_PKG_VAR_WHATEVER_IMAGE###
- busybox:###ZARF_PKG_TMPL_BUSYBOX_IMAGE###
- ubuntu:###ZARF_PKG_TMPL_UBUNTU_IMAGE###
- registry.com:9001/whatever/image:1.0.0
- busybox@sha256:3fbc632167424a6d997e74f52b878d7cc478225cffac6bc977eedfe51c7f4e79
- busybox:###ZARF_PKG_VAR_WHATEVER_IMAGE###
- busybox:###ZARF_PKG_TMPL_BUSYBOX_IMAGE###
- ubuntu:###ZARF_PKG_TMPL_UBUNTU_IMAGE###
files:
- source: https://github.com/k3s-io/k3s/releases/download/v1.28.2+k3s1/k3s
shasum: 2f041d37a2c6d54d53e106e1c7713bc48f806f3919b0d9e092f5fcbdc55b41cf
target: src/
- source: file-without-shasum.txt
target: src/
- source: https://github.com/k3s-io/k3s/releases/download/v1.28.2+k3s1/k3s
shasum: 2f041d37a2c6d54d53e106e1c7713bc48f806f3919b0d9e092f5fcbdc55b41cf
target: src/
- source: file-without-shasum.txt
target: src/

- name: oci-games-url
import:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: multi-game
image: "defenseunicorns/zarf-game:multi-tile-dark"
image: "ghcr.io/zarf-dev/doom-game:0.0.1"
ports:
- name: http
containerPort: 8000
Expand Down
2 changes: 1 addition & 1 deletion src/test/packages/25-manifest-adoption/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
spec:
containers:
- name: multi-game
image: "defenseunicorns/zarf-game:multi-tile-dark"
image: "ghcr.io/zarf-dev/doom-game:0.0.1"
ports:
- name: http
containerPort: 8000
Expand Down
6 changes: 3 additions & 3 deletions src/test/packages/26-image-dos-games/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ components:
- name: baseline
required: true
images:
- defenseunicorns/zarf-game:multi-tile-dark
- defenseunicorns/zarf-game:multi-tile-dark@sha256:f78e442f0f3eb3e9459b5ae6b1a8fda62f8dfe818112e7d130a4e8ae72b3cbff
- defenseunicorns/zarf-game@sha256:f78e442f0f3eb3e9459b5ae6b1a8fda62f8dfe818112e7d130a4e8ae72b3cbff
- ghcr.io/zarf-dev/doom-game:0.0.1
- ghcr.io/zarf-dev/doom-game:0.0.1@sha256:0a44b759e219d9d6f3c7cbbf40c57ede71a1f9bf54da65767c4137be74727662
- ghcr.io/zarf-dev/doom-game@sha256:0a44b759e219d9d6f3c7cbbf40c57ede71a1f9bf54da65767c4137be74727662

0 comments on commit 02f2932

Please sign in to comment.