forked from common-fate/granted
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (40 loc) · 2.37 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
go-binary:
go build -o ./bin/dgranted cmd/granted/main.go
assume-binary:
go build -o ./bin/dassumego cmd/assume/main.go
cli: go-binary assume-binary
mv ./bin/dgranted /usr/local/bin/
mv ./bin/dassumego /usr/local/bin/
# replace references to "assumego" (the production binary) with "dassumego"
cat scripts/assume | sed 's/assumego/dassumego/g' > /usr/local/bin/dassume && chmod +x /usr/local/bin/dassume
cat scripts/assume.fish | sed 's/assumego/dassumego/g' > /usr/local/bin/dassume.fish && chmod +x /usr/local/bin/dassume.fish
clean:
rm /usr/local/bin/dassumego
rm /usr/local/bin/dassume
rm /usr/local/bin/dassume.fish
aws-credentials:
echo -e "\nAWS_ACCESS_KEY_ID=\"$$AWS_ACCESS_KEY_ID\"\nAWS_SECRET_ACCESS_KEY=\"$$AWS_SECRET_ACCESS_KEY\"\nAWS_SESSION_TOKEN=\"$$AWS_SESSION_TOKEN\"\nAWS_REGION=\"$$AWS_REGION\""
test-browser-binary:
GOOS=linux go build -o ./bin/linux/tbrowser cmd/testing/browser/main.go
GOOS=darwin GOARCH=amd64 go build -o ./bin/macos/tbrowser cmd/testing/browser/main.go
GOOS=windows go build -o ./bin/windows/tbrowser.exe cmd/testing/browser/main.go
test-creds-binary:
GOOS=linux go build -o ./bin/linux/tcreds cmd/testing/creds/main.go
GOOS=darwin GOARCH=amd64 go build -o ./bin/macos/tcreds cmd/testing/creds/main.go
GOOS=windows go build -o ./bin/windows/tcreds.exe cmd/testing/creds/main.go
test-binaries: test-browser-binary test-creds-binary
ci-cli-all-platforms: test-binaries
# build steps
GOOS=linux go build -o ./bin/linux/dgranted cmd/granted/main.go
GOOS=darwin GOARCH=amd64 go build -o ./bin/macos/dgranted cmd/granted/main.go
GOOS=windows go build -o ./bin/windows/dgranted.exe cmd/granted/main.go
GOOS=linux go build -o ./bin/linux/dassumego cmd/assume/main.go
GOOS=darwin GOARCH=amd64 go build -o ./bin/macos/dassumego cmd/assume/main.go
GOOS=windows go build -o ./bin/windows/dassumego.exe cmd/assume/main.go
# replace references to "assumego" (the production binary) with "dassumego"
cat scripts/assume | sed 's/assumego/dassumego/g' > bin/linux/dassume && chmod +x bin/linux/dassume
cat scripts/assume.fish | sed 's/assumego/dassumego/g' > bin/linux/dassume.fish && chmod +x bin/linux/dassume.fish
cp bin/linux/dassume bin/macos/dassume
cp bin/linux/dassume.fish bin/macos/dassume.fish
cat scripts/assume.bat | sed 's/assumego/dassumego/g' > bin/windows/dassume.bat
cat scripts/assume.ps1 | sed 's/assumego/dassumego/g' > bin/windows/dassume.ps1