Skip to content

Commit

Permalink
vagrant fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
heronhaye committed Mar 20, 2020
1 parent 972b0c2 commit 0b120b4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 31 deletions.
12 changes: 6 additions & 6 deletions packaging/linux/build_and_push_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
12 changes: 6 additions & 6 deletions packaging/linux/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
12 changes: 6 additions & 6 deletions packaging/linux/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
Expand Down
18 changes: 5 additions & 13 deletions packaging/linux/tuxbot/bot/tuxbot/tuxbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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:
Expand All @@ -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")
Expand Down

0 comments on commit 0b120b4

Please sign in to comment.