Skip to content

Commit

Permalink
combine darwin and keybot
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaxim committed May 10, 2024
1 parent d745af3 commit f0601b6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 201 deletions.
154 changes: 0 additions & 154 deletions keybot/darwinbot.go

This file was deleted.

42 changes: 0 additions & 42 deletions keybot/keybase.darwinbot.plist

This file was deleted.

38 changes: 38 additions & 0 deletions keybot/keybot.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ func (k *keybot) Run(bot *slackbot.Bot, channel string, args []string) (string,
buildIOSAutomated := buildIOS.Flag("automated", "Whether this is a timed build").Bool()
buildIOSCientCommit := buildIOS.Flag("client-commit", "Build a specific client commit hash").String()

buildDarwin := build.Command("darwin", "Start a darwin build")
buildDarwinTest := buildDarwin.Flag("test", "Whether build is for testing").Bool()
buildDarwinClientCommit := buildDarwin.Flag("client-commit", "Build a specific client commit").String()
buildDarwinKbfsCommit := buildDarwin.Flag("kbfs-commit", "Build a specific kbfs commit").String()
buildDarwinNoPull := buildDarwin.Flag("skip-pull", "Don't pull before building the app").Bool()
buildDarwinSkipCI := buildDarwin.Flag("skip-ci", "Whether to skip CI").Bool()
buildDarwinSmoke := buildDarwin.Flag("smoke", "Whether to make a pair of builds for smoketesting when on a branch").Bool()
buildDarwinNoS3 := buildDarwin.Flag("skip-s3", "Don't push to S3 after building the app").Bool()
buildDarwinNoNotarize := buildDarwin.Flag("skip-notarize", "Don't notarize the app").Bool()

release := app.Command("release", "Release things")
releasePromote := release.Command("promote", "Promote a release to public")
releaseToPromotePlatform := releasePromote.Arg("platform", "Platform to promote a release for").Required().String()
Expand Down Expand Up @@ -91,6 +101,34 @@ func (k *keybot) Run(bot *slackbot.Bot, channel string, args []string) (string,
}
return launchd.Stop(*cancelLabel)

case buildDarwin.FullCommand():
smokeTest := true
skipCI := *buildDarwinSkipCI
testBuild := *buildDarwinTest
// If it's a custom build, make it a test build unless --smoke is passed.
if *buildDarwinClientCommit != "" || *buildDarwinKbfsCommit != "" {
smokeTest = *buildDarwinSmoke
testBuild = !*buildDarwinSmoke
}
script := launchd.Script{
Label: "keybase.build.darwin",
Path: "github.com/keybase/client/packaging/build_darwin.sh",
BucketName: "prerelease.keybase.io",
Platform: "darwin",
EnvVars: []launchd.EnvVar{
{Key: "SMOKE_TEST", Value: boolToEnvString(smokeTest)},
{Key: "TEST", Value: boolToEnvString(testBuild)},
{Key: "CLIENT_COMMIT", Value: *buildDarwinClientCommit},
{Key: "KBFS_COMMIT", Value: *buildDarwinKbfsCommit},
// TODO: Rename to SKIP_CI in packaging scripts
{Key: "NOWAIT", Value: boolToEnvString(skipCI)},
{Key: "NOPULL", Value: boolToEnvString(*buildDarwinNoPull)},
{Key: "NOS3", Value: boolToEnvString(*buildDarwinNoS3)},
{Key: "NONOTARIZE", Value: boolToEnvString(*buildDarwinNoNotarize)},
},
}
return runScript(bot, channel, env, script)

case buildMobile.FullCommand():
skipCI := *buildMobileSkipCI
automated := *buildMobileAutomated
Expand Down
5 changes: 0 additions & 5 deletions keybot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ func main() {
label = "keybase.keybot"
backend = hybridBackend
channel = hybridChannel
case "darwinbot":
ext = &darwinbot{}
label = "keybase.darwinbot"
backend = hybridBackend
channel = hybridChannel
case "winbot":
ext = &winbot{}
label = "keybase.winbot"
Expand Down

0 comments on commit f0601b6

Please sign in to comment.