forked from postgis/postgis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be0507f
commit 037c8a1
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
if [ -n "${KX_BUILD_DEBUG-}" ]; then | ||
echo "Enabling script debugging..." | ||
set -x | ||
fi | ||
|
||
export TIMEFORMAT='🕑 %1lR' | ||
export [email protected] | ||
export DEBFULLNAME="Koordinates CI Builder" | ||
|
||
echo "Updating changelog..." | ||
|
||
if which ggrep ; then | ||
# so we can run this locally on MacOS | ||
# (run `brew install grep` to install this) | ||
GREP=ggrep | ||
else | ||
GREP=grep | ||
fi | ||
|
||
# add version number vars | ||
source ./Version.config | ||
|
||
DEB_BASE_VERSION="${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}" | ||
DEB_VERSION="${DEB_BASE_VERSION}+kx-ci${BUILDKITE_BUILD_NUMBER}-$(git show -s --date=format:%Y%m%d --format=git%cd.%h)" | ||
echo "Debian Package Version: ${DEB_VERSION}" | ||
|
||
if [ -n "${BUILDKITE_AGENT_ACCESS_TOKEN-}" ] ; then | ||
buildkite-agent meta-data set deb-base-version "$DEB_BASE_VERSION" | ||
buildkite-agent meta-data set deb-version "$DEB_VERSION" | ||
|
||
echo -e ":debian: Package Version: \`${DEB_VERSION}\`" \ | ||
| buildkite-agent annotate --style info --context deb-version | ||
fi | ||
|
||
time docker run \ | ||
-v "$(pwd):/src" \ | ||
-w "/src" \ | ||
-e DEBEMAIL \ | ||
-e DEBFULLNAME \ | ||
"${ECR}/ci-tools:latest" \ | ||
dch --distribution jammy --newversion "${DEB_VERSION}" "Koordinates CI build of ${BUILDKITE_COMMIT}: branch=${BUILDKITE_BRANCH} tag=${BUILDKITE_TAG-}" | ||
|
||
BUILD_CONTAINER="build-${BUILDKITE_JOB_ID}" | ||
|
||
echo "--- Building debian package ..." | ||
# Uses a docker volume for ccache | ||
time docker run \ | ||
--name "${BUILD_CONTAINER}" \ | ||
-v "$(pwd):/kx/source" \ | ||
-v "ccache:/ccache" \ | ||
-e CCACHE_DIR=/ccache \ | ||
-w "/kx/source" \ | ||
"${ECR}/jammybuild:master.latest" \ | ||
/kx/buildscripts/build_binary_package.sh -uc -us | ||
|
||
echo "--- Signing debian archives ..." | ||
time docker run \ | ||
-v "$(pwd):/src" \ | ||
-e "GPG_KEY=${APT_GPG_KEY}" \ | ||
-w "/src" \ | ||
"${ECR}/ci-tools:latest" \ | ||
sign-debs "/src/build-jammy/*.deb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
steps: | ||
- label: ':debian: Build & Package & Test' | ||
command: ".buildkite/build.sh" | ||
artifact_paths: | ||
- "build-jammy/*" | ||
|
||
- block: "Release?" | ||
prompt: "Release to archive? Check the test results first!" | ||
|
||
- label: ':debian: Publish deb' | ||
command: | ||
- > | ||
aptly-upload | ||
--aptly-url https://apt-repo.kx.gd | ||
--retries 3 | ||
--repo kx-builds-jammy | ||
--series jammy | ||
build-jammy/*.deb | ||
retry: | ||
automatic: true | ||
plugins: | ||
artifacts#v1.2.0: | ||
download: "build-jammy/*.deb" | ||
docker#v1.4.0: | ||
image: "${ECR}/ci-tools" | ||
always-pull: true | ||
workdir: /src | ||
environment: | ||
- APTLY_UNAME | ||
- APTLY_PASSWD |