diff --git a/packaging/linux/build_and_push_packages.sh b/packaging/linux/build_and_push_packages.sh index 4c66a8c9c95b..6f3409de3454 100755 --- a/packaging/linux/build_and_push_packages.sh +++ b/packaging/linux/build_and_push_packages.sh @@ -17,13 +17,13 @@ client_dir="$(git -C "$here" rev-parse --show-toplevel)" echo "=================================" echo "=================================" -if [ -v KEYBASE_TEST ]; then +if [ -n "$KEYBASE_TEST" ]; then default_bucket_name="tests.keybase.io" echo "= This build+push is a TEST. =" -elif [ -v KEYBASE_NIGHTLY ]; then +elif [ -n "$KEYBASE_NIGHTLY" ]; then default_bucket_name="tests.keybase.io" echo "= This build+push is a NIGHTLY. =" -elif [ -v KEYBASE_RELEASE ]; then +elif [ -n "$KEYBASE_RELEASE" ]; then default_bucket_name="prerelease.keybase.io" echo "= This build+push is a RELEASE. =" else @@ -119,7 +119,7 @@ copy_bins() { another_copy "$build_dir/rpm_repo/keybase-latest-x86_64.rpm" "s3://$1/keybase_amd64.rpm" another_copy "$build_dir/rpm_repo/keybase-latest-i386.rpm" "s3://$1/keybase_i386.rpm" } -if [ -v KEYBASE_RELEASE ]; then +if [ -n "$KEYBASE_RELEASE" ]; then copy_bins "$BUCKET_NAME" fi @@ -141,12 +141,12 @@ GOPATH="$release_gopath" PLATFORM="linux" "$here/../prerelease/s3_index.sh" || \ echo "ERROR in s3_index.sh. Internal pages might not be updated. Build continuing..." NIGHTLY_DIR="prerelease.keybase.io/nightly" # No trailing slash! AWS doesn't respect POSIX standards w.r.t double slashes -if [ -v KEYBASE_NIGHTLY ] ; then +if [ -n "$KEYBASE_NIGHTLY" ] ; then copy_bins "$NIGHTLY_DIR" copy_metadata "$NIGHTLY_DIR" fi -if [ -v KEYBASE_RELEASE ] ; then +if [ -n "$KEYBASE_RELEASE" ] ; then echo "Updating AUR packages" "$here/arch/update_aur_packages.sh" "$build_dir" fi diff --git a/packaging/linux/docker/build.sh b/packaging/linux/docker/build.sh index c34980ca330c..ff02ecfe9761 100755 --- a/packaging/linux/docker/build.sh +++ b/packaging/linux/docker/build.sh @@ -14,30 +14,30 @@ gpg_tempfile="$client_dir/.docker/code_signing_key" gpg --export-secret-key --armor "$code_signing_fingerprint" > "$gpg_tempfile" # Clear all existing base images -docker rmi golang:1.13.7-stretch || true -docker rmi debian:stretch || true +sudo docker rmi golang:1.13.7-stretch || true +sudo docker rmi debian:stretch || true # Build all three variants -docker build \ +sudo docker build \ --build-arg SOURCE_COMMIT="$source_commit" \ --build-arg SIGNING_FINGERPRINT="$code_signing_fingerprint" \ -f "$client_dir/packaging/linux/docker/standard/Dockerfile" \ -t "keybaseio/client:$tag" \ "$client_dir" -docker build \ +sudo docker build \ --build-arg BASE_IMAGE="keybaseio/client:$tag" \ -f "$client_dir/packaging/linux/docker/slim/Dockerfile" \ -t "keybaseio/client:$tag-slim" \ "$client_dir" -docker build \ +sudo docker build \ --build-arg BASE_IMAGE="keybaseio/client:$tag" \ -f "$client_dir/packaging/linux/docker/node/Dockerfile" \ -t "keybaseio/client:$tag-node" \ "$client_dir" -docker build \ +sudo docker build \ --build-arg BASE_IMAGE="keybaseio/client:$tag" \ -f "$client_dir/packaging/linux/docker/node-slim/Dockerfile" \ -t "keybaseio/client:$tag-node-slim" \ diff --git a/packaging/linux/docker_build.sh b/packaging/linux/docker_build.sh index 6c107ba9ea44..1c0c4ab9124e 100755 --- a/packaging/linux/docker_build.sh +++ b/packaging/linux/docker_build.sh @@ -78,17 +78,17 @@ else fi echo '=== docker ===' -docker run "${interactive_args[@]:+${interactive_args[@]}}" \ +sudo docker run "${interactive_args[@]:+${interactive_args[@]}}" \ -v "$work_dir:/root" \ -v "$clientdir:/CLIENT:ro" \ -v "$gpg_tempdir:/GPG" \ -v "$ssh_temp:/SSH:ro" \ -v "$s3cmd_temp:/S3CMD:ro" \ - -e "BUCKET_NAME" \ - -e "KEYBASE_RELEASE" \ - -e "KEYBASE_NIGHTLY" \ - -e "KEYBASE_TEST" \ - -e "KEYBASE_TEST_CODE_SIGNING_KEY" \ + -e "BUCKET_NAME=${BUCKET_NAME:-}" \ + -e "KEYBASE_RELEASE=${KEYBASE_RELEASE:-}" \ + -e "KEYBASE_NIGHTLY=${KEYBASE_NIGHTLY:-}" \ + -e "KEYBASE_TEST=${KEYBASE_TEST:-}" \ + -e "KEYBASE_TEST_CODE_SIGNING_KEY=${KEYBASE_TEST_CODE_SIGNING_KEY:-}" \ --rm \ "$image" \ bash /CLIENT/packaging/linux/inside_docker_main.sh "$@" diff --git a/packaging/linux/tuxbot/bot/tuxbot/tuxbot.go b/packaging/linux/tuxbot/bot/tuxbot/tuxbot.go index 00b7db3e4188..12d184454191 100644 --- a/packaging/linux/tuxbot/bot/tuxbot/tuxbot.go +++ b/packaging/linux/tuxbot/bot/tuxbot/tuxbot.go @@ -253,17 +253,6 @@ func (c Tuxbot) Dispatch(msg chat1.MsgSummary, args []string) (err error) { commit := "HEAD" if len(args) > 0 { commit = args[0] - - gitCmd := makeCmd(currentUser, "git", "--no-pager", "log", "--oneline", fmt.Sprintf("%s...", commit)) - gitCmd.Stdout = nil - gitCmd.Stderr = nil - ret, err := gitCmd.CombinedOutput() - if err != nil { - return err - } - if bytes.Count(ret, []byte("\n")) > 500 { - return fmt.Errorf("%s is more than 500 revisions behind HEAD, refusing to build", commit) - } } c.Locked = true go func() { @@ -424,7 +413,7 @@ func (c Tuxbot) Dispatch(msg chat1.MsgSummary, args []string) (err error) { c.Debug("```%s```", ret) return nil case "journal": - ret, _ := exec.Command("sudo", "journalctl", "-n", "50").CombinedOutput() + ret, _ := exec.Command("sudo", "journalctl", "-n", "100").CombinedOutput() c.Debug("```%s```", ret) return nil default: @@ -433,7 +422,10 @@ func (c Tuxbot) Dispatch(msg chat1.MsgSummary, args []string) (err error) { } func main() { - gotenv.Load(fmt.Sprintf("/keybase/team/%s/.kbfs_autogit/%s/keybot.env", os.Getenv("SECRETS_TEAM"), os.Getenv("SECRETS_REPO"))) + err := gotenv.Load(fmt.Sprintf("/keybase/team/%s/.kbfs_autogit/%s/tuxbot.env", os.Getenv("SECRETS_TEAM"), os.Getenv("SECRETS_REPO"))) + if err != nil { + panic(err) + } keybaseBinaryPath := flag.String("keybase-bin-path", "keybase", "the location of the keybase app") botName := flag.String("bot-name", "tuxbot", "the name of this bot")