updated build
parent
3c68e3b642
commit
7599887d44
|
@ -66,21 +66,23 @@ pipeline:
|
|||
secrets:
|
||||
- goproxy_override
|
||||
|
||||
prep-multiarch-binaries:
|
||||
image: *golang_image # image reuse to reduce pull times, go not required
|
||||
pull: true
|
||||
environment:
|
||||
fallbackversion: 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
|
||||
# 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
|
||||
|
||||
build-docker:
|
||||
image: *buildx_plugin_image
|
||||
pull: true
|
||||
environment:
|
||||
defaulttagname: main
|
||||
settings:
|
||||
dockerfile: Dockerfile.ci
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
@ -88,6 +90,9 @@ pipeline:
|
|||
from_secret: domain
|
||||
tag: ${CI_COMMIT_TAG##v}
|
||||
repo: ${CI_REPO_LINK##https://}
|
||||
build_args_from_env:
|
||||
- CI_COMMIT_TAG
|
||||
- DEFAULTTAGNAME
|
||||
password:
|
||||
from_secret: releaseteamtoken
|
||||
username:
|
||||
|
@ -116,7 +121,9 @@ pipeline:
|
|||
- REMOTE=$(echo $CI_REPO_LINK | sed -e 's|.*://||' -e 's|/.*||')
|
||||
- GITEA_SERVER_URL=$CI_REPO_LINK GITEA_SERVER_TOKEN=$RELEASETEAMTOKEN tea login add --name $RELEASETEAMUSER --url $REMOTE
|
||||
- ASSETS=$(ls dist/release/* | sed -e 's/^/-a /')
|
||||
- tea release create $ASSETS --tag $CI_COMMIT_TAG --title $CI_COMMIT_TAG
|
||||
- echo "$${CI_COMMIT_TAG##v}" | grep -qi '-rc' && export RELEASETYPE="--prerelease"
|
||||
- echo "$${CI_COMMIT_TAG##v}" | grep -qi '-dev' && export RELEASETYPE="--draft"
|
||||
- tea release create $ASSETS --tag $CI_COMMIT_TAG --title $CI_COMMIT_TAG $${RELEASETYPE}
|
||||
when:
|
||||
event: tag
|
||||
secrets:
|
||||
|
|
|
@ -12,14 +12,24 @@ RUN addgroup \
|
|||
git && \
|
||||
echo "git:*" | chpasswd -e
|
||||
|
||||
RUN apk --no-cache add xz upx bash
|
||||
|
||||
ENV USER git
|
||||
|
||||
COPY docker/root /root-prep
|
||||
COPY docker/bin /bin-prep
|
||||
ARG DEFAULTTAGNAME
|
||||
ARG CI_COMMIT_TAG
|
||||
ENV DEFAULTTAGNAME=${DEFAULTTAGNAME:-main}
|
||||
|
||||
RUN chmod 755 /root-prep/usr/bin/entrypoint /root-prep/etc/s6/gitea/* /root-prep/etc/s6/openssh/* /root-prep/etc/s6/.s6-svscan/* && \
|
||||
find /bin-prep -name 'forgejo' -type f | xargs -I{} /bin/chmod 0755 {} && \
|
||||
find /bin-prep -name 'environment-to-ini' -type f | xargs -I{} /bin/chmod 0755 {}
|
||||
COPY docker /docker
|
||||
COPY dist /dist
|
||||
|
||||
RUN mkdir /docker/bin && \
|
||||
/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 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 {} && \
|
||||
find /docker/bin -name 'environment-to-ini' -type f | xargs -I{} /bin/chmod 0755 {}
|
||||
|
||||
FROM alpine:3.17.0
|
||||
LABEL maintainer="contact@forgejo.org"
|
||||
|
@ -64,6 +74,6 @@ VOLUME ["/data"]
|
|||
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||
CMD ["/bin/s6-svscan", "/etc/s6"]
|
||||
|
||||
COPY --from=prep /root-prep /
|
||||
COPY --from=prep /bin-prep/$TARGETPLATFORM/forgejo /app/gitea/gitea
|
||||
COPY --from=prep /bin-prep/$TARGETPLATFORM/environment-to-ini /usr/local/bin/environment-to-ini
|
||||
COPY --from=prep /docker/root /
|
||||
COPY --from=prep /docker/bin/$TARGETPLATFORM/forgejo /app/gitea/gitea
|
||||
COPY --from=prep /docker/bin/$TARGETPLATFORM/environment-to-ini /usr/local/bin/environment-to-ini
|
||||
|
|
|
@ -7,11 +7,12 @@ fi
|
|||
|
||||
BINARYLOOKUPPATH="${1}"
|
||||
FILEBASENAME="${2}"
|
||||
COMPRESS="${3}"
|
||||
|
||||
if [[ ${#@} -gt 2 ]] && ! [[ "${3}" == "" ]]; then
|
||||
FILEVERSION="${3}"
|
||||
if [[ ${#@} -gt 3 ]] && ! [[ "${4}" == "" ]]; then
|
||||
FILEVERSION="${4}"
|
||||
else
|
||||
FILEVERSION="$FALLBACKVERSION"
|
||||
FILEVERSION="$DEFAULTTAGNAME"
|
||||
fi
|
||||
|
||||
FILE_WIHTOUT_PLATFORM="${FILEBASENAME}-${FILEVERSION}"
|
||||
|
@ -36,6 +37,10 @@ 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