-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Chris Kim <[email protected]>
- Loading branch information
Showing
15 changed files
with
641 additions
and
5 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
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,11 @@ | ||
FROM centos:8 | ||
|
||
RUN yum install -y epel-release && yum -y install yum-utils rpm-build spectool git jq | ||
|
||
ENV DAPPER_SOURCE /source | ||
ENV DAPPER_OUTPUT ./dist | ||
ENV DAPPER_ENV COMBARCH DRONE_TAG TAG | ||
ENV HOME ${DAPPER_SOURCE} | ||
WORKDIR ${DAPPER_SOURCE} | ||
|
||
ENTRYPOINT ["./rpm/centos8/scripts/entry"] |
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
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 @@ | ||
../centos7/agent |
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 @@ | ||
../centos7/common |
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,13 @@ | ||
#!/bin/sh | ||
set -ex | ||
|
||
cd "$(dirname $0)" | ||
|
||
if [[ -z "$COMBARCH" ]]; then | ||
echo "Combined architecture was not defined, failing build" | ||
exit 1 | ||
fi | ||
|
||
./build-common | ||
./build-server | ||
./build-agent |
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,37 @@ | ||
#!/bin/bash | ||
set -e -x | ||
|
||
cd $(dirname $0)/.. | ||
. ./scripts/version | ||
|
||
if [[ -z "$COMBARCH" ]]; then | ||
echo "Combined architecture was not defined, failing build" | ||
exit 1 | ||
fi | ||
|
||
IFS=- read RPMARCH GOARCH<<< ${COMBARCH}; unset IFS | ||
|
||
mkdir -p "/root/rpmbuild/SPECS" | ||
|
||
SRC_PATH="/root/rpmbuild/SOURCES/${RPMARCH}" | ||
mkdir -p ${SRC_PATH} | ||
|
||
HOME=/root | ||
|
||
cp -r /source/rpm/centos8/agent/* ${SRC_PATH} | ||
cp -r /source/rpm/centos8/agent/rke2-agent.spec /root/rpmbuild/SPECS | ||
|
||
cd ${SRC_PATH} | ||
|
||
rpmbuild \ | ||
--define "rpm_version ${RPM_VERSION}" \ | ||
--define "rke2_version ${RKE2_VERSION}" \ | ||
--define "rpm_release ${RPM_RELEASE}" \ | ||
--define "_sourcedir ${SRC_PATH}" \ | ||
--target ${RPMARCH} \ | ||
-ba ${SRC_PATH}/rke2-agent.spec | ||
|
||
mkdir -p /source/dist/centos8 | ||
mkdir -p /source/dist/centos8/source | ||
cp -r /root/rpmbuild/RPMS/* /source/dist/centos8 | ||
cp -r /root/rpmbuild/SRPMS/* /source/dist/centos8/source |
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,44 @@ | ||
#!/bin/bash | ||
set -e -x | ||
|
||
cd $(dirname $0)/.. | ||
. ./scripts/version | ||
|
||
if [[ -z "$COMBARCH" ]]; then | ||
echo "Combined architecture was not defined, failing build" | ||
exit 1 | ||
fi | ||
|
||
IFS=- read RPMARCH GOARCH<<< ${COMBARCH}; unset IFS | ||
|
||
mkdir -p "/root/rpmbuild/SPECS" | ||
|
||
SRC_PATH="/root/rpmbuild/SOURCES/${RPMARCH}" | ||
mkdir -p ${SRC_PATH} | ||
|
||
HOME=/root | ||
|
||
cp -r /source/rpm/centos8/common/* ${SRC_PATH} | ||
cp -r /source/rpm/centos8/common/rke2-common.spec /root/rpmbuild/SPECS | ||
|
||
sed -i "s/\%global ARCH.*/\%global ARCH ${GOARCH}/" ${SRC_PATH}/rke2-common.spec | ||
|
||
cd ${SRC_PATH} | ||
|
||
spectool -gf rke2-common.spec \ | ||
--define "rke2_version ${RKE2_VERSION}" \ | ||
--define "ARCH ${GOARCH}" | ||
|
||
rpmbuild -vv \ | ||
--define "rpm_version ${RPM_VERSION}" \ | ||
--define "rke2_version ${RKE2_VERSION}" \ | ||
--define "rpm_release ${RPM_RELEASE}" \ | ||
--define "rke2_policyver ${RKE2_POLICYVER}" \ | ||
--define "_sourcedir ${SRC_PATH}" \ | ||
--target ${RPMARCH} \ | ||
-ba ${SRC_PATH}/rke2-common.spec | ||
|
||
mkdir -p /source/dist/centos8 | ||
mkdir -p /source/dist/centos8/source | ||
cp -r /root/rpmbuild/RPMS/* /source/dist/centos8 | ||
cp -r /root/rpmbuild/SRPMS/* /source/dist/centos8/source |
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,37 @@ | ||
#!/bin/bash | ||
set -e -x | ||
|
||
cd $(dirname $0)/.. | ||
. ./scripts/version | ||
|
||
if [[ -z "$COMBARCH" ]]; then | ||
echo "Combined architecture was not defined, failing build" | ||
exit 1 | ||
fi | ||
|
||
IFS=- read RPMARCH GOARCH<<< ${COMBARCH}; unset IFS | ||
|
||
mkdir -p "/root/rpmbuild/SPECS" | ||
|
||
SRC_PATH="/root/rpmbuild/SOURCES/${RPMARCH}" | ||
mkdir -p ${SRC_PATH} | ||
|
||
HOME=/root | ||
|
||
cp -r /source/rpm/centos8/server/* ${SRC_PATH} | ||
cp -r /source/rpm/centos8/server/rke2-server.spec /root/rpmbuild/SPECS | ||
|
||
cd ${SRC_PATH} | ||
|
||
rpmbuild \ | ||
--define "rpm_version ${RPM_VERSION}" \ | ||
--define "rke2_version ${RKE2_VERSION}" \ | ||
--define "rpm_release ${RPM_RELEASE}" \ | ||
--define "_sourcedir ${SRC_PATH}" \ | ||
--target ${RPMARCH} \ | ||
-ba ${SRC_PATH}/rke2-server.spec | ||
|
||
mkdir -p /source/dist/centos8 | ||
mkdir -p /source/dist/centos8/source | ||
cp -r /root/rpmbuild/RPMS/* /source/dist/centos8 | ||
cp -r /root/rpmbuild/SRPMS/* /source/dist/centos8/source |
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,12 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
if [ -e ./rpm/centos8/scripts/"$1" ]; then | ||
./rpm/centos8/scripts/"$@" | ||
else | ||
exec "$@" | ||
fi | ||
|
||
if [ "$DAPPER_UID" -ne "-1" ]; then | ||
chown -R $DAPPER_UID:$DAPPER_GID . | ||
fi |
Oops, something went wrong.