Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kikito committed Sep 12, 2024
1 parent fbbdfe3 commit 4f3140a
Show file tree
Hide file tree
Showing 42 changed files with 2,232 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.DS_Store
.che
kong-build-tools
kong
*.bak
submit
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,8 @@ build_v2:

test: KONG_DOCKER_TAG?=$(DOCKER_TAG)
test:
mkdir ./tmp
pushd tmp
cd kong-build-tools; \
BASE=$(BASE) ./tests/test.sh --suite "Docker-Kong test suite"
popd
rm -rf tmp

release-rhel: build_v2
$(MAKE) PACKAGE=rpm build_v2
Expand Down
58 changes: 58 additions & 0 deletions kong-build-tools/.ci/setup_ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# This script configures CI systems such that they're capable of building our ARM64 assets

set -x

if [ "$RESTY_IMAGE_TAG" != "bionic" ] && [ "$RESTY_IMAGE_TAG" != "18.04" ] && [ "$RESTY_IMAGE_BASE" != "alpine" ]; then
exit 0
fi

if uname -a | grep -qs -i darwin; then
exit 0
fi

sudo apt-get install -y \
qemu \
binfmt-support \
qemu-user-static

docker version
RESULT=$?
if [ "$RESULT" != "0" ]; then
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) test"
sudo apt-get update
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install containerd.io docker-ce
fi

if test -d /etc/docker; then
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
fi

docker buildx version
RESULT=$?
if [ "$RESULT" != "0" ]; then
curl -fsSLo buildx https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-amd64
mkdir -p ~/.docker/cli-plugins/
chmod +x buildx
mv buildx ~/.docker/cli-plugins/docker-buildx
sudo service docker restart
fi

if ! [ -x "$(command -v docker-machine)" ]; then
curl -L https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-$(uname -s)-$(uname -m) >docker-machine
sudo install docker-machine /usr/local/bin/docker-machine
fi

set -e
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true
echo "$REDHAT_PASSWORD" | docker login -u "$REDHAT_USERNAME" registry.access.redhat.com --password-stdin || true
docker-machine version
docker version
docker buildx version

export BUILDX=true

command -v ssh-agent >/dev/null || ( sudo apt-get update -y && sudo apt-get install openssh-client -y )
eval $(ssh-agent -s)
1 change: 1 addition & 0 deletions kong-build-tools/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kong/servroot*
6 changes: 6 additions & 0 deletions kong-build-tools/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "docker" # See documentation for possible values
directory: "/dockerfiles" # Location of package manifests
schedule:
interval: "daily"
21 changes: 21 additions & 0 deletions kong-build-tools/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Release

on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- master

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Release
id: release
uses: ahmadnassri/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions kong-build-tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kong
docker-kong
id_rsa.private
kong_license.private
*.deb
*.rpm
openresty-build-tools/build
github-token
6 changes: 6 additions & 0 deletions kong-build-tools/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "lua-kong-nginx-module"]
path = lua-kong-nginx-module
url = [email protected]:Kong/lua-kong-nginx-module.git
[submodule "lua-resty-lmdb"]
path = lua-resty-lmdb
url = [email protected]:Kong/lua-resty-lmdb.git
45 changes: 45 additions & 0 deletions kong-build-tools/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"branches": ["+([0-9])?(.{+([0-9]),x}).x", "master", "next"],
"tagFormat": "${version}",
"repositoryUrl": "https://github.com/Kong/kong-build-tools.git",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{ "breaking": true, "release": "major" },
{ "revert": true, "release": "patch" },
{ "type": "build", "release": "patch" },
{ "type": "docs", "release": "patch" },
{ "type": "feat", "release": "minor" },
{ "type": "fix", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "refactor", "release": "patch" },
{ "type": "chore", "release": "patch" }
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "build", "section": "Build", "hidden": false },
{ "type": "chore", "section": "Chores", "hidden": false },
{ "type": "ci", "section": "CI/CD", "hidden": false },
{ "type": "docs", "section": "Docs", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance", "hidden": false },
{ "type": "refactor", "section": "Refactor", "hidden": false },
{ "type": "style", "section": "Code Style", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false }
]
}
}
],
"@semantic-release/github"
]
}
2 changes: 2 additions & 0 deletions kong-build-tools/.rpmmacros
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
%_signature gpg
%_gpg_name Kong Inc <[email protected]>
Loading

0 comments on commit 4f3140a

Please sign in to comment.