Skip to content

Commit

Permalink
Hotfix: use string for main var and add to makefile (#274)
Browse files Browse the repository at this point in the history
* Hotfix: use string for main var and add to makefile

* Hotfix: add ipfs_addr to CI vars.
  • Loading branch information
jsonsivar authored Dec 2, 2020
1 parent af51300 commit f71e499
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IPFS_ADDR: ${{ secrets.IPFS_ADDR }}
IPFS_NODE_ADDR: ${{ secrets.IPFS_NODE_ADDR }}
IPFS_NODE_PATH: ${{ secrets.IPFS_NODE_PATH }}
SERVICES_API_URL: ${{ secrets[steps.secretnames.outputs.SERVICES_API_URL] }}
Expand Down
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ builds:
- -X main.textileuserkey={{ .Env.TXL_USER_KEY }}
- -X main.textileusersecret={{ .Env.TXL_USER_SECRET }}
- -X main.spacestoragesiteurl={{ .Env.SPACE_STORAGE_SITE_URL }}
- -X main.ipfsaddr={{ .Env.IPFS_ADDR }}
- -X main.ipfsnodeaddr={{ .Env.IPFS_NODE_ADDR }}
- -X main.ipfsnodepath={{ .Env.IPFS_NODE_PATH }}
main: ./cmd/space-daemon/main.go
Expand All @@ -44,6 +45,7 @@ builds:
- -X main.textileuserkey={{ .Env.TXL_USER_KEY }}
- -X main.textileusersecret={{ .Env.TXL_USER_SECRET }}
- -X main.spacestoragesiteurl={{ .Env.SPACE_STORAGE_SITE_URL }}
- -X main.ipfsaddr={{ .Env.IPFS_ADDR }}
- -X main.ipfsnodeaddr={{ .Env.IPFS_NODE_ADDR }}
- -X main.ipfsnodepath={{ .Env.IPFS_NODE_PATH }}
main: ./cmd/space-daemon/main.go
Expand All @@ -68,6 +70,7 @@ builds:
- -X main.textileuserkey={{ .Env.TXL_USER_KEY }}
- -X main.textileusersecret={{ .Env.TXL_USER_SECRET }}
- -X main.spacestoragesiteurl={{ .Env.SPACE_STORAGE_SITE_URL }}
- -X main.ipfsaddr={{ .Env.IPFS_ADDR }}
- -X main.ipfsnodeaddr={{ .Env.IPFS_NODE_ADDR }}
- -X main.ipfsnodepath={{ .Env.IPFS_NODE_PATH }}
main: ./cmd/space-daemon/main.go
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ build:
go build \
-o bin/space \
-ldflags \
"-X 'main.ipfsnodeaddr=${IPFS_NODE_ADDR}' \
"-X 'main.ipfsaddr=${IPFS_ADDR}' \
-X 'main.ipfsnodeaddr=${IPFS_NODE_ADDR}' \
-X 'main.ipfsnodepath=${IPFS_NODE_PATH}' \
-X 'main.spaceapi=${SERVICES_API_URL}' \
-X 'main.spacestoragesiteurl=${SPACE_STORAGE_SITE_URL}' \
Expand Down
4 changes: 2 additions & 2 deletions cmd/space-daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ var (
debugMode = flag.Bool("debug", true, "run daemon with debug mode for profiling")
enableTracing = flag.Bool("trace", false, "run tracing on daemon rpc")
devMode = flag.Bool("dev", false, "run daemon in dev mode to use .env file")
ipfsaddr = flag.String("ipfsaddr", "/ip4/127.0.0.1/tcp/5001", "IPFS multiaddress to connect to (defaults to local node)")
ipfsnode = flag.Bool("ipfsnode", true, "run IPFS embedded into the daemon (defaults to true)")
ipfsaddr string
ipfsnodeaddr string
ipfsnodepath string
spaceapi string
Expand All @@ -56,7 +56,7 @@ func main() {
log.Debug("Running mode", fmt.Sprintf("DevMode:%v", *devMode))

cf := &config.Flags{
Ipfsaddr: *ipfsaddr,
Ipfsaddr: ipfsaddr,
Ipfsnode: *ipfsnode == true,
Ipfsnodeaddr: ipfsnodeaddr,
Ipfsnodepath: ipfsnodepath,
Expand Down

0 comments on commit f71e499

Please sign in to comment.