Skip to content

Commit

Permalink
Don't put artifacts in a build/ subdirectory
Browse files Browse the repository at this point in the history
When the user says "--output mydir" they really expect the artifacts to
be in `mydir`, not in `mydir/build`.

See also:

- kairos-io/osbuilder#192 (comment)
- kairos-io/kairos-docs#311 (comment)

Signed-off-by: Dimitris Karakasilis <[email protected]>
  • Loading branch information
jimmykarily committed Nov 15, 2024
1 parent cc8b857 commit dd0cb1c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion deployer/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (d *Deployer) tmpRootFs() string {
}

func (d *Deployer) destination() string {
return d.Config.StateDir("build")
return d.Config.State
}

func (d *Deployer) isoFile() string {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/arm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var _ = Describe("ARM image generation", Label("arm"), func() {
Expect(out).To(ContainSubstring("done"), out)
Expect(out).To(ContainSubstring("build-arm-image"), out)
Expect(err).ToNot(HaveOccurred())
_, err = os.Stat(filepath.Join(tempDir, "build/build/disk.img"))
_, err = os.Stat(filepath.Join(tempDir, "build/disk.img"))
Expect(err).ToNot(HaveOccurred())
})

Expand All @@ -60,7 +60,7 @@ var _ = Describe("ARM image generation", Label("arm"), func() {
Expect(out).ToNot(ContainSubstring("build-arm-image"), out)
Expect(out).To(ContainSubstring("prepare_arm"), out)
Expect(err).ToNot(HaveOccurred())
_, err = os.Stat(filepath.Join(tempDir, "build/build/efi.img"))
_, err = os.Stat(filepath.Join(tempDir, "build/efi.img"))
Expect(err).ToNot(HaveOccurred())
})
})
Expand Down
18 changes: 9 additions & 9 deletions tests/e2e/disks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var _ = Describe("Disk image generation", Label("raw-disks"), func() {
Expect(out).To(ContainSubstring("extract-squashfs"), out)
Expect(out).ToNot(ContainSubstring("dump-source"), out)
Expect(err).ToNot(HaveOccurred(), out)
_, err = os.Stat(filepath.Join(tempDir, "build/build/disk.raw"))
_, err = os.Stat(filepath.Join(tempDir, "build/disk.raw"))
Expect(err).ToNot(HaveOccurred())
})

Expand All @@ -67,7 +67,7 @@ var _ = Describe("Disk image generation", Label("raw-disks"), func() {
Expect(out).To(ContainSubstring("extract-squashfs"), out)
Expect(out).ToNot(ContainSubstring("dump-source"), out)
Expect(err).ToNot(HaveOccurred(), out)
_, err = os.Stat(filepath.Join(tempDir, "build/build/disk.raw.gce"))
_, err = os.Stat(filepath.Join(tempDir, "build/disk.raw.gce"))
Expect(err).ToNot(HaveOccurred())
})

Expand All @@ -89,7 +89,7 @@ var _ = Describe("Disk image generation", Label("raw-disks"), func() {
Expect(out).To(ContainSubstring("extract-squashfs"), out)
Expect(out).ToNot(ContainSubstring("dump-source"), out)
Expect(err).ToNot(HaveOccurred(), out)
_, err = os.Stat(filepath.Join(tempDir, "build/build/disk.raw.vhd"))
_, err = os.Stat(filepath.Join(tempDir, "build/disk.raw.vhd"))
Expect(err).ToNot(HaveOccurred())
})

Expand All @@ -111,7 +111,7 @@ var _ = Describe("Disk image generation", Label("raw-disks"), func() {
// Expect(out).To(ContainSubstring("extract-squashfs"), out)
// Expect(out).ToNot(ContainSubstring("dump-source"), out)
// Expect(err).ToNot(HaveOccurred(), out)
// _, err = os.Stat(filepath.Join(tempDir, "build/build/disk.raw.gce"))
// _, err = os.Stat(filepath.Join(tempDir, "build/disk.raw.gce"))
// Expect(err).ToNot(HaveOccurred())
// })
})
Expand Down Expand Up @@ -170,7 +170,7 @@ stages:
os.RemoveAll(tempDir)
})

It("generate a raw build/build/disk.raw (EFI) file", Label("efi"), func() {
It("generate a raw build/disk.raw (EFI) file", Label("efi"), func() {
image := "quay.io/kairos/opensuse:tumbleweed-core-amd64-generic-v3.2.1"
_, err := PullImage(image)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -186,7 +186,7 @@ stages:
Expect(out).To(ContainSubstring("gen-raw-disk"), out)
Expect(out).To(ContainSubstring("dump-source"), out)
Expect(err).ToNot(HaveOccurred(), out)
_, err = os.Stat(filepath.Join(tempDir, "build/build/disk.raw"))
_, err = os.Stat(filepath.Join(tempDir, "build/disk.raw"))
Expect(err).ToNot(HaveOccurred())
})

Expand All @@ -207,7 +207,7 @@ stages:
Expect(out).To(ContainSubstring("convert-gce"), out)
Expect(out).To(ContainSubstring("dump-source"), out)
Expect(err).ToNot(HaveOccurred(), out)
_, err = os.Stat(filepath.Join(tempDir, "build/build/disk.raw.gce"))
_, err = os.Stat(filepath.Join(tempDir, "build/disk.raw.gce"))
Expect(err).ToNot(HaveOccurred())
})

Expand All @@ -228,7 +228,7 @@ stages:
Expect(out).To(ContainSubstring("convert-vhd"), out)
Expect(out).To(ContainSubstring("dump-source"), out)
Expect(err).ToNot(HaveOccurred(), out)
_, err = os.Stat(filepath.Join(tempDir, "build/build/disk.raw.vhd"))
_, err = os.Stat(filepath.Join(tempDir, "build/disk.raw.vhd"))
Expect(err).ToNot(HaveOccurred())
})

Expand All @@ -249,7 +249,7 @@ stages:
Expect(out).To(ContainSubstring("gen-raw-mbr-disk"), out)
Expect(out).To(ContainSubstring("dump-source"), out)
Expect(err).ToNot(HaveOccurred(), out)
_, err = os.Stat(filepath.Join(tempDir, "build/build/disk.raw"))
_, err = os.Stat(filepath.Join(tempDir, "build/disk.raw"))
Expect(err).ToNot(HaveOccurred())
})
})
Expand Down

0 comments on commit dd0cb1c

Please sign in to comment.