From fd9e955b0781de9674e51e6361cba7ad39dc01bd Mon Sep 17 00:00:00 2001 From: Enrique Garcia Cota Date: Thu, 12 Sep 2024 13:12:00 +0200 Subject: [PATCH] chore(tests): clean unused files --- kong-build-tools/Jenkinsfile | 294 ------------------------------- kong-build-tools/LICENSE | 202 --------------------- kong-build-tools/README.md | 145 --------------- kong-build-tools/release-kong.sh | 132 -------------- kong-build-tools/sign-rpm.exp | 10 -- 5 files changed, 783 deletions(-) delete mode 100644 kong-build-tools/Jenkinsfile delete mode 100644 kong-build-tools/LICENSE delete mode 100644 kong-build-tools/README.md delete mode 100755 kong-build-tools/release-kong.sh delete mode 100755 kong-build-tools/sign-rpm.exp diff --git a/kong-build-tools/Jenkinsfile b/kong-build-tools/Jenkinsfile deleted file mode 100644 index 4252cd03..00000000 --- a/kong-build-tools/Jenkinsfile +++ /dev/null @@ -1,294 +0,0 @@ -pipeline { - agent none - triggers { - cron(env.BRANCH_NAME == 'master' ? '@weekly' : '') - } - environment { - KONG_SOURCE = "master" - KONG_SOURCE_LOCATION = "/tmp/kong" - DOCKER_USERNAME = "${env.DOCKERHUB_USR}" - DOCKER_PASSWORD = "${env.DOCKERHUB_PSW}" - DOCKERHUB = credentials('dockerhub') - DOCKER_CLI_EXPERIMENTAL = "enabled" - DEBUG = 0 - } - options { - retry(2) - timeout(time: 5, unit: 'HOURS') - } - stages { - stage('Enteprise Test Builds') { - environment { - DOCKER_REPOSITORY = "kong/kong-build-tools-private" - GITHUB_TOKEN = credentials('github_bot_access_token') - KONG_SOURCE = "master" - PULP = credentials('PULP') - PULP_PASSWORD = "${env.PULP_PSW}" - PULP_USERNAME = "${env.PULP_USR}" - } - when { - beforeAgent true - anyOf { - buildingTag() - branch 'master' - changeRequest target: 'master' - } - } - parallel { - stage('Kong Enterprise RPM'){ - agent { - node { - label 'bionic' - } - } - environment { - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - PATH = "/home/ubuntu/bin/:${env.PATH}" - PACKAGE_TYPE = "rpm" - PRIVATE_KEY_FILE = credentials('kong.private.gpg-key.asc') - PRIVATE_KEY_PASSPHRASE = credentials('kong.private.gpg-key.asc.password') - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --recursive --single-branch --branch ${KONG_SOURCE} https://github.com/Kong/kong-ee.git ${KONG_SOURCE_LOCATION}' - sh 'cp $PRIVATE_KEY_FILE kong.private.gpg-key.asc' - sh 'make RESTY_IMAGE_BASE=amazonlinux RESTY_IMAGE_TAG=2 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=amazonlinux RESTY_IMAGE_TAG=2022 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=centos RESTY_IMAGE_TAG=7 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=7.9 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=8.6 package-kong test cleanup' - } - } - stage('Kong Enterprise src & Alpine'){ - agent { - node { - label 'bionic' - } - } - environment { - PATH = "/home/ubuntu/bin/:${env.PATH}" - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --recursive --single-branch --branch ${KONG_SOURCE} git@github.com:Kong/kong-ee.git ${KONG_SOURCE_LOCATION}' - sh 'make RESTY_IMAGE_BASE=src RESTY_IMAGE_TAG=src PACKAGE_TYPE=src package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3 PACKAGE_TYPE=apk DOCKER_MACHINE_ARM64_NAME="jenkins-kong-"`cat /proc/sys/kernel/random/uuid` package-kong test cleanup' - } - } - stage('Kong Enterprise DEB') { - agent { - node { - label 'bionic' - } - } - environment { - PACKAGE_TYPE = "deb" - PATH = "/home/ubuntu/bin/:${env.PATH}" - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --recursive --single-branch --branch ${KONG_SOURCE} git@github.com:Kong/kong-ee.git ${KONG_SOURCE_LOCATION}' - sh 'make RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=10 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=11 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=18.04 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=20.04 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=22.04 package-kong test cleanup' - } - } - stage('Kong Enterprise BoringSSL') { - agent { - node { - label 'bionic' - } - } - environment { - PATH = "/home/ubuntu/bin/:${env.PATH}" - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - DOCKER_REPOSITORY = "kong/kong-build-tools-private" - KONG_PACKAGE_NAME = "kong-enterprise-edition-fips" - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --recursive --single-branch --branch ${KONG_SOURCE} git@github.com:Kong/kong-ee.git ${KONG_SOURCE_LOCATION}' - sh 'make PACKAGE_TYPE=rpm RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=8.6 SSL_PROVIDER=boringssl package-kong test cleanup' - sh 'make PACKAGE_TYPE=deb RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=20.04 SSL_PROVIDER=boringssl package-kong test cleanup' - sh 'make PACKAGE_TYPE=deb RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=22.04 SSL_PROVIDER=boringssl package-kong test cleanup' - } - } - stage('Kong EE master'){ - agent { - node { - label 'bionic' - } - } - environment { - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - PATH = "/home/ubuntu/bin/:${env.PATH}" - KONG_SOURCE = "master" - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'mkdir -p /home/ubuntu/bin/' - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --single-branch --branch ${KONG_SOURCE} https://github.com/Kong/kong-ee.git ${KONG_SOURCE_LOCATION}' - sh 'make PACKAGE_TYPE=deb RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=10 package-kong test cleanup' - sh 'make PACKAGE_TYPE=apk RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3 package-kong test cleanup' - sh 'make PACKAGE_TYPE=rpm RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=8.6 package-kong test cleanup' - - } - } - } - } - stage('OSS Test Builds') { - when { - beforeAgent true - anyOf { - buildingTag() - branch 'master' - changeRequest target: 'master' - } - } - parallel { - stage('Kong OSS 2.8.0'){ - agent { - node { - label 'bionic' - } - } - environment { - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - PATH = "/home/ubuntu/bin/:${env.PATH}" - KONG_SOURCE = "2.8.0" - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'mkdir -p /home/ubuntu/bin/' - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --single-branch --branch ${KONG_SOURCE} https://github.com/Kong/kong.git ${KONG_SOURCE_LOCATION}' - sh 'make PACKAGE_TYPE=deb RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=10 package-kong test cleanup' - sh 'make PACKAGE_TYPE=apk RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3 package-kong test cleanup' - sh 'make PACKAGE_TYPE=rpm RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=8.6 package-kong test cleanup' - - } - } - stage('Kong OSS RPM'){ - agent { - node { - label 'bionic' - } - } - environment { - PATH = "/home/ubuntu/bin/:${env.PATH}" - PACKAGE_TYPE = "rpm" - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - PRIVATE_KEY_FILE = credentials('kong.private.gpg-key.asc') - PRIVATE_KEY_PASSPHRASE = credentials('kong.private.gpg-key.asc.password') - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --single-branch --branch ${KONG_SOURCE} https://github.com/Kong/kong.git ${KONG_SOURCE_LOCATION}' - sh 'cp $PRIVATE_KEY_FILE kong.private.gpg-key.asc' - sh 'make RESTY_IMAGE_BASE=amazonlinux RESTY_IMAGE_TAG=2 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=amazonlinux RESTY_IMAGE_TAG=2022 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=centos RESTY_IMAGE_TAG=7 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=7.9 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=8.6 package-kong test cleanup' - } - } - stage('Kong OSS src & Alpine'){ - agent { - node { - label 'bionic' - } - } - environment { - AWS_ACCESS_KEY = "instance-profile" - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --single-branch --branch ${KONG_SOURCE} https://github.com/Kong/kong.git ${KONG_SOURCE_LOCATION}' - sh 'make RESTY_IMAGE_BASE=src RESTY_IMAGE_TAG=src PACKAGE_TYPE=src package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3 PACKAGE_TYPE=apk DOCKER_MACHINE_ARM64_NAME="jenkins-kong-"`cat /proc/sys/kernel/random/uuid` package-kong test cleanup' - } - } - stage('Kong OSS DEB') { - agent { - node { - label 'bionic' - } - } - environment { - PACKAGE_TYPE = "deb" - GITHUB_SSH_KEY = credentials('github_bot_ssh_key') - PATH = "/home/ubuntu/bin/:${env.PATH}" - } - options { - retry(2) - timeout(time: 2, unit: 'HOURS') - } - steps { - sh 'mkdir -p /home/ubuntu/bin/' - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true' - sh 'while /bin/bash -c "ps aux | grep [a]pt-get"; do sleep 5; done' - sh 'curl https://raw.githubusercontent.com/Kong/kong/master/scripts/setup-ci.sh | bash' - sh 'git clone --single-branch --branch ${KONG_SOURCE} https://github.com/Kong/kong.git ${KONG_SOURCE_LOCATION}' - sh 'make RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=10 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=11 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=18.04 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=20.04 package-kong test cleanup' - sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=22.04 package-kong test cleanup' - } - } - } - } - } -} diff --git a/kong-build-tools/LICENSE b/kong-build-tools/LICENSE deleted file mode 100644 index 2de93c92..00000000 --- a/kong-build-tools/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2019 Kong Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/kong-build-tools/README.md b/kong-build-tools/README.md deleted file mode 100644 index c0dc2b36..00000000 --- a/kong-build-tools/README.md +++ /dev/null @@ -1,145 +0,0 @@ -> :warning: This repository is no longer in use as of Kong Gateway 3.1 - Kong is now built by Bazel, see the [build/README.md](https://github.com/Kong/kong/blob/master/build/README.md) file. - -# Kong Build Tools - -The tools necessary to build, package and release Kong - -## Prerequisites - -- Kong source -- Docker -- docker-compose -- Make - -All examples assume that Kong is a sibling directory of kong-build-tools and run from the kong-build-tools directory -unless otherwise specified. This behaviour can be adjusted by setting a `KONG_SOURCE_LOCATION` environment variable - -``` -cd ~ -git clone git@github.com:Kong/kong.git -git clone git@github.com:Kong/kong-build-tools.git -cd kong-build-tools -``` - -``` -# example of KONG_SOURCE_LOCATION usage for kong-ee -export KONG_SOURCE_LOCATION=/Users/kong/Documents/Kong-Repos/kong-ee -``` -Packaging kong-ee additionally requires: - -- A `GITHUB_TOKEN` environment variable with access to Kong's private github repositories -- `git checkout` to target kong-ee branch before starting. - -Packaging arm64 architectures additionally requires: - -- [Docker-machine](https://github.com/docker/machine) -- [Buildx Docker plugin](https://github.com/docker/buildx) -- AWS Credentials (or access via an instance profile) - -## Building a Kong Package - -``` -export PACKAGE_TYPE=deb RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=20.04 # defaults if not set -make package-kong -ls output/ -kong-x.y.z.20.04.all.deb -``` - -### Details - -![building kong](/docs/Package%20Kong.png?raw=true) - -The Docker files in the dockerfiles directory build on each other in the following manner: - -- `Dockerfile.package` builds on top of the result of `Dockerfile.kong` to package Kong using `fpm-entrypoint.sh` -- `Dockerfile.kong` builds on top of the result of `Dockerfile.openresty` to build Kong using `build-kong.sh` -- `Dockerfile.openresty` builds on top of the result of `Dockerfile.(deb|apk|rpm)` to build the Kong prerequisites using `openresty-build-tools/kong-ngx-build` -- [github://kong/kong-build-tools-base-images](https://github.com/Kong/kong-build-tools-base-images) builds the compilation / building prerequisites - -## Building a Kong Docker Image - -Prerequisite: you did the packaging step -``` -export KONG_TEST_CONTAINER_NAME=kong/kong:x.y.z-ubuntu-20.04 #default if not set -make build-test-container -``` - -## Releasing Docker Images - -Prerequisite: you did the packaging step and you're logged into docker with the necessary push permissions -``` -export DOCKER_RELEASE_REPOSITORY=kong/kong KONG_TEST_CONTAINER_TAG=x.y.z-ubuntu-20.04 #default if not set -make release-kong-docker-images -``` - -## Running Kong Tests - -``` -make test-kong -``` - -**Environment variables:** - -Refer to [git://kong/.ci/run_tests.sh](https://github.com/Kong/kong/blob/master/.ci/run_tests.sh) for the authoritative environment variables. -The most common ones are the following: - -``` -TEST_DATABASE = "off|postgres|cassandra" -TEST_SUITE = "dbless|plugins|unit|integration" -``` - -### Details - -![testing kong](/docs/Test%20Kong.png?raw=true) - -- `docker-compose.yml` runs the result of `Dockerfile.test` as well as postgres, cassandra, grpc and redis -- `Dockerfile.test` builds on top of the result of `Dockerfile.openresty` to build Kong for development/testing -- `Dockerfile.openresty` builds on top of the result of `Dockerfile.(deb|apk|rpm)` to build the Kong prerequisites using `openresty-build-tools/kong-ngx-build` -- `Dockerfile.(deb|apk|rpm)` builds the compilation / building prerequisites - -## Running Packaging / Smoke Tests - -The Kong Build Tools functional tests suite run a tests on a Kong package which we then integrate -into our official docker build image dockerfile. - -``` -make package-kong -make test -``` - -### Details - -![releasing kong](/docs/Release%20Kong.png?raw=true) - -`test/build_container.sh` clones `git://kong/docker-kong` and provides the Dockerfile with a packaged Kong asset - -**01-package** - -Validates the version required per `git://kong/.requirements` of our prerequisites is what ended up being installed. -Also does some rudimentary checks of the systemd and logrotate we include with our packages - -**02-api** - -Functional Admin API and Proxy tests. - -## Releasing Kong - -The same defaults that applied when creating a packaged version of Kong apply to releasing said package -to our internal server and can be changed by environment variables. Presumes that the package you want to release -already exists in the output directory. - -``` -export PULP_USR=user -export PULP_PSW=password -export RESTY_IMAGE_BASE=seeabove -export RESTY_IMAGE_TAG=seeabove -export KONG_PACKAGE_NAME=somename -make package-kong -make release-kong -``` - -Required release ENV variables: -``` -PULP_USR -PULP_PSW -``` diff --git a/kong-build-tools/release-kong.sh b/kong-build-tools/release-kong.sh deleted file mode 100755 index be0ea716..00000000 --- a/kong-build-tools/release-kong.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -CWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -BUILD_DIR="$CWD/output" - -PULP_HOST= -PULP_USERNAME= -PULP_PASSWORD= - -# release finals into prod, others into dev -if [[ "$OFFICIAL_RELEASE" == "true" ]]; then - PULP_HOST="$PULP_HOST_PROD" - PULP_USERNAME="$PULP_PROD_USR" - PULP_PASSWORD="$PULP_PROD_PSW" -else - PULP_HOST="$PULP_HOST_DEV" - PULP_USERNAME="$PULP_DEV_USR" - PULP_PASSWORD="$PULP_DEV_PSW" -fi - -#if [[ "$PACKAGE_TYPE" == "rpm" ]]; then -# rpm -qi /src/kong.rpm | grep 2cac36c51d5f3726 -#fi - -PULP_DOCKER_IMAGE="kong/release-script" - - -KONG_PACKAGE_NAME=$KONG_PACKAGE_NAME -KONG_VERSION=$KONG_VERSION -KONG_RELEASE_LABEL=$KONG_RELEASE_LABEL - - -DOCKER_REPOSITORY="kong/kong" -DOCKER_REPOSITORY="${DOCKER_RELEASE_REPOSITORY:-kong/kong}" - - -case "$RESTY_IMAGE_BASE" in - debian|ubuntu) - OUTPUT_FILE_SUFFIX=".$RESTY_IMAGE_TAG.$ARCHITECTURE.deb" - ;; - centos) - OUTPUT_FILE_SUFFIX=".el$RESTY_IMAGE_TAG.$ARCHITECTURE.rpm" - ;; - rhel) - OUTPUT_FILE_SUFFIX=".rhel$RESTY_IMAGE_TAG.$ARCHITECTURE.rpm" - ;; - alpine) - OUTPUT_FILE_SUFFIX=".$ARCHITECTURE.apk.tar.gz" - ;; - amazonlinux) - OUTPUT_FILE_SUFFIX=".aws.$ARCHITECTURE.rpm" - ;; - src) - OUTPUT_FILE_SUFFIX=".tar.gz" - ;; -esac - - -DIST_FILE="$KONG_PACKAGE_NAME-$KONG_RELEASE_LABEL$OUTPUT_FILE_SUFFIX" - -function push_package() { - - local dist_version="--dist-version $RESTY_IMAGE_TAG" - - if [[ "$RESTY_IMAGE_BASE" == *"rhel"* ]]; then - major="${RESTY_IMAGE_TAG%%.*}" - dist_version="--dist-version ${major}" - fi - - # src has no dist-version - if [ "$RESTY_IMAGE_BASE" == "src" ]; then - dist_version= - curl -L "https://github.com/Kong/kong/archive/$KONG_RELEASE_LABEL.tar.gz" \ - -o "output/$KONG_PACKAGE_NAME-$KONG_RELEASE_LABEL$OUTPUT_FILE_SUFFIX" - fi - if [ "$RESTY_IMAGE_TAG" == "18.04" ]; then - dist_version="--dist-version bionic" - fi - if [ "$RESTY_IMAGE_TAG" == "20.04" ]; then - dist_version="--dist-version focal" - fi - if [ "$RESTY_IMAGE_TAG" == "22.04" ]; then - dist_version="--dist-version jammy" - fi - if [ "$RESTY_IMAGE_BASE" == "alpine" ]; then - dist_version= - fi - - set -x - - local release_args="--package-type gateway" - if [[ "$EDITION" == "enterprise" ]]; then - release_args="$release_args --enterprise" - # enterprise pre-releases go to `/internal/` - if [[ "$OFFICIAL_RELEASE" == "true" ]]; then - release_args="$release_args --publish" - else - release_args="$release_args --internal" - fi - else - release_args="$release_args --publish" - fi - - eval $(docker-machine env -u) # release-scripts do not need to run within the arm64 box - - docker run \ - -e PULP_HOST="$PULP_HOST" \ - -e PULP_USERNAME="$PULP_USERNAME" \ - -e PULP_PASSWORD="$PULP_PASSWORD" \ - -v "$BUILD_DIR:/files:ro" \ - -i $PULP_DOCKER_IMAGE \ - --file "/files/$DIST_FILE" \ - --dist-name "$RESTY_IMAGE_BASE" $dist_version \ - --major-version "${KONG_RELEASE_LABEL%%.*}.x" \ - $release_args - set +x -} - - -if [[ "$RELEASE_DOCKER_ONLY" == "true" ]]; then - exit 0 -fi - - -push_package - - -echo -e "\nReleasing Kong '$KONG_RELEASE_LABEL' of '$RESTY_IMAGE_BASE $RESTY_IMAGE_TAG' done" - - -exit 0 diff --git a/kong-build-tools/sign-rpm.exp b/kong-build-tools/sign-rpm.exp deleted file mode 100755 index fb5a2012..00000000 --- a/kong-build-tools/sign-rpm.exp +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/expect -f - -### rpm-sign.exp -- Sign RPMs by sending the passphrase. - -spawn rpm --addsign {*}$argv -expect -exact "Enter pass phrase: " -send -- "$env(PRIVATE_KEY_PASSPHRASE)\r" -expect eof - -## end of rpm-sign.exp \ No newline at end of file