without upx
parent
a5c2f16b0f
commit
af6ce02555
|
@ -52,13 +52,8 @@ pipeline:
|
|||
- export WS_BASE="$(pwd)"
|
||||
- echo "installing nodejs"
|
||||
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
|
||||
- echo "installing xz-utils"
|
||||
- apt-get install -qqy xz-utils
|
||||
- echo "fetching upx-v$${UPXVERSION}"
|
||||
- cd /usr/local/bin
|
||||
- curl -sL https://github.com/upx/upx/releases/download/v$${UPXVERSION}/upx-$${UPXVERSION}-amd64_linux.tar.xz | tar --strip-components 1 -xJf - upx-$${UPXVERSION}-amd64_linux/upx
|
||||
- echo "checking upx"
|
||||
- test -f /usr/local/bin/upx || exit 1
|
||||
#- echo "installing xz-utils"
|
||||
#- apt-get install -qqy xz-utils
|
||||
- export PATH=$PATH:$GOPATH/bin
|
||||
- echo "building forgejo"
|
||||
- cd $WS_BASE
|
||||
|
@ -74,28 +69,6 @@ pipeline:
|
|||
secrets:
|
||||
- goproxy_override
|
||||
|
||||
# prep-multiarch-binaries:
|
||||
# image: *golang_image # image reuse to reduce pull times, go not required
|
||||
# pull: true
|
||||
# environment:
|
||||
# defaulttagname: main # the fallback version used by make
|
||||
# commands:
|
||||
# - mkdir docker/bin
|
||||
# - ./docker/map-binaries.sh ./dist/binaries forgejo ${CI_COMMIT_TAG##v}
|
||||
# - ./docker/map-binaries.sh ./dist/contrib environment-to-ini ${CI_COMMIT_TAG##v}
|
||||
# when:
|
||||
# event: tag
|
||||
|
||||
debug:
|
||||
image: *golang_image # image reuse to reduce pull times, go not required
|
||||
pull: true
|
||||
commands:
|
||||
- pwd
|
||||
- ls
|
||||
- test -d dist && ls dist
|
||||
when:
|
||||
event: tag
|
||||
|
||||
build-docker:
|
||||
image: *buildx_plugin_image
|
||||
pull: true
|
||||
|
|
|
@ -14,11 +14,9 @@ RUN addgroup \
|
|||
|
||||
ARG CACHEBUST=1
|
||||
|
||||
RUN apk --no-cache add xz upx bash && \
|
||||
RUN apk --no-cache add bash && \
|
||||
mkdir -p /docker/bin && \
|
||||
mkdir /dist && \
|
||||
date > /date.dummy && \
|
||||
ls /
|
||||
mkdir /dist
|
||||
|
||||
ENV USER git
|
||||
|
||||
|
@ -30,8 +28,8 @@ COPY docker /docker/
|
|||
COPY dist /dist/
|
||||
|
||||
ARG CACHEBUST=1
|
||||
RUN /docker/map-binaries.sh /dist/binaries "true" forgejo ${CI_COMMIT_TAG##v} && \
|
||||
/docker/map-binaries.sh /dist/contrib "false" environment-to-ini ${CI_COMMIT_TAG##v}
|
||||
RUN /docker/map-binaries.sh /dist/binaries forgejo ${CI_COMMIT_TAG##v} && \
|
||||
/docker/map-binaries.sh /dist/contrib environment-to-ini ${CI_COMMIT_TAG##v}
|
||||
|
||||
RUN chmod 755 /docker/root/usr/bin/entrypoint /docker/root/etc/s6/gitea/* /docker/root/etc/s6/openssh/* /docker/root/etc/s6/.s6-svscan/* && \
|
||||
find /docker/bin -name 'forgejo' -type f | xargs -I{} /bin/chmod 0755 {} && \
|
||||
|
|
|
@ -106,7 +106,7 @@ generate-go: $(TAGS_PREREQ)
|
|||
@CC= GOOS= GOARCH= $(GO) generate -tags '$(TAGS)' $(GO_PACKAGES)
|
||||
|
||||
.PHONY: release
|
||||
release: generate release-linux release-compress release-copy
|
||||
release: generate release-linux release-copy
|
||||
|
||||
$(DIST_DIRS):
|
||||
mkdir -p $(DIST_DIRS)
|
||||
|
@ -132,12 +132,6 @@ ifeq ($(CI),true)
|
|||
cp /build/$(EXECUTABLEPREFIX)-* $(DIST)/contrib
|
||||
endif
|
||||
|
||||
.PHONY: release-compress
|
||||
release-compress: | $(DIST_DIRS)
|
||||
ifeq ($(CI),true)
|
||||
cd $(DIST); for file in `find ./contrib -type f -name "$(EXECUTABLEPREFIX)-*"`; do upx --best --lzma $${file}; done;
|
||||
endif
|
||||
|
||||
.PHONY: release-copy
|
||||
release-copy: | $(DIST_DIRS)
|
||||
cd $(DIST); for file in `find ./contrib -type f -name "$(EXECUTABLEPREFIX)-*"`; do cp $${file} ./contrib-release/; done;
|
||||
|
|
|
@ -7,10 +7,9 @@ fi
|
|||
|
||||
BINARYLOOKUPPATH="${1}"
|
||||
FILEBASENAME="${2}"
|
||||
COMPRESS="${3}"
|
||||
|
||||
if [[ ${#@} -gt 3 ]] && ! [[ "${4}" == "" ]]; then
|
||||
FILEVERSION="${4}"
|
||||
if [[ ${#@} -gt 2 ]] && ! [[ "${3}" == "" ]]; then
|
||||
FILEVERSION="${3}"
|
||||
else
|
||||
FILEVERSION="$DEFAULTTAGNAME"
|
||||
fi
|
||||
|
@ -37,10 +36,6 @@ function map(){
|
|||
mkdir -p "${DOCKERDIR}/bin/$platform"
|
||||
echo "Mapped ${file} to $platform, copying"
|
||||
cp "${file}" "${DOCKERDIR}/bin/$platform/${FILEBASENAME}"
|
||||
if [[ "$COMPRESS" == "true" ]]; then
|
||||
echo "Compressing active, compressing ${DOCKERDIR}/bin/$platform/${FILEBASENAME}"
|
||||
upx --best --lzma -q "${DOCKERDIR}/bin/$platform/${FILEBASENAME}"
|
||||
fi
|
||||
}
|
||||
|
||||
cd "$WS_BASE/${BINARYLOOKUPPATH}"
|
||||
|
|
Loading…
Reference in New Issue