Skip to content

Commit 0b120b4

Browse files
committed
vagrant fixes
1 parent 972b0c2 commit 0b120b4

File tree

4 files changed

+23
-31
lines changed

4 files changed

+23
-31
lines changed

packaging/linux/build_and_push_packages.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ client_dir="$(git -C "$here" rev-parse --show-toplevel)"
1717

1818
echo "================================="
1919
echo "================================="
20-
if [ -v KEYBASE_TEST ]; then
20+
if [ -n "$KEYBASE_TEST" ]; then
2121
default_bucket_name="tests.keybase.io"
2222
echo "= This build+push is a TEST. ="
23-
elif [ -v KEYBASE_NIGHTLY ]; then
23+
elif [ -n "$KEYBASE_NIGHTLY" ]; then
2424
default_bucket_name="tests.keybase.io"
2525
echo "= This build+push is a NIGHTLY. ="
26-
elif [ -v KEYBASE_RELEASE ]; then
26+
elif [ -n "$KEYBASE_RELEASE" ]; then
2727
default_bucket_name="prerelease.keybase.io"
2828
echo "= This build+push is a RELEASE. ="
2929
else
@@ -119,7 +119,7 @@ copy_bins() {
119119
another_copy "$build_dir/rpm_repo/keybase-latest-x86_64.rpm" "s3://$1/keybase_amd64.rpm"
120120
another_copy "$build_dir/rpm_repo/keybase-latest-i386.rpm" "s3://$1/keybase_i386.rpm"
121121
}
122-
if [ -v KEYBASE_RELEASE ]; then
122+
if [ -n "$KEYBASE_RELEASE" ]; then
123123
copy_bins "$BUCKET_NAME"
124124
fi
125125

@@ -141,12 +141,12 @@ GOPATH="$release_gopath" PLATFORM="linux" "$here/../prerelease/s3_index.sh" || \
141141
echo "ERROR in s3_index.sh. Internal pages might not be updated. Build continuing..."
142142

143143
NIGHTLY_DIR="prerelease.keybase.io/nightly" # No trailing slash! AWS doesn't respect POSIX standards w.r.t double slashes
144-
if [ -v KEYBASE_NIGHTLY ] ; then
144+
if [ -n "$KEYBASE_NIGHTLY" ] ; then
145145
copy_bins "$NIGHTLY_DIR"
146146
copy_metadata "$NIGHTLY_DIR"
147147
fi
148148

149-
if [ -v KEYBASE_RELEASE ] ; then
149+
if [ -n "$KEYBASE_RELEASE" ] ; then
150150
echo "Updating AUR packages"
151151
"$here/arch/update_aur_packages.sh" "$build_dir"
152152
fi

packaging/linux/docker/build.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ gpg_tempfile="$client_dir/.docker/code_signing_key"
1414
gpg --export-secret-key --armor "$code_signing_fingerprint" > "$gpg_tempfile"
1515

1616
# Clear all existing base images
17-
docker rmi golang:1.13.7-stretch || true
18-
docker rmi debian:stretch || true
17+
sudo docker rmi golang:1.13.7-stretch || true
18+
sudo docker rmi debian:stretch || true
1919

2020
# Build all three variants
21-
docker build \
21+
sudo docker build \
2222
--build-arg SOURCE_COMMIT="$source_commit" \
2323
--build-arg SIGNING_FINGERPRINT="$code_signing_fingerprint" \
2424
-f "$client_dir/packaging/linux/docker/standard/Dockerfile" \
2525
-t "keybaseio/client:$tag" \
2626
"$client_dir"
2727

28-
docker build \
28+
sudo docker build \
2929
--build-arg BASE_IMAGE="keybaseio/client:$tag" \
3030
-f "$client_dir/packaging/linux/docker/slim/Dockerfile" \
3131
-t "keybaseio/client:$tag-slim" \
3232
"$client_dir"
3333

34-
docker build \
34+
sudo docker build \
3535
--build-arg BASE_IMAGE="keybaseio/client:$tag" \
3636
-f "$client_dir/packaging/linux/docker/node/Dockerfile" \
3737
-t "keybaseio/client:$tag-node" \
3838
"$client_dir"
3939

40-
docker build \
40+
sudo docker build \
4141
--build-arg BASE_IMAGE="keybaseio/client:$tag" \
4242
-f "$client_dir/packaging/linux/docker/node-slim/Dockerfile" \
4343
-t "keybaseio/client:$tag-node-slim" \

packaging/linux/docker_build.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ else
7878
fi
7979

8080
echo '=== docker ==='
81-
docker run "${interactive_args[@]:+${interactive_args[@]}}" \
81+
sudo docker run "${interactive_args[@]:+${interactive_args[@]}}" \
8282
-v "$work_dir:/root" \
8383
-v "$clientdir:/CLIENT:ro" \
8484
-v "$gpg_tempdir:/GPG" \
8585
-v "$ssh_temp:/SSH:ro" \
8686
-v "$s3cmd_temp:/S3CMD:ro" \
87-
-e "BUCKET_NAME" \
88-
-e "KEYBASE_RELEASE" \
89-
-e "KEYBASE_NIGHTLY" \
90-
-e "KEYBASE_TEST" \
91-
-e "KEYBASE_TEST_CODE_SIGNING_KEY" \
87+
-e "BUCKET_NAME=${BUCKET_NAME:-}" \
88+
-e "KEYBASE_RELEASE=${KEYBASE_RELEASE:-}" \
89+
-e "KEYBASE_NIGHTLY=${KEYBASE_NIGHTLY:-}" \
90+
-e "KEYBASE_TEST=${KEYBASE_TEST:-}" \
91+
-e "KEYBASE_TEST_CODE_SIGNING_KEY=${KEYBASE_TEST_CODE_SIGNING_KEY:-}" \
9292
--rm \
9393
"$image" \
9494
bash /CLIENT/packaging/linux/inside_docker_main.sh "$@"

packaging/linux/tuxbot/bot/tuxbot/tuxbot.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,6 @@ func (c Tuxbot) Dispatch(msg chat1.MsgSummary, args []string) (err error) {
253253
commit := "HEAD"
254254
if len(args) > 0 {
255255
commit = args[0]
256-
257-
gitCmd := makeCmd(currentUser, "git", "--no-pager", "log", "--oneline", fmt.Sprintf("%s...", commit))
258-
gitCmd.Stdout = nil
259-
gitCmd.Stderr = nil
260-
ret, err := gitCmd.CombinedOutput()
261-
if err != nil {
262-
return err
263-
}
264-
if bytes.Count(ret, []byte("\n")) > 500 {
265-
return fmt.Errorf("%s is more than 500 revisions behind HEAD, refusing to build", commit)
266-
}
267256
}
268257
c.Locked = true
269258
go func() {
@@ -424,7 +413,7 @@ func (c Tuxbot) Dispatch(msg chat1.MsgSummary, args []string) (err error) {
424413
c.Debug("```%s```", ret)
425414
return nil
426415
case "journal":
427-
ret, _ := exec.Command("sudo", "journalctl", "-n", "50").CombinedOutput()
416+
ret, _ := exec.Command("sudo", "journalctl", "-n", "100").CombinedOutput()
428417
c.Debug("```%s```", ret)
429418
return nil
430419
default:
@@ -433,7 +422,10 @@ func (c Tuxbot) Dispatch(msg chat1.MsgSummary, args []string) (err error) {
433422
}
434423

435424
func main() {
436-
gotenv.Load(fmt.Sprintf("/keybase/team/%s/.kbfs_autogit/%s/keybot.env", os.Getenv("SECRETS_TEAM"), os.Getenv("SECRETS_REPO")))
425+
err := gotenv.Load(fmt.Sprintf("/keybase/team/%s/.kbfs_autogit/%s/tuxbot.env", os.Getenv("SECRETS_TEAM"), os.Getenv("SECRETS_REPO")))
426+
if err != nil {
427+
panic(err)
428+
}
437429

438430
keybaseBinaryPath := flag.String("keybase-bin-path", "keybase", "the location of the keybase app")
439431
botName := flag.String("bot-name", "tuxbot", "the name of this bot")

0 commit comments

Comments
 (0)