Browse Source

Renamed smf package to svcgen

master
Till Wegmüller 3 years ago
parent
commit
1de4d2f62d
  1. 8
      Taskfile.yml
  2. 20
      image/build/build.go
  3. 2
      svcgen/manifest.go
  4. 2
      svcgen/service_bundle.xsd.go
  5. 2
      svcgen/svccfg.go

8
Taskfile.yml

@ -18,19 +18,19 @@ vars:
tasks:
imageadm:
cmds:
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/imageadm -ldflags \"-X main.version={{.VERSION}}\" cmd/imageadm.go"
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/imageadm -ldflags \"-X git.wegmueller.it/opencloud/opencloud/cli.version={{.VERSION}}\" cmd/imageadm.go"
buildhelper:
cmds:
- "CGO_ENABLED=0 GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/buildhelper_{{.GOOS}} -ldflags \"-X main.version={{.VERSION}}\" cmd/buildhelper.go"
- "CGO_ENABLED=0 GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/buildhelper_{{.GOOS}} -ldflags \"-X git.wegmueller.it/opencloud/opencloud/cli.version={{.VERSION}}\" cmd/buildhelper.go"
podadm:
cmds:
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/podadm -ldflags \"-X main.version={{.VERSION}}\" cmd/podadm.go"
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/podadm -ldflags \"-X git.wegmueller.it/opencloud/opencloud/cli.version={{.VERSION}}\" cmd/podadm.go"
podadmd:
cmds:
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/podadmd -ldflags \"-X main.version={{.VERSION}}\" cmd/podadmd.go"
- "GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -o artifacts/podadmd -ldflags \"-X git.wegmueller.it/opencloud/opencloud/cli.version={{.VERSION}}\" cmd/podadmd.go"
build:
desc: Build all the binaries

20
image/build/build.go

@ -13,7 +13,7 @@ import (
"strings"
"git.wegmueller.it/opencloud/opencloud/image/oci"
"git.wegmueller.it/opencloud/opencloud/smf"
"git.wegmueller.it/opencloud/opencloud/svcgen"
"github.com/docker/docker/pkg/fileutils"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
@ -376,13 +376,13 @@ func CreateEntryPointInZone(cfg *Image) error {
}
fullPath := filepath.Join("/lib/svc/manifest/application/entrypoint.xml")
manifestObj := smf.NewManifestFromOCIProcess("oci-entrypoint", smf.OCIEntryPointSVCName, cfg.Milestone, p)
manifestObj.Services[0].Dependent = append(manifestObj.Services[0].Dependent, smf.Dependent{
manifestObj := svcgen.NewManifestFromOCIProcess("oci-entrypoint", svcgen.OCIEntryPointSVCName, cfg.Milestone, p)
manifestObj.Services[0].Dependent = append(manifestObj.Services[0].Dependent, svcgen.Dependent{
Name: "oci-process",
Grouping: "require_all",
RestartOn: "none",
ServiceFmri: smf.ServiceFmri{
Value: smf.OCIProcesSVCName,
ServiceFmri: svcgen.ServiceFmri{
Value: svcgen.OCIProcesSVCName,
},
})
manifestObj.Services[0].PropertyGroup[0].PropVal[0].Value = "transient"
@ -393,7 +393,7 @@ func CreateEntryPointInZone(cfg *Image) error {
}
defer manFile.Close()
if _, err := manFile.WriteString(smf.Header); err != nil {
if _, err := manFile.WriteString(svcgen.Header); err != nil {
return tracerr.Wrap(err)
}
@ -403,7 +403,7 @@ func CreateEntryPointInZone(cfg *Image) error {
return tracerr.Wrap(err)
}
if err := smf.Import(fullPath); err != nil {
if err := svcgen.Import(fullPath); err != nil {
return tracerr.Wrap(err)
}
@ -430,7 +430,7 @@ func CreateProcessInZoneSMF(cfg *Image) error {
fullPath := filepath.Join("/lib/svc/manifest/application/oci-process.xml")
manifestObj := smf.NewManifestFromOCIProcess("oci-process", smf.OCIProcesSVCName, cfg.Milestone, p)
manifestObj := svcgen.NewManifestFromOCIProcess("oci-process", svcgen.OCIProcesSVCName, cfg.Milestone, p)
if cfg.ExposedPorts != nil {
needsPrivPorts := false
@ -455,7 +455,7 @@ func CreateProcessInZoneSMF(cfg *Image) error {
}
defer manFile.Close()
if _, err := manFile.WriteString(smf.Header); err != nil {
if _, err := manFile.WriteString(svcgen.Header); err != nil {
return tracerr.Wrap(err)
}
@ -465,7 +465,7 @@ func CreateProcessInZoneSMF(cfg *Image) error {
return tracerr.Wrap(err)
}
if err := smf.Import(fullPath); err != nil {
if err := svcgen.Import(fullPath); err != nil {
return tracerr.Wrap(err)
}

2
smf/manifest.go → svcgen/manifest.go

@ -1,4 +1,4 @@
package smf
package svcgen
import (
"strconv"

2
smf/service_bundle.xsd.go → svcgen/service_bundle.xsd.go

@ -32,7 +32,7 @@
// NOTE: the golang package has no support for that yet...
package smf
package svcgen
import (
"encoding/xml"

2
smf/svccfg.go → svcgen/svccfg.go

@ -1,4 +1,4 @@
package smf
package svcgen
import (
"fmt"
Loading…
Cancel
Save