-
Notifications
You must be signed in to change notification settings - Fork 99
feat: add apisix fedora support #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,39 @@ | ||||||||||
name: package apisix rpm for Fedora 34 | ||||||||||
|
||||||||||
on: | ||||||||||
push: | ||||||||||
branches: [ master ] | ||||||||||
tags: | ||||||||||
- "v*" | ||||||||||
paths-ignore: | ||||||||||
- '*.md' | ||||||||||
pull_request: | ||||||||||
branches: [ master ] | ||||||||||
paths-ignore: | ||||||||||
- '*.md' | ||||||||||
schedule: | ||||||||||
- cron: '0 0 * * *' | ||||||||||
|
||||||||||
jobs: | ||||||||||
build: | ||||||||||
runs-on: ubuntu-latest | ||||||||||
|
||||||||||
steps: | ||||||||||
- uses: actions/checkout@v2 | ||||||||||
|
||||||||||
- name: install dependencies | ||||||||||
run: | | ||||||||||
sudo apt-get install -y make | ||||||||||
|
||||||||||
- name: run apisix packaging | ||||||||||
run: | | ||||||||||
make package type=rpm app=apisix_fedora version=master checkout=master image_base=fedora image_tag=34 artifact=apisix-remote | ||||||||||
make package type=rpm app=apisix_fedora version=2.2 checkout=2.2 image_base=fedora image_tag=34 | ||||||||||
|
||||||||||
- name: Publish Artifact | ||||||||||
uses: actions/[email protected] | ||||||||||
with: | ||||||||||
name: apisix-2.2-0.fedora34.x86_64.rpm | ||||||||||
path: output/apisix-2.2-0.fedora34.x86_64.rpm | ||||||||||
Comment on lines
+36
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
retention-days: 5 | ||||||||||
if-no-files-found: error |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,17 @@ else | |
$(call build,apisix,apisix,rpm,$(local_code_path)) | ||
endif | ||
|
||
### build apisix_fedora: | ||
.PHONY: build-apisix_fedora-rpm | ||
build-apisix_fedora-rpm: | ||
ifeq ($(local_code_path), 0) | ||
git clone -b $(checkout) $(apisix_repo) ./apisix | ||
$(call build,apisix,apisix_fedora,rpm,"./apisix") | ||
rm -fr ./apisix | ||
else | ||
$(call build,apisix,apisix_fedora,rpm,$(local_code_path)) | ||
endif | ||
|
||
Comment on lines
+101
to
+109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Kushal-kothari how about reusing |
||
.PHONY: build-apisix-deb | ||
build-apisix-deb: | ||
ifeq ($(local_code_path), 0) | ||
|
@@ -111,6 +122,10 @@ endif | |
package-apisix-rpm: | ||
$(call package,apisix,rpm) | ||
|
||
.PHONY: package-apisix_fedora-rpm | ||
package-apisix_fedora-rpm: | ||
$(call package,apisix_fedora,rpm) | ||
|
||
.PHONY: package-apisix-deb | ||
package-apisix-deb: | ||
$(call package,apisix,deb) | ||
|
@@ -179,8 +194,8 @@ build-fpm: | |
-t api7/fpm - < ./dockerfiles/Dockerfile.fpm | ||
endif | ||
|
||
ifeq ($(filter $(app),apisix dashboard apisix-base),) | ||
$(info the app's value have to be apisix or dashboard!) | ||
ifeq ($(filter $(app),apisix_fedora apisix dashboard apisix-base),) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Kushal-kothari there's no need to add this cause we still use |
||
$(info the app's value have to be apisix_fedora, apisix or dashboard!) | ||
|
||
else ifeq ($(filter $(type),rpm deb),) | ||
$(info the type's value have to be rpm or deb!) | ||
|
@@ -206,6 +221,12 @@ package: build-fpm | |
package: build-apisix-rpm | ||
package: package-apisix-rpm | ||
|
||
|
||
else ifeq ($(app)_$(type),apisix_fedora_rpm) | ||
package: build-fpm | ||
package: build-apisix_fedora-rpm | ||
package: package-apisix_fedora-rpm | ||
|
||
else ifeq ($(app)_$(type),apisix_deb) | ||
package: build-fpm | ||
package: build-apisix-deb | ||
|
@@ -221,4 +242,4 @@ package: build-fpm | |
package: build-dashboard-deb | ||
package: package-dashboard-deb | ||
|
||
endif | ||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ARG IMAGE_BASE="fedora" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, how about reusing |
||
ARG IMAGE_TAG="34" | ||
|
||
FROM ${IMAGE_BASE}:${IMAGE_TAG} | ||
|
||
COPY ./utils/install-common.sh /install-common.sh | ||
COPY ./utils/determine-dist.sh /determine-dist.sh | ||
|
||
ARG iteration="0" | ||
ARG apisix_repo="https://github.com/apache/apisix" | ||
ARG checkout_v | ||
ARG IMAGE_BASE | ||
ARG IMAGE_TAG | ||
ARG CODE_PATH | ||
|
||
# install dependencies | ||
RUN /install-common.sh install_apisix_fedora_dependencies_rpm | ||
|
||
ENV checkout_v=${checkout_v} | ||
ENV iteration=${iteration} | ||
ENV apisix_repo=${apisix_repo} | ||
ENV IMAGE_BASE=${IMAGE_BASE} | ||
ENV IMAGE_TAG=${IMAGE_TAG} | ||
|
||
COPY ${CODE_PATH} /apisix | ||
|
||
# install apisix | ||
RUN /install-common.sh install_apisix \ | ||
# determine dist and write it into /tmp/dist file | ||
&& /determine-dist.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We would better add an extra line here. Thanks. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ARG VERSION | ||
ARG PACKAGE_TYPE | ||
|
||
FROM apache/apisix-${PACKAGE_TYPE}:${VERSION} AS APISIX_FEDORA | ||
FROM api7/fpm | ||
|
||
ARG ITERATION | ||
ARG PACKAGE_VERSION | ||
ARG PACKAGE_TYPE | ||
ARG OPENRESTY | ||
ARG ARTIFACT | ||
|
||
ENV ITERATION=${ITERATION} | ||
ENV PACKAGE_VERSION=${PACKAGE_VERSION} | ||
ENV PACKAGE_TYPE=${PACKAGE_TYPE} | ||
ENV OPENRESTY=${OPENRESTY} | ||
ENV ARTIFACT=${ARTIFACT} | ||
|
||
COPY --from=APISIX_FEDORA /tmp/build/output /tmp/build/output | ||
COPY --from=APISIX_FEDORA /tmp/dist /tmp/dist | ||
COPY package-apisix.sh /package-apisix.sh | ||
COPY usr /usr | ||
|
||
RUN /package-apisix.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An extra new line is needed here. Thanks. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,11 @@ dist="el7" | |
if [ "${IMAGE_BASE}" == "centos" ] | ||
then | ||
dist="el${IMAGE_TAG}" | ||
elif [ "${IMAGE_BASE}" == "fedora" ] | ||
then | ||
dist="${IMAGE_BASE}${IMAGE_TAG}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the rpm in Fedora 34, the conventional |
||
elif [ "${IMAGE_BASE}" == "ubuntu" ] | ||
then | ||
dist="${IMAGE_BASE}${IMAGE_TAG}" | ||
fi | ||
|
||
echo "${dist}" > /tmp/dist | ||
echo "${dist}" > /tmp/dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,29 @@ install_apisix_dependencies_rpm() { | |
install_luarocks | ||
} | ||
|
||
install_apisix_fedora_dependencies_rpm() { | ||
install_fedora_dependencies_rpm | ||
install_fedora_openresty_rpm | ||
install_luarocks | ||
} | ||
|
||
install_dependencies_rpm() { | ||
# install basic dependencies | ||
yum -y install wget tar gcc automake autoconf libtool make curl git which unzip | ||
yum -y install epel-release | ||
yum install -y yum-utils readline-dev readline-devel | ||
# install lua 5.1 for compatible with openresty 1.17.8.2 | ||
install_lua | ||
} | ||
|
||
install_fedora_dependencies_rpm() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here, we can check if the environment key |
||
# install basic dependencies | ||
yum -y install tar ccache make gcc libtool git unzip which autoconf automake readline-devel wget | ||
# install lua 5.1 for compatible with openresty 1.17.8.2 | ||
install_lua | ||
} | ||
|
||
|
||
install_dependencies_deb() { | ||
# install basic dependencies | ||
DEBIAN_FRONTEND=noninteractive apt-get update | ||
|
@@ -58,6 +71,12 @@ install_openresty_rpm() { | |
yum install -y openresty openresty-openssl111-devel pcre pcre-devel | ||
} | ||
|
||
install_fedora_openresty_rpm() { | ||
sudo dnf install -y dnf-plugins-core | ||
sudo dnf config-manager --add-repo https://openresty.org/package/fedora/openresty.repo | ||
yum install -y openresty openresty-openssl111-devel pcre pcre-devel | ||
} | ||
|
||
install_luarocks() { | ||
# install luarocks | ||
wget https://github.com/luarocks/luarocks/archive/v3.4.0.tar.gz | ||
|
@@ -163,6 +182,9 @@ case ${case_opt} in | |
install_apisix_dependencies_rpm) | ||
install_apisix_dependencies_rpm | ||
;; | ||
install_apisix_fedora_dependencies_rpm) | ||
install_apisix_fedora_dependencies_rpm | ||
;; | ||
install_apisix_dependencies_deb) | ||
install_apisix_dependencies_deb | ||
;; | ||
|
@@ -187,4 +209,4 @@ install_dashboard_dependencies_deb) | |
install_dashboard) | ||
install_dashboard | ||
;; | ||
esac | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kushal-kothari we would better to keep using
apisix
here.