2018-12-31 12:53:21 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Install git (required to fetch acme.sh)
|
2020-11-17 17:51:56 +01:00
|
|
|
apk --no-cache --virtual .acmesh-deps add git
|
2018-12-31 12:53:21 +01:00
|
|
|
|
2020-11-17 23:06:14 +01:00
|
|
|
# Get acme.sh ACME client source
|
2018-12-31 12:53:21 +01:00
|
|
|
mkdir /src
|
|
|
|
git -C /src clone https://github.com/Neilpang/acme.sh.git
|
|
|
|
cd /src/acme.sh
|
2020-11-17 23:06:14 +01:00
|
|
|
if [[ "$ACMESH_VERSION" != "master" ]]; then
|
|
|
|
git -c advice.detachedHead=false checkout "$ACMESH_VERSION"
|
|
|
|
fi
|
2018-12-31 12:53:21 +01:00
|
|
|
|
|
|
|
# Install acme.sh in /app
|
|
|
|
./acme.sh --install \
|
|
|
|
--nocron \
|
|
|
|
--auto-upgrade 0 \
|
|
|
|
--home /app \
|
|
|
|
--config-home /etc/acme.sh/default
|
|
|
|
|
|
|
|
# Make house cleaning
|
|
|
|
cd /
|
|
|
|
rm -rf /src
|
2020-11-17 17:51:56 +01:00
|
|
|
apk del .acmesh-deps
|