├── bin ├── release ├── detect └── compile ├── Dockerfile ├── README.md └── LICENSE /bin/release: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/release 3 | -------------------------------------------------------------------------------- /bin/detect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/detect 3 | 4 | echo 'azcopy' 5 | exit 0 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM heroku/heroku:24 2 | 3 | COPY . /tmp/buildpack 4 | 5 | RUN mkdir /tmp/build /tmp/cache /tmp/env 6 | 7 | RUN /tmp/buildpack/bin/detect /tmp/build 8 | RUN /tmp/buildpack/bin/compile /tmp/build /tmp/cache /tmp/env 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Heroku buildpack for azcopy 2 | ================================ 3 | 4 | This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) 5 | that allows one to run azcopy in a dyno alongside application code. 6 | 7 | # Testing buildpack locally 8 | 9 | ```sh 10 | DOCKER_DEFAULT_PLATFORM=linux/amd64 docker build . 11 | ``` 12 | -------------------------------------------------------------------------------- /bin/compile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/compile 3 | 4 | set -euo pipefail 5 | 6 | function indent() { 7 | c='s/^/ /' 8 | case $(uname) in 9 | Darwin) sed -l "$c";; 10 | *) sed -u "$c";; 11 | esac 12 | } 13 | 14 | AZCOPY_URL="https://aka.ms/downloadazcopy-v10-linux" 15 | 16 | BUILD_DIR=$1 17 | INSTALL_DIR="/app/.azcopy" 18 | TMP_DIR=$(mktemp -d) 19 | 20 | echo "-----> Downloading azcopy" 21 | curl --silent --show-error --fail -L -o "${TMP_DIR}/azcopy.tar.gz" "${AZCOPY_URL}" |& indent 22 | tar --strip-components=1 -xvzf "${TMP_DIR}/azcopy.tar.gz" -C "${TMP_DIR}" |& indent 23 | 24 | echo "-----> Installing azcopy" 25 | mkdir -p "${BUILD_DIR}/.azcopy" 26 | cp "${TMP_DIR}/azcopy" "${BUILD_DIR}/.azcopy/" |& indent 27 | "${BUILD_DIR}/.azcopy/azcopy" --version |& indent 28 | 29 | mkdir -p "${BUILD_DIR}/.profile.d" 30 | cat > "${BUILD_DIR}/.profile.d/azcopy.sh" <<'PROFILE' 31 | export PATH="/app/.azcopy:${PATH}" 32 | PROFILE 33 | 34 | rm -rf "${TMP_DIR}" 35 | 36 | echo "-----> Successfully installed azcopy" 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Attribution 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------