Skip to content

Commit

Permalink
chore(ci): arm builds refs: #ENGEN-715 (#9168)
Browse files Browse the repository at this point in the history
* chore(ci): further align our CI across enterprice and community edition

* chore(ci): re-enable arm builds on our release branch commits

* chore(test): test arm builds using my branch

* chore(revert): revert me

* chore(rhel): we only want redhat containers going to redhat repository

* chore(ci): done testing set the branch back to master

* chore(ci): one last test using my branch

* Update Jenkinsfile

* Update .requirements

* fix(ci): add a git commit sha tag
  • Loading branch information
hutchic authored Aug 10, 2022
1 parent 898265a commit 60ae7b6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .requirements
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ RESTY_LMDB_VERSION=master
RESTY_EVENTS_VERSION=0.1.2
ATC_ROUTER_VERSION=main
LIBYAML_VERSION=0.2.5
KONG_BUILD_TOOLS_VERSION=4.33.7
KONG_BUILD_TOOLS_VERSION=4.33.8
KONG_NGINX_MODULE_BRANCH=0.2.1
64 changes: 31 additions & 33 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,74 +35,72 @@ pipeline {
sh 'make setup-kong-build-tools'
sh 'cd ../kong-build-tools && make package-kong test'
}

}
stage('Release -- Branch Release to Unofficial Asset Stores') {
stage('Release -- Release Branch Release to Unofficial Asset Stores') {
when {
beforeAgent true
anyOf {
allOf {
branch 'master';
not { triggeredBy 'TimerTrigger' }
}
}
environment {
KONG_TEST_IMAGE_NAME = "kong/kong:branch"
DOCKER_RELEASE_REPOSITORY = "kong/kong"
}
parallel {
stage('Alpine') {
stage('RPM') {
agent {
node {
label 'bionic'
}
}
environment {
RESTY_IMAGE_BASE = "alpine"
RESTY_IMAGE_TAG = "latest"
PACKAGE_TYPE = "apk"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
PACKAGE_TYPE = "rpm"
PRIVATE_KEY_FILE = credentials('kong.private.gpg-key.asc')
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh './scripts/setup-ci.sh'
sh 'make setup-kong-build-tools'

sh 'cd $KONG_BUILD_TOOLS_LOCATION && make package-kong'
sh 'cd $KONG_BUILD_TOOLS_LOCATION && make test'
sh 'docker tag $KONG_TEST_IMAGE_NAME $DOCKER_RELEASE_REPOSITORY:${GIT_BRANCH##*/}'
sh 'docker push $DOCKER_RELEASE_REPOSITORY:${GIT_BRANCH##*/}'

sh 'docker tag $KONG_TEST_IMAGE_NAME $DOCKER_RELEASE_REPOSITORY:${GIT_BRANCH##*/}-nightly-alpine'
sh 'docker push $DOCKER_RELEASE_REPOSITORY:${GIT_BRANCH##*/}-nightly-alpine'
sh 'cp $PRIVATE_KEY_FILE ../kong-build-tools/kong.private.gpg-key.asc'
sh 'make RESTY_IMAGE_BASE=amazonlinux KONG_TEST_CONTAINER_TAG="${GIT_BRANCH##*/}-amazonlinux" RESTY_IMAGE_TAG=2 release-docker-images'
}
}
stage('Ubuntu') {
stage('DEB') {
agent {
node {
label 'bionic'
}
}
environment {
RESTY_IMAGE_BASE = "ubuntu"
RESTY_IMAGE_TAG = "20.04"
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
PACKAGE_TYPE = "deb"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'make RESTY_IMAGE_BASE=debian KONG_TEST_CONTAINER_TAG="${GIT_BRANCH##*/}-debian" ADDITIONAL_TAG_LIST="${GIT_BRANCH##*/} ${GIT_COMMIT}" RESTY_IMAGE_TAG=11 release-docker-images'
sh 'make RESTY_IMAGE_BASE=ubuntu KONG_TEST_CONTAINER_TAG="${GIT_BRANCH##*/}-ubuntu" RESTY_IMAGE_TAG=20.04 release-docker-images'
}
}
stage('Alpine') {
agent {
node {
label 'bionic'
}
}
environment {
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
AWS_ACCESS_KEY = "instanceprofile"
PACKAGE_TYPE = "apk"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh './scripts/setup-ci.sh'
sh 'make setup-kong-build-tools'

sh 'cd $KONG_BUILD_TOOLS_LOCATION && make package-kong'
sh 'cd $KONG_BUILD_TOOLS_LOCATION && make test'
sh 'docker tag $KONG_TEST_IMAGE_NAME $DOCKER_RELEASE_REPOSITORY:${GIT_BRANCH##*/}-$RESTY_IMAGE_BASE'
sh 'docker push $DOCKER_RELEASE_REPOSITORY:${GIT_BRANCH##*/}-$RESTY_IMAGE_BASE'

sh 'docker tag $KONG_TEST_IMAGE_NAME $DOCKER_RELEASE_REPOSITORY:${GIT_BRANCH##*/}-nightly-$RESTY_IMAGE_BASE'
sh 'docker push $DOCKER_RELEASE_REPOSITORY:${GIT_BRANCH##*/}-nightly-$RESTY_IMAGE_BASE'
sh 'make RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3 KONG_TEST_CONTAINER_TAG="${GIT_BRANCH##*/}-alpine" ADDITIONAL_TAG_LIST="${GIT_BRANCH##*/}-nightly-alpine" DOCKER_MACHINE_ARM64_NAME="kong-"`cat /proc/sys/kernel/random/uuid` release-docker-images'
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ endif
setup-ci setup-kong-build-tools \
lint test test-integration test-plugins test-all \
pdk-phase-check functional-tests \
fix-windows \
nightly-release release
fix-windows release

ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
KONG_SOURCE_LOCATION ?= $(ROOT_DIR)
Expand Down Expand Up @@ -68,6 +67,15 @@ else
ISTAG = false
endif

release-docker-images:
cd $(KONG_BUILD_TOOLS_LOCATION); \
$(MAKE) \
KONG_SOURCE_LOCATION=${KONG_SOURCE_LOCATION} \
package-kong && \
$(MAKE) \
KONG_SOURCE_LOCATION=${KONG_SOURCE_LOCATION} \
release-kong-docker-images

release:
ifeq ($(ISTAG),false)
sed -i -e '/return string\.format/,/\"\")/c\return "$(KONG_VERSION)\"' kong/meta.lua
Expand Down

0 comments on commit 60ae7b6

Please sign in to comment.