Skip to content

Commit

Permalink
Remove target variable #2213
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Dec 22, 2023
1 parent a15a813 commit 4209a98
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
14 changes: 7 additions & 7 deletions tools/earthly/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ ARG name
ARG version
RUN <<EOF
check-github-release-asset "earthly/earthly" "v${version}" "earthly-linux-${alt_arch}"
curl --silent --location --fail --output "${prefix}${target}/bin/earthly" \
curl --silent --location --fail --output "${prefix}/bin/earthly" \
"https://github.com/earthly/earthly/releases/download/v${version}/earthly-linux-${alt_arch}"
chmod +x "${prefix}${target}/bin/earthly"
"${prefix}${target}/bin/earthly" bootstrap --with-autocomplete --no-buildkit
cp /usr/share/bash-completion/completions/earthly "${prefix}${target}/share/bash-completion/completions/earthly"
sed -i "s|${prefix}||" "${prefix}${target}/share/bash-completion/completions/earthly"
cp /usr/local/share/zsh/site-functions/_earthly "${prefix}${target}/share/zsh/vendor-completions/_earthly"
sed -i "s|${prefix}||" "${prefix}${target}/share/zsh/vendor-completions/_earthly"
chmod +x "${prefix}/bin/earthly"
"${prefix}/bin/earthly" bootstrap --with-autocomplete --no-buildkit
cp /usr/share/bash-completion/completions/earthly "${prefix}/share/bash-completion/completions/earthly"
sed -i "s|${prefix}||" "${prefix}/share/bash-completion/completions/earthly"
cp /usr/local/share/zsh/site-functions/_earthly "${prefix}/share/zsh/vendor-completions/_earthly"
sed -i "s|${prefix}||" "${prefix}/share/zsh/vendor-completions/_earthly"
EOF
2 changes: 1 addition & 1 deletion tools/ekz/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ ARG version
RUN <<EOF
check-github-release-asset "chanwit/ekz" "v${version}" "ekz_${version}_linux_${alt_arch}.tar.gz"
curl --silent --location --fail "https://github.com/chanwit/ekz/releases/download/v${version}/ekz_${version}_linux_${alt_arch}.tar.gz" \
| tar --extract --gzip --directory="${prefix}${target}/bin" --no-same-owner \
| tar --extract --gzip --directory="${prefix}/bin" --no-same-owner \
ekz
EOF
4 changes: 2 additions & 2 deletions tools/emoj/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ ARG name
ARG version
COPY --link --from=nodejs / /
COPY --link --from=npm / /
WORKDIR ${prefix}${target}/libexec/emoj
WORKDIR ${prefix}/libexec/emoj
ARG name
ARG version
RUN <<EOF
npm install \
--omit=dev \
"emoj@${version}"
ln --symbolic --relative --force "${prefix}${target}/libexec/emoj/node_modules/.bin/emoj" "${prefix}${target}/bin/"
ln --symbolic --relative --force "${prefix}/libexec/emoj/node_modules/.bin/emoj" "${prefix}/bin/"
EOF
2 changes: 1 addition & 1 deletion tools/emojisum/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export CGO_ENABLED=0
export GO111MODULE=auto
go mod tidy
go build -ldflags "-w -s" -o "/usr/local/bin/emojisum" .
cp /usr/local/bin/emojisum "${prefix}${target}/bin/"
cp /usr/local/bin/emojisum "${prefix}/bin/"
EOF
4 changes: 2 additions & 2 deletions tools/envcli/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG name
ARG version
RUN <<EOF
check-github-release-asset "EnvCLI/EnvCLI" "v${version}" "linux_${alt_arch}"
curl --silent --location --fail --output "${prefix}${target}/bin/envcli" \
curl --silent --location --fail --output "${prefix}/bin/envcli" \
"https://github.com/EnvCLI/EnvCLI/releases/download/v${version}/linux_${alt_arch}"
chmod +x "${prefix}${target}/bin/envcli"
chmod +x "${prefix}/bin/envcli"
EOF
2 changes: 1 addition & 1 deletion tools/envsub/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ git clone -q --config advice.detachedHead=false --depth 1 --branch "${version}"
export CARGO_HOME=/usr/local/cargo
export RUSTUP_HOME=/usr/local/rustup
cargo build --release --target x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/envsub "${prefix}${target}/bin/"
cp target/x86_64-unknown-linux-gnu/release/envsub "${prefix}/bin/"
EOF
2 changes: 1 addition & 1 deletion tools/etcd/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ARG version
RUN <<EOF
check-github-release-asset "etcd-io/etcd" "v${version}" "etcd-v${version}-linux-${alt_arch}.tar.gz"
curl --silent --location --fail "https://github.com/etcd-io/etcd/releases/download/v${version}/etcd-v${version}-linux-${alt_arch}.tar.gz" \
| tar --extract --gzip --directory="${prefix}${target}/bin" --strip-components=1 --no-same-owner \
| tar --extract --gzip --directory="${prefix}/bin" --strip-components=1 --no-same-owner \
etcd-v${version}-linux-${alt_arch}/etcd \
etcd-v${version}-linux-${alt_arch}/etcdctl
EOF
10 changes: 5 additions & 5 deletions tools/etcdadm/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ ARG name
ARG version
RUN <<EOF
check-github-release-asset "kubernetes-sigs/etcdadm" "v${version}" "etcdadm-linux-${alt_arch}"
curl --silent --location --fail --output "${prefix}${target}/bin/etcdadm" \
curl --silent --location --fail --output "${prefix}/bin/etcdadm" \
"https://github.com/kubernetes-sigs/etcdadm/releases/download/v${version}/etcdadm-linux-${alt_arch}"
chmod +x "${prefix}${target}/bin/etcdadm"
chmod +x "${prefix}/bin/etcdadm"
EOF

# completion
#RUN <<EOF
#"${prefix}${target}/bin/foo" completion bash >"${prefix}${target}/share/bash-completion/completions/foo"
#"${prefix}${target}/bin/foo" completion fish >"${prefix}${target}/share/fish/vendor_completions.d/foo.fish"
#"${prefix}${target}/bin/foo" completion zsh >"${prefix}${target}/share/zsh/vendor-completions/_foo"
#"${prefix}/bin/foo" completion bash >"${prefix}/share/bash-completion/completions/foo"
#"${prefix}/bin/foo" completion fish >"${prefix}/share/fish/vendor_completions.d/foo.fish"
#"${prefix}/bin/foo" completion zsh >"${prefix}/share/zsh/vendor-completions/_foo"
#EOF
12 changes: 6 additions & 6 deletions tools/exa/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ filename="$(basename "${url}")"
curl --silent --location --fail --remote-name "${url}"
unzip -q -o -d "/tmp" "${filename}"

mv /tmp/bin/exa "${prefix}${target}/bin/"
mv /tmp/man/exa.1 "${prefix}${target}/share/man/man1/"
mv /tmp/man/exa_colors.5 "${prefix}${target}/share/man/man5/"
mv /tmp/completions/exa.bash "${prefix}${target}/share/bash-completion/completions/exa"
mv /tmp/completions/exa.fish "${prefix}${target}/share/fish/vendor_completions.d/exa.fish"
mv /tmp/completions/exa.zsh "${prefix}${target}/share/zsh/vendor-completions/_exa"
mv /tmp/bin/exa "${prefix}/bin/"
mv /tmp/man/exa.1 "${prefix}/share/man/man1/"
mv /tmp/man/exa_colors.5 "${prefix}/share/man/man5/"
mv /tmp/completions/exa.bash "${prefix}/share/bash-completion/completions/exa"
mv /tmp/completions/exa.fish "${prefix}/share/fish/vendor_completions.d/exa.fish"
mv /tmp/completions/exa.zsh "${prefix}/share/zsh/vendor-completions/_exa"
EOF

0 comments on commit 4209a98

Please sign in to comment.