Skip to content

Commit 6dbe756

Browse files
[cleanup] Fix indentation in bash scripts (#1487)
Summary: The indentation in our bash scripts was a mix of 2 spaces and 4 spaces. This PR standardizes on 2 spaces. Type of change: /kind cleanup Test Plan: N/A Signed-off-by: James Bartlett <jamesbartlett@pixielabs.ai>
1 parent fa3e48d commit 6dbe756

12 files changed

+297
-296
lines changed

ci/cli_build_release.sh

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ darwin_amd64_binary=$(bazel cquery -c opt //src/pixie_cli:px_darwin_amd64 --outp
3636
darwin_arm64_binary=$(bazel cquery -c opt //src/pixie_cli:px_darwin_arm64 --output starlark --starlark:expr "target.files.to_list()[0].path" 2> /dev/null)
3737

3838
bazel run -c opt //src/utils/artifacts/versions_gen:versions_gen -- \
39-
--repo_path "${repo_path}" --artifact_name cli --versions_file "${versions_file}"
39+
--repo_path "${repo_path}" --artifact_name cli --versions_file "${versions_file}"
4040

4141
bazel build -c opt --config=stamp //src/pixie_cli:px_darwin_amd64 //src/pixie_cli:px_darwin_arm64 //src/pixie_cli:px
4242

@@ -53,64 +53,64 @@ darwin_arm64_binary="${binary_dir}/$(basename "${darwin_arm64_binary}")"
5353
bazel run -c opt --config=stamp //src/pixie_cli:push_px_image
5454

5555
if [[ ! "$release_tag" == *"-"* ]]; then
56-
# Create rpm package.
57-
podman run -i --rm \
58-
-v "${binary_dir}:/src/" \
59-
-v "$(pwd):/image" \
60-
docker.io/cdrx/fpm-fedora:24 \
61-
fpm \
62-
-f \
63-
-p "/image/${pkg_prefix}.rpm" \
64-
-s dir \
65-
-t rpm \
66-
-n pixie-px \
67-
-v "${release_tag}" \
68-
--prefix /usr/local/bin \
69-
px
70-
71-
# Create deb package.
72-
podman run -i --rm \
73-
-v "${binary_dir}:/src/" \
74-
-v "$(pwd):/image" \
75-
docker.io/cdrx/fpm-ubuntu:18.04 \
76-
fpm \
77-
-f \
78-
-p "/image/${pkg_prefix}.deb" \
79-
-s dir \
80-
-t deb \
81-
-n pixie-px \
82-
-v "${release_tag}" \
83-
--prefix /usr/local/bin \
84-
px
56+
# Create rpm package.
57+
podman run -i --rm \
58+
-v "${binary_dir}:/src/" \
59+
-v "$(pwd):/image" \
60+
docker.io/cdrx/fpm-fedora:24 \
61+
fpm \
62+
-f \
63+
-p "/image/${pkg_prefix}.rpm" \
64+
-s dir \
65+
-t rpm \
66+
-n pixie-px \
67+
-v "${release_tag}" \
68+
--prefix /usr/local/bin \
69+
px
70+
71+
# Create deb package.
72+
podman run -i --rm \
73+
-v "${binary_dir}:/src/" \
74+
-v "$(pwd):/image" \
75+
docker.io/cdrx/fpm-ubuntu:18.04 \
76+
fpm \
77+
-f \
78+
-p "/image/${pkg_prefix}.deb" \
79+
-s dir \
80+
-t deb \
81+
-n pixie-px \
82+
-v "${release_tag}" \
83+
--prefix /usr/local/bin \
84+
px
8585

8686
# TODO(james): Add push to docker hub/quay.io.
8787
fi
8888

8989
gpg --no-tty --batch --yes --import "${BUILDBOT_GPG_KEY_FILE}"
9090

9191
write_artifacts_to_gcs() {
92-
output_path=$1
93-
copy_artifact_to_gcs "${output_path}" "${darwin_amd64_binary}" "cli_darwin_amd64_unsigned"
94-
copy_artifact_to_gcs "${output_path}" "${darwin_arm64_binary}" "cli_darwin_arm64_unsigned"
95-
copy_artifact_to_gcs "${output_path}" "${linux_binary}" "cli_linux_amd64"
96-
97-
if [[ ! "$release_tag" == *"-"* ]]; then
98-
# RPM/DEB only exists for release builds.
99-
copy_artifact_to_gcs "${output_path}" "$(pwd)/${pkg_prefix}.deb" "pixie-px.${linux_arch}.deb"
100-
copy_artifact_to_gcs "${output_path}" "$(pwd)/${pkg_prefix}.rpm" "pixie-px.${linux_arch}.rpm"
101-
fi
92+
output_path=$1
93+
copy_artifact_to_gcs "${output_path}" "${darwin_amd64_binary}" "cli_darwin_amd64_unsigned"
94+
copy_artifact_to_gcs "${output_path}" "${darwin_arm64_binary}" "cli_darwin_arm64_unsigned"
95+
copy_artifact_to_gcs "${output_path}" "${linux_binary}" "cli_linux_amd64"
96+
97+
if [[ ! "$release_tag" == *"-"* ]]; then
98+
# RPM/DEB only exists for release builds.
99+
copy_artifact_to_gcs "${output_path}" "$(pwd)/${pkg_prefix}.deb" "pixie-px.${linux_arch}.deb"
100+
copy_artifact_to_gcs "${output_path}" "$(pwd)/${pkg_prefix}.rpm" "pixie-px.${linux_arch}.rpm"
101+
fi
102102
}
103103

104104
sign_artifacts() {
105-
cp "${linux_binary}" "${artifacts_dir}/cli_linux_amd64"
106-
cp "$(pwd)/${pkg_prefix}.deb" "${artifacts_dir}/pixie-px.${linux_arch}.deb"
107-
cp "$(pwd)/${pkg_prefix}.rpm" "${artifacts_dir}/pixie-px.${linux_arch}.rpm"
108-
109-
pushd "${artifacts_dir}"
110-
gpg --no-tty --batch --yes --local-user "${BUILDBOT_GPG_KEY_ID}" --armor --detach-sign "cli_linux_amd64"
111-
gpg --no-tty --batch --yes --local-user "${BUILDBOT_GPG_KEY_ID}" --armor --detach-sign "pixie-px.${linux_arch}.deb"
112-
gpg --no-tty --batch --yes --local-user "${BUILDBOT_GPG_KEY_ID}" --armor --detach-sign "pixie-px.${linux_arch}.rpm"
113-
popd
105+
cp "${linux_binary}" "${artifacts_dir}/cli_linux_amd64"
106+
cp "$(pwd)/${pkg_prefix}.deb" "${artifacts_dir}/pixie-px.${linux_arch}.deb"
107+
cp "$(pwd)/${pkg_prefix}.rpm" "${artifacts_dir}/pixie-px.${linux_arch}.rpm"
108+
109+
pushd "${artifacts_dir}"
110+
gpg --no-tty --batch --yes --local-user "${BUILDBOT_GPG_KEY_ID}" --armor --detach-sign "cli_linux_amd64"
111+
gpg --no-tty --batch --yes --local-user "${BUILDBOT_GPG_KEY_ID}" --armor --detach-sign "pixie-px.${linux_arch}.deb"
112+
gpg --no-tty --batch --yes --local-user "${BUILDBOT_GPG_KEY_ID}" --armor --detach-sign "pixie-px.${linux_arch}.rpm"
113+
popd
114114
}
115115

116116
public="True"
@@ -123,7 +123,7 @@ output_path="gs://${bucket}/cli/${release_tag}"
123123
write_artifacts_to_gcs "${output_path}"
124124
# Check to see if it's production build. If so we should also write it to the latest directory.
125125
if [[ $public == "True" ]]; then
126-
output_path="gs://${bucket}/cli/latest"
127-
write_artifacts_to_gcs "${output_path}"
128-
sign_artifacts
126+
output_path="gs://${bucket}/cli/latest"
127+
write_artifacts_to_gcs "${output_path}"
128+
sign_artifacts
129129
fi

ci/helm_build_release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
set -ex
2020

2121
usage() {
22-
echo "Usage: $0 <version> <yaml_tar>"
23-
echo "Example: $0 0.1.2 /tmp/yamls.tar"
22+
echo "Usage: $0 <version> <yaml_tar>"
23+
echo "Example: $0 0.1.2 /tmp/yamls.tar"
2424
}
2525

2626
parse_args() {

ci/image_utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ push_images_for_arch() {
3030
build_type="$4"
3131

3232
bazel run --config=stamp -c opt --//k8s:image_version="${release_tag}-${arch}" \
33-
--config="${arch}_sysroot" \
34-
--config=stamp "${build_type}" "${image_rule}" > /dev/null
33+
--config="${arch}_sysroot" \
34+
--config=stamp "${build_type}" "${image_rule}" > /dev/null
3535
}
3636

3737
push_multiarch_image() {

ci/run_copybara.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ git_committer_email='copybara@pixielabs.ai'
2222
sky_file_path=$1
2323
if [[ -z "$sky_file_path" ]]
2424
then
25-
echo "Error: Missing argument."
26-
echo "Usage: $0 <sky_file>"
27-
exit 1
25+
echo "Error: Missing argument."
26+
echo "Usage: $0 <sky_file>"
27+
exit 1
2828
fi
2929

3030
# Copybara needs this configured, otherwise it's unhappy.
@@ -36,14 +36,14 @@ git config --global user.signingkey "${COPYBARA_GPG_KEY_ID}"
3636
git config --global commit.gpgsign true
3737

3838
copybara_args="--ignore-noop --git-committer-name ${git_committer_name} \
39-
--git-committer-email ${git_committer_email}"
39+
--git-committer-email ${git_committer_email}"
4040

4141
sky_file_dir=$(dirname "$sky_file_path")
4242
pushd "${sky_file_dir}" || exit
4343
copybara copy.bara.sky "${copybara_args}"
4444
retval=$?
4545
if [[ $retval -ne 0 && $retval -ne 4 ]]
4646
then
47-
exit "$retval"
47+
exit "$retval"
4848
fi
4949
popd || exit

ci/save_version_info.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ set -e
2121
git rev-parse HEAD > GIT_COMMIT
2222

2323
if [[ "${TAG_NAME}" == *"/v"* ]]; then
24-
# Valid tag is present so we write it to the versions file.
25-
echo "${TAG_NAME##*/v}" > VERSION
24+
# Valid tag is present so we write it to the versions file.
25+
echo "${TAG_NAME##*/v}" > VERSION
2626
else
27-
# No valid tag, treat it as a dev build.
28-
# We automatically set the last digit to the build number.
27+
# No valid tag, treat it as a dev build.
28+
# We automatically set the last digit to the build number.
2929

30-
# Semver tags can't contain extra "-"'s, so we need to remove them from the
31-
# job name.
32-
sanitized_job_name=$(echo "${JOB_NAME}" | sed -r 's/[\/%]//g')
33-
echo "0.0.${BUILD_NUMBER}-${sanitized_job_name}-dev" > VERSION
30+
# Semver tags can't contain extra "-"'s, so we need to remove them from the
31+
# job name.
32+
sanitized_job_name=$(echo "${JOB_NAME}" | sed -r 's/[\/%]//g')
33+
echo "0.0.${BUILD_NUMBER}-${sanitized_job_name}-dev" > VERSION
3434
fi

ci/update_readme_with_latest_release.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# SPDX-License-Identifier: Apache-2.0
1818

1919
usage() {
20-
echo "Usage: $0 <artifact_type> <version> <url>"
20+
echo "Usage: $0 <artifact_type> <version> <url>"
2121
}
2222

2323
if [ $# -lt 3 ]; then
@@ -33,12 +33,12 @@ readme_path="README.md"
3333
latest_release_comment="<!--${artifact_type}-latest-release-->"
3434

3535
pretty_artifact_name() {
36-
case "${artifact_type}" in
37-
cli) echo "CLI";;
38-
vizier) echo "Vizier";;
39-
operator) echo "Operator";;
40-
cloud) echo "Cloud";;
41-
esac
36+
case "${artifact_type}" in
37+
cli) echo "CLI";;
38+
vizier) echo "Vizier";;
39+
operator) echo "Operator";;
40+
cloud) echo "Cloud";;
41+
esac
4242
}
4343

4444
latest_release_line() {

0 commit comments

Comments
 (0)