File tree Expand file tree Collapse file tree 4 files changed +61
-1
lines changed Expand file tree Collapse file tree 4 files changed +61
-1
lines changed Original file line number Diff line number Diff line change 15
15
16
16
# file used as part of the build configuration
17
17
/nginx-tag
18
+
19
+ # scratch directory for preparing releases
20
+ /.release /
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ ask() {
67
67
68
68
built_tag=" nginx-datadog-build-$nginx_tag "
69
69
if ! ask " Build image compatible with nginx:$nginx_tag and tag as $built_tag ?" ; then
70
- exit
70
+ exit 1
71
71
fi
72
72
docker build --build-arg " BASE_IMAGE=nginx:$nginx_tag " --tag " $built_tag " " $repo "
73
73
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # Create a github draft prelease.
4
+
5
+ set -e
6
+
7
+ REPO=$( dirname " $( dirname " $( realpath " $0 " ) " ) " )
8
+ cd " $REPO "
9
+ release_tag=$( < release.json jq --raw-output .release_tag)
10
+
11
+ build_module () {
12
+ printf ' %s' " $nginx_tag " > nginx-tag
13
+
14
+ # `docker build` the build image, if it isn't already built.
15
+ bin/docker_build.sh --yes
16
+ # clean slate
17
+ make clobber
18
+ # Build the nginx module in the build image created above.
19
+ make build-in-docker
20
+ cp .docker-build/libngx_http_datadog_module.so .release/ngx_http_datadog_module.so
21
+ cd .release
22
+ tar cvzf " ${nginx_tag} -ngx_http_datadog_module.so.tgz" ngx_http_datadog_module.so
23
+ gpg --armor --detach-sign " ${nginx_tag} -ngx_http_datadog_module.so.tgz"
24
+ rm ngx_http_datadog_module.so
25
+ cd -
26
+ }
27
+
28
+ # Build one module per nginx tag listed in $REPO/release.json
29
+ # But first, warn and prompt if there are files in .release/
30
+ mkdir -p .release
31
+ if [ " $( ls .release | wc -l) " -ne 0 ]; then
32
+ while true ; do
33
+ printf ' .release/ is not empty. Delete contents first?\n'
34
+ ls .release
35
+ printf ' [yN] '
36
+ read response
37
+ case " $response " in
38
+ y|Y|yes|YES) rm .release/* ; break ;;
39
+ n|N|no|NO|" " ) break ;;
40
+ * ) printf " \nI don't understand.\n" ;;
41
+ esac
42
+ done
43
+ fi
44
+
45
+ < release.json jq --raw-output .nginx_tags[] | { while read nginx_tag || [ -n " $nginx_tag " ]; do
46
+ build_module " $nginx_tag "
47
+ done }
48
+
49
+ cd .release
50
+ gh release create --prerelease --draft --title " $release_tag " --notes ' TODO' " $release_tag " * .tgz * .asc
Original file line number Diff line number Diff line change
1
+ {
2
+ "release_tag" : " v0.3.0" ,
3
+ "nginx_tags" : [
4
+ " 1.18.0-alpine" ,
5
+ " 1.19.1"
6
+ ]
7
+ }
You can’t perform that action at this time.
0 commit comments