-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
124 additions
and
47 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 |
---|---|---|
|
@@ -18,3 +18,4 @@ mtime: | |
touchtime=$$(date -d @$$unixtime +'%Y%m%d%H%M.%S'); \ | ||
touch -t $$touchtime $$filename; \ | ||
done | ||
|
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 |
---|---|---|
@@ -1,5 +1,27 @@ | ||
# APK | ||
export PACKAGER_PRIVKEY ?= $(CURDIR)/../../key.rsa | ||
|
||
|
||
ifeq ($(CI),) | ||
export PACKAGER_PRIVKEY_DIR ?= /packages/apk | ||
export PACKAGER ?= [email protected] | ||
export PACKAGER_PRIVKEY ?= $(PACKAGER_PRIVKEY_DIR)/$(PACKAGER).rsa | ||
export PACKAGER_PUBKEY ?= $(APK_PACKAGES_PATH)/$(PACKAGER).rsa.pub | ||
export PACKAGER_PUBKEY_INSTALLED ?= /etc/apk/keys/$(PACKAGER).rsa.pub | ||
|
||
$(PACKAGER_PRIVKEY) localkey: | ||
openssl genrsa -out $(PACKAGER_PRIVKEY) 2048 | ||
|
||
$(PACKAGER_PUBKEY): $(PACKAGER_PRIVKEY) | ||
mkdir -p $(APK_PACKAGES_PATH) | ||
chmod 777 $(APK_PACKAGES_PATH) | ||
openssl rsa -in $(PACKAGER_PRIVKEY) -pubout > $(PACKAGER_PUBKEY) | ||
|
||
$(PACKAGER_PUBKEY_INSTALLED): $(PACKAGER_PUBKEY) | ||
chmod 666 $(PACKAGER_PRIVKEY) $(PACKAGER_PUBKEY) | ||
cp $(PACKAGER_PUBKEY) $(PACKAGER_PUBKEY_INSTALLED) | ||
|
||
endif | ||
|
||
export APK_TEMPLATE_PATH ?= ../../apk/templates/ | ||
export APK_BUILD_TEMPLATE ?= APKBUILD.github-binary | ||
export APK_PACKAGES_PATH ?= /tmp/packages | ||
|
@@ -26,23 +48,31 @@ apk/build: | |
cd $(APK_TMP_DIR) && \ | ||
sudo -E -H -u nobody abuild -c -r -P $(APK_PACKAGES_PATH) | ||
|
||
apk/testinstall: | ||
@echo '* Verify package can be installed:' | ||
apk add --virtual buildtest $(APK_PACKAGE) | ||
@echo '* Verify package can be uninstalled:' | ||
apk del buildtest | ||
|
||
apk/clean: | ||
@find $(APK_PACKAGES_PATH) -type f -name APKINDEX.tar.gz -delete | ||
apk del buildtest || true | ||
rm -rf $(APK_TMP_DIR) | ||
mkdir -p $(APK_TMP_DIR) | ||
|
||
apk/reset: | ||
apk del buildtest || true | ||
rm -rf $(APK_PACKAGE) | ||
|
||
.PHONY : apk | ||
apk: $(APK_PACKAGE) | ||
apk: $(PACKAGER_PRIVKEY) $(PACKAGER_PUBKEY_INSTALLED) $(APK_PACKAGE) | ||
@exit 0 | ||
|
||
# Rebuild the `.apk` when it's older than the Makefile, VERSION, or RELEASE files | ||
$(APK_PACKAGE): Makefile VERSION RELEASE | ||
@echo "Building $@" | ||
ls -l $@ Makefile VERSION RELEASE || true | ||
$(MAKE) info apk/prepare apk/checksum apk/build apk/clean | ||
$(MAKE) info apk/prepare apk/checksum apk/build apk/testinstall apk/clean | ||
|
||
package/prepare:: | ||
@exit 0 |
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
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#!/bin/sh | ||
# This is an Alpine `deinstall` hook that removes the alternative | ||
PACKAGE_NAME=kops | ||
MASTER_PACKAGE_NAME=kops | ||
MAJOR_VERSION=1.12 | ||
INSTALL_DIR=/usr/local/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${PACKAGE_NAME}-${MAJOR_VERSION} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME}-${MAJOR_VERSION} | ||
INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
exit 0 |
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#!/bin/sh | ||
# This is an Alpine Package `post-install` hook that installs an alternative into `/usr/local/${PACKAGE_NAME}/$version/bin` | ||
PACKAGE_NAME=kops | ||
# This is an Alpine Package `post-install` hook that links | ||
# an alternative from `/usr/share/${PACKAGE_NAME}/$version/bin` into `/usr/bin/` | ||
MASTER_PACKAGE_NAME=kops | ||
MAJOR_VERSION=1.12 | ||
INSTALL_DIR=/usr/local/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME}-${MAJOR_VERSION} | ||
INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
mkdir -p ${INSTALL_DIR} | ||
update-alternatives --install /usr/bin/${PACKAGE_NAME}-${MAJOR_VERSION} ${PACKAGE_NAME}-${MAJOR_VERSION} ${INSTALL_DIR}/${PACKAGE_NAME} 1 | ||
update-alternatives --install /usr/bin/${MASTER_PACKAGE_NAME} ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 12 | ||
exit 0 |
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,8 @@ | ||
#!/bin/sh | ||
# This is an Alpine `deinstall` hook that removes the alternative | ||
MASTER_PACKAGE_NAME=kops | ||
MAJOR_VERSION=latest | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME} | ||
INSTALL_DIR=/usr/share/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
exit 0 |
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,10 @@ | ||
#!/bin/sh | ||
# This is an Alpine Package `post-install` hook that links | ||
# an alternative from `/usr/share/${PACKAGE_NAME}/$version/bin` into `/usr/bin/` | ||
MASTER_PACKAGE_NAME=kops | ||
MAJOR_VERSION=latest | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME} | ||
INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
mkdir -p ${INSTALL_DIR} | ||
update-alternatives --install /usr/bin/${MASTER_PACKAGE_NAME} ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 1 | ||
exit 0 |
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/bin/sh | ||
# This is an Alpine `deinstall` hook that removes the alternative | ||
PACKAGE_NAME=kubectl | ||
MASTER_PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=1.13 | ||
INSTALL_DIR=/usr/local/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${PACKAGE_NAME}-${MAJOR_VERSION} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME}-${MAJOR_VERSION} | ||
INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
update-alternatives --remove ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
exit 0 |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
#!/bin/sh | ||
# This is an Alpine Package `post-install` hook that installs an alternative into `/usr/local/${PACKAGE_NAME}/$version/bin` | ||
PACKAGE_NAME=kubectl | ||
# This is an Alpine Package `post-install` hook that links | ||
# an alternative from `/usr/share/${PACKAGE_NAME}/$version/bin` into `/usr/bin/` | ||
MASTER_PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=1.13 | ||
INSTALL_DIR=/usr/local/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME}-${MAJOR_VERSION} | ||
INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
|
||
mkdir -p ${INSTALL_DIR} | ||
update-alternatives --install /usr/bin/${PACKAGE_NAME}-${MAJOR_VERSION} ${PACKAGE_NAME}-${MAJOR_VERSION} ${INSTALL_DIR}/${PACKAGE_NAME} 1 | ||
update-alternatives --install /usr/bin/${PACKAGE_NAME} ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 13 | ||
update-alternatives --install /usr/bin/${PACKAGE_NAME} ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 1 | ||
update-alternatives --install /usr/bin/${MASTER_PACKAGE_NAME} ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 13 | ||
exit 0 |
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/bin/sh | ||
# This is an Alpine `deinstall` hook that removes the alternative | ||
PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=1.14 | ||
INSTALL_DIR=/usr/local/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${PACKAGE_NAME}-${MAJOR_VERSION} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
MASTER_PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=1.13 | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME}-${MAJOR_VERSION} | ||
INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
update-alternatives --remove ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
exit 0 |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
#!/bin/sh | ||
# This is an Alpine Package `post-install` hook that installs an alternative into `/usr/local/${PACKAGE_NAME}/$version/bin` | ||
PACKAGE_NAME=kubectl | ||
# This is an Alpine Package `post-install` hook that links | ||
# an alternative from `/usr/share/${PACKAGE_NAME}/$version/bin` into `/usr/bin/` | ||
MASTER_PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=1.14 | ||
INSTALL_DIR=/usr/local/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME}-${MAJOR_VERSION} | ||
INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
|
||
mkdir -p ${INSTALL_DIR} | ||
update-alternatives --install /usr/bin/${PACKAGE_NAME}-${MAJOR_VERSION} ${PACKAGE_NAME}-${MAJOR_VERSION} ${INSTALL_DIR}/${PACKAGE_NAME} 1 | ||
update-alternatives --install /usr/bin/${PACKAGE_NAME} ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 14 | ||
update-alternatives --install /usr/bin/${PACKAGE_NAME} ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 1 | ||
update-alternatives --install /usr/bin/${MASTER_PACKAGE_NAME} ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 14 | ||
exit 0 |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#!/bin/sh | ||
# This is an Alpine `deinstall` hook that removes the alternative | ||
PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=default | ||
INSTALL_DIR=/usr/local/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
MASTER_PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=latest | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME} | ||
INSTALL_DIR=/usr/share/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
update-alternatives --remove ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet | ||
exit 0 |
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#!/bin/sh | ||
# This is an Alpine Package `post-install` hook that installs an alternative into `/usr/local/${PACKAGE_NAME}/$version/bin` | ||
PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=default | ||
INSTALL_DIR=/usr/local/${PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
# This is an Alpine Package `post-install` hook that links | ||
# an alternative from `/usr/share/${PACKAGE_NAME}/$version/bin` into `/usr/bin/` | ||
MASTER_PACKAGE_NAME=kubectl | ||
MAJOR_VERSION=latest | ||
PACKAGE_NAME=${MASTER_PACKAGE_NAME} | ||
INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin | ||
mkdir -p ${INSTALL_DIR} | ||
update-alternatives --install /usr/bin/${PACKAGE_NAME} ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 1 | ||
update-alternatives --install /usr/bin/${MASTER_PACKAGE_NAME} ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 1 | ||
exit 0 |