forked from certbot/certbot-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·63 lines (52 loc) · 1.79 KB
/
build.sh
File metadata and controls
executable file
·63 lines (52 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# This script builds certbot docker and certbot dns plugins docker against a given release version of certbot.
# The build is done following the environment used by Dockerhub to handle its autobuild feature, and so can be
# used as a pre-deployment validation test.
# Usage: ./build.sh [VERSION]
# with [VERSION] corresponding to a released version of certbot, like `v0.34.0`
trap Cleanup 1 2 3 6
Cleanup() {
if [ ! -z "$WORK_DIR" ]; then
rm -rf "$WORK_DIR"/core/qemu-*-static || true
rm -rf "$WORK_DIR"/plugin/qemu-*-static || true
fi
popd 2> /dev/null || true
}
Build() {
DOCKER_REPO="$1"
CERTBOT_VERSION="$2"
CONTEXT_PATH="$3"
DOCKERFILE_PATH="$CONTEXT_PATH/Dockerfile"
DOCKER_TAG="$CERTBOT_VERSION"
pushd "$CONTEXT_PATH"
DOCKER_TAG="$DOCKER_TAG" DOCKER_REPO="$DOCKER_REPO" DOCKERFILE_PATH="$DOCKERFILE_PATH" bash hooks/pre_build
DOCKER_TAG="$DOCKER_TAG" DOCKER_REPO="$DOCKER_REPO" DOCKERFILE_PATH="$DOCKERFILE_PATH" bash hooks/build
popd
}
WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
CERTBOT_VERSION="$1"
# Step 1: Certbot core Docker
Build "certbot/certbot" "$CERTBOT_VERSION" "$WORK_DIR/core"
# Step 2: Certbot dns plugins Dockers
CERTBOT_PLUGINS_DOCKER_REPOS=(
"certbot/dns-dnsmadeeasy"
"certbot/dns-dnsimple"
"certbot/dns-ovh"
"certbot/dns-cloudflare"
"certbot/dns-cloudxns"
"certbot/dns-digitalocean"
"certbot/dns-google"
"certbot/dns-luadns"
"certbot/dns-nsone"
"certbot/dns-rfc2136"
"certbot/dns-route53"
"certbot/dns-gehirn"
"certbot/dns-linode"
"certbot/dns-sakuracloud"
)
for DOCKER_REPO in "${CERTBOT_PLUGINS_DOCKER_REPOS[@]}"; do
Build "${DOCKER_REPO}" "$CERTBOT_VERSION" "$WORK_DIR/plugin"
done
Cleanup