diff --git a/projects/coredns-utils/build b/projects/coredns-utils/build new file mode 100644 index 0000000..6b3a486 --- /dev/null +++ b/projects/coredns-utils/build @@ -0,0 +1,35 @@ +#!/bin/bash +[% c("var/set_default_env") -%] +[% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %] +export CGO_ENABLED=[% c("var/cgo") %] +distdir=/var/tmp/dist/[% project %] +mkdir -p $distdir + +[% FOREACH dep = c("var/go_lib_deps") -%] + tar -C /var/tmp/dist -xf [% c('input_files_by_name/' _ dep) %] +[% END -%] + +mkdir -p $GOPATH/src/github.com/coredns +tar -C $GOPATH/src/github.com/coredns -xf [% project %]-[% c('version') %].tar.gz +mv $GOPATH/src/github.com/coredns/coredns-utils-[% c('version') %] $GOPATH/src/github.com/coredns/coredns-utils + +# TODO: Remove static build ID after migrating to Go 1.13.3+ +go install $TAGS -ldflags '-s -buildid=' github.com/coredns/coredns-utils/coredns-keygen + +[% IF c("var/linux-x86_64") -%] + GOPATHBIN="${GOPATH}/bin" +[% ELSE -%] + GOPATHBIN="${GOPATH}/bin/${GOOS}_${GOARCH}" +[% END -%] + +cd /var/tmp/dist + +# Build as executable + +cp -a $GOPATHBIN/coredns-keygen[% IF c("var/windows") %].exe[% END %] $distdir/ + +cd $distdir +[% c('tar', { + tar_src => [ '.' ], + tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), + }) %] diff --git a/projects/coredns-utils/config b/projects/coredns-utils/config new file mode 100644 index 0000000..8497af2 --- /dev/null +++ b/projects/coredns-utils/config @@ -0,0 +1,22 @@ +version: '[% c("abbrev") %]' +git_url: https://github.com/coredns/coredns-utils.git +git_hash: 'c07df082698203e12b1b31dea9c6183cc676833e' +filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz' + +var: + container: + use_container: 1 + go_lib_deps: + - godns + go_lib_install: + - github.com/coredns/coredns-utils/coredns-keygen + cgo: 0 + build_go_lib_pre: | + export CGO_ENABLED=[% c("var/cgo") %] + +input_files: + - project: container-image + - name: go + project: go + - name: godns + project: godns