Skip to content

Commit

Permalink
Improve: use embed module to embedded static shell scripts.
Browse files Browse the repository at this point in the history
Signed-off-by: Wine93 <[email protected]>
  • Loading branch information
Wine93 committed Jun 15, 2023
1 parent 985282c commit 75d219a
Show file tree
Hide file tree
Showing 26 changed files with 233 additions and 501 deletions.
67 changes: 0 additions & 67 deletions internal/task/scripts/collect.go

This file was deleted.

46 changes: 0 additions & 46 deletions internal/task/scripts/create_volume.go

This file was deleted.

55 changes: 0 additions & 55 deletions internal/task/scripts/createfs.go

This file was deleted.

39 changes: 0 additions & 39 deletions internal/task/scripts/format.go

This file was deleted.

46 changes: 0 additions & 46 deletions internal/task/scripts/map.go

This file was deleted.

41 changes: 0 additions & 41 deletions internal/task/scripts/nginx.go

This file was deleted.

39 changes: 0 additions & 39 deletions internal/task/scripts/recycle.go

This file was deleted.

43 changes: 32 additions & 11 deletions internal/task/scripts/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,43 @@

package scripts

import (
_ "embed"
)

const (
STATUS_OK = "CURVEADM_OK"
STATUS_FAIL = "CURVEADM_FAIL"
STATUS_TIMEOUT = "CURVEADM_TIMEOUT"
)

var (
SCRIPT_WAIT string = WAIT
SCRIPT_COLLECT string = COLLECT
SCRIPT_REPORT string = REPORT
SCRIPT_FORMAT string = FORMAT
SCRIPT_MAP string = MAP
SCRIPT_TARGET string = TARGET
SCRIPT_RECYCLE string = RECYCLE
SCRIPT_CREATEFS string = CREATEFS
SCRIPT_CREATE_VOLUME string = CREATE_VOLUME
SCRIPT_WAIT_CHUNKSERVERS string = WAIT_CHUNKSERVERS
SCRIPT_START_NGINX string = START_NGINX
// Common

//go:embed shell/wait.sh
WAIT string
//go:embed shell/report.sh
REPORT string

// CurveBS

//go:embed shell/format.sh
FORMAT string
//go:embed shell/wait_chunkserver.sh
WAIT_CHUNKSERVERS string
//go:embed shell/start_nginx.sh
START_NGINX string
//go:embed shell/create_volume.sh
CREATE_VOLUME string
//go:embed shell/map.sh
MAP string
//go:embed shell/target.sh
TARGET string
//go:embed shell/recycle.sh
RECYCLE string

// CurveFS

//go:embed shell/create_fs.sh
CREATE_FS string
)
Loading

0 comments on commit 75d219a

Please sign in to comment.