forked from kairos-io/kairos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add bundles to post-install hooks (kairos-io#171)
* 🤖 Add bundles and sysext test * ✨ Exec bundles also after install * 🤖 Adapt tests * 🎨 Create dir only if doesn't exist * 🎨 Return err on mount * 🎨 Make bundle errors failure as an option * 🎨 Minor fixups * debug * 🤖 Fix spec * 🤖 Get correct version for bundle test * 🎨 Fixups * 🤖 systemd-sysext is available only on opensuse for now
- Loading branch information
Showing
12 changed files
with
361 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM alpine as build | ||
# Install a binary | ||
ARG VERSION | ||
ENV VERSION=$VERSION | ||
|
||
RUN wget https://github.com/ipfs/kubo/releases/download/v0.15.0/kubo_v0.15.0_linux-amd64.tar.gz -O kubo.tar.gz | ||
RUN tar xvf kubo.tar.gz | ||
RUN mv kubo/ipfs /usr/bin/ipfs | ||
RUN mkdir -p /usr/lib/extension-release.d/ | ||
RUN echo ID=kairos > /usr/lib/extension-release.d/extension-release.kubo | ||
RUN echo VERSION_ID=$VERSION >> /usr/lib/extension-release.d/extension-release.kubo | ||
|
||
|
||
FROM scratch | ||
|
||
COPY --from=build /usr/bin/ipfs /usr/bin/ipfs | ||
COPY --from=build /usr/lib/extension-release.d /usr/lib/extension-release.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package hook | ||
|
||
import ( | ||
config "github.com/kairos-io/kairos/pkg/config" | ||
"github.com/kairos-io/kairos/pkg/machine" | ||
"github.com/kairos-io/kairos/sdk/bundles" | ||
) | ||
|
||
type BundleOption struct{} | ||
|
||
func (b BundleOption) Run(c config.Config) error { | ||
|
||
machine.Mount("COS_PERSISTENT", "/usr/local") //nolint:errcheck | ||
defer func() { | ||
machine.Umount("/usr/local") | ||
}() | ||
|
||
machine.Mount("COS_OEM", "/oem") //nolint:errcheck | ||
defer func() { | ||
machine.Umount("/oem") | ||
}() | ||
|
||
opts := c.Install.Bundles.Options() | ||
err := bundles.RunBundles(opts...) | ||
if c.FailOnBundleErrors && err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.