Commit c884b8e7 authored by Manuel Moos's avatar Manuel Moos
Browse files

Merge from legacy_0.2.9

parents e4a328a0 8efc0f2b
Pipeline #245901334 passed with stages
in 47 minutes and 35 seconds
......@@ -4,6 +4,7 @@ variables:
# https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
#DOCKER_TLS_CERTDIR: "/certs"
#DOCKER_HOST: ""
HAS_ARMADEPLOY: "false"
services:
# required for shared runners, does not hurt for our runner (just some diagnostic complaints)
......@@ -249,6 +250,8 @@ deploy_staged:
tags:
- armagetronad_deploy
rules:
- if: $HAS_ARMADEPLOY != "true"
when: never
- if: $CI_MERGE_REQUEST_ID
when: never
- if: $CI_COMMIT_REF_PROTECTED == "true"
......@@ -271,7 +274,7 @@ delay_release:
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: '$CI_COMMIT_REF_PROTECTED == "false"'
- if: $CI_COMMIT_REF_PROTECTED == "false"
when: never
- if: '$CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_TAG'
when: manual
......@@ -291,15 +294,18 @@ deploy_release:
tags:
- armagetronad_deploy
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
when: on_success
- when: never
- if: $HAS_ARMADEPLOY != "true"
when: never
- if: $CI_MERGE_REQUEST_ID
when: never
- if: $CI_COMMIT_REF_PROTECTED == "true"
when: on_success
- when: never
before_script:
- ./docker/scripts/fix_gits.sh || exit $?
- ./docker/deploy/prepare_deploy.sh || exit $?
script:
# test whether we're current
- docker/scripts/obsolete.sh || exit 0
# build
......@@ -332,7 +338,7 @@ stage_docker:
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
- if: $CI_COMMIT_REF_PROTECTED == "true"
when: on_success
- when: never
after_script:
......@@ -352,7 +358,7 @@ deploy_docker:
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
- if: $CI_COMMIT_REF_PROTECTED == "true"
when: on_success
- when: never
after_script:
......@@ -365,6 +371,25 @@ deploy_docker:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY 2>&1 | grep -v WARNING\|credential || exit $?
- make -C gitlab_build/docker/build unstaged_deploy_docker.tag || exit $?
# deploy build to Gitlab
deploy_gitlab:
stage: deploy
dependencies:
- build_prepare
- build_collect
rules:
- if: $CI_MERGE_REQUEST_ID
when: never
- if: $CI_COMMIT_REF_PROTECTED == "true"
when: on_success
- when: never
script:
# test whether we're current
- docker/scripts/obsolete.sh || exit 0
# deploy
- make -C gitlab_build/docker/build unstaged_deploy_gitlab || exit $?
# post-build tests
post_test:
stage: build_collect
......
ARG BASE_ALPINE=amd64/alpine:3.12
ARG BASE_ALPINE=docker.io/alpine:3.12
ARG CONFIGURE_ARGS=""
ARG FAKERELEASE=false
ARG PROGNAME="armagetronad"
......@@ -19,11 +19,11 @@ libxml2 \
libgcc \
libstdc++ \
protobuf \
runit \
--no-cache
WORKDIR /
RUN adduser -D ${PROGNAME}
########################################
......@@ -82,11 +82,15 @@ FROM runtime_base AS run_server
ARG PROGNAME
COPY --chown=root --from=build /root/destdir /
COPY batch/docker-entrypoint.sh.in /usr/local/bin/docker-entrypoint.sh
RUN sh /usr/local/share/games/*-dedicated/scripts/sysinstall install /usr/local && \
echo -e "#!/bin/bash\n/usr/local/bin/${PROGNAME}-dedicated \"\$@\"" > /usr/local/bin/run.sh && \
chmod 755 /usr/local/bin/run.sh
sed -i /usr/local/bin/docker-entrypoint.sh -e "s/@progname@/${PROGNAME}/g" && \
chmod 755 /usr/local/bin/docker-entrypoint.sh
USER ${PROGNAME}
USER nobody:nobody
ENTRYPOINT ["/usr/local/bin/run.sh"]
VOLUME ["/var/${PROGNAME}"]
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
#ENTRYPOINT ["bash"]
EXPOSE 4534/udp
......@@ -37,6 +37,7 @@ armascript_SCRIPTS=$(scriptsToBuild) $(rcScripts)
# What goes in a distribution
EXTRA_DIST=\
docker-entrypoint.sh.in\
install.in\
masterstarter.in\
rcd_config.in\
......
#!/bin/bash
# set -x
if test ${UID} = 0; then
# running as root inside the container; presumably the caller determined
# that this is needed to get write access to the var directory.
# make var directory usable
chown -R nobody:nobody /var/@progname@
# drop root rights in exec
EXEC_DECO="chpst -u nobody"
else
EXEC_DECO=""
fi
exec ${EXEC_DECO} /usr/local/bin/@progname@-dedicated \
--userdatadir /usr/share/@progname@ \
--vardir /var/@progname@ \
--autoresourcedir /var/@progname@/resource \
"$@"
......@@ -687,6 +687,15 @@ context.deploy_steam: context.deploy_base_steam ${srcdir}/../deploy/steamcontent
echo "steamcmd" > $@.dir/image
echo > $@
context.deploy_gitlab: context.deploy_base_gitlab Makefile
${srcdir}/prepare_context.sh $@.dir $<.dir/'*'
echo "#/bin/bash" > $@.dir/CI_INFO_DEPLOY_GITLAB
echo "CI_JOB_TOKEN=${CI_JOB_TOKEN}" >> $@.dir/CI_INFO_DEPLOY_GITLAB
echo "CI_API_V4_URL=${CI_API_V4_URL}" >> $@.dir/CI_INFO_DEPLOY_GITLAB
echo "CI_PROJECT_ID=${CI_PROJECT_ID}" >> $@.dir/CI_INFO_DEPLOY_GITLAB
chmod 755 $@.dir/CI_INFO_DEPLOY_GITLAB
echo > $@
context.deploy_ppa_%: result.debsrc_% ${srcdir}/../deploy/deploy_ppa.sh ../deploy/targets.sh CI_INFO
${srcdir}/prepare_context.sh $@.dir $<.dir/'*' ${srcdir}/../deploy/deploy_ppa.sh ../deploy/targets.sh ../deploy/secrets/*.gpg CI_INFO
echo > $@
......@@ -745,6 +754,7 @@ result.deploy_download: deploy_external
# individual deploy targets
deploy_lp: result.deploy_lp
deploy_scp: result.deploy_scp
deploy_gitlab: result.deploy_gitlab
deploy_steam: result.deploy_steam
deploy_zi: result.deploy_zi
deploy_fp: result.deploy_fp
......@@ -777,7 +787,7 @@ staged_%:
sed -i ../deploy/targets.sh -e "s/STAGING=false/STAGING=true/"
MAKE=$(MAKE) ${srcdir}/make_deploy.sh $*
.PHONY: deploy deploy_ppa deploy_scp deploy_steam deploy_base deploy_download
.PHONY: deploy deploy_ppa deploy_scp deploy_gitlab deploy_steam deploy_base deploy_download
.PRECIOUS: context.debsrc_dapper \
context.debsrc_bionic result.debsrc_bionic context.deploy_ppa_bionic result.deploy_ppa_bionic \
......@@ -787,6 +797,7 @@ context.debsrc_focal result.debsrc_focal context.deploy_ppa_focal result.depl
context.debsrc_groovy result.debsrc_groovy context.deploy_ppa_groovy result.deploy_ppa_groovy \
context.debsrc_hirsute result.debsrc_hirsute context.deploy_ppa_hirsute result.deploy_ppa_hirsute \
context.deploy_base_scp context.deploy_scp \
context.deploy_base_gitlab context.deploy_gitlab \
context.deploy_base_download result.deploy_download context.deploy_download
#***************************************************************
......
......@@ -21,8 +21,10 @@ else
NAME=${PACKAGE_NAME}
fi
DOCKER_VERSION=`echo ${PACKAGE_VERSION} | sed -e 's,+,-,g'` || exit $?
REGISTRY=${CI_REGISTRY_IMAGE:-registry.gitlab.com/armagetronad/armagetronad}
DI_TAG=${NAME}:${PACKAGE_VERSION}
DI_TAG=${NAME}:${DOCKER_VERSION}
CACHE=${REGISTRY}/cache:${PACKAGE_NAME}
BASE_CACHE=${REGISTRY}/cache:armagetronad
......@@ -78,6 +80,8 @@ if test -z "${DOCKER_NODEPLOY}"; then
tag ${REGISTRY}/${DI_TAG} || exit $?
fi
tag ${REGISTRY}/${NAME} || exit $?
else
docker run --rm ${DI_TAG} --version || exit $?
fi
docker image rm ${DI_TAG} || exit $?
#!/bin/bash
# push upload directory to gitlab release
. ./version.sh || exit $?
. ./targets.sh || exit $?
. CI_INFO_DEPLOY_GITLAB || exit $?
set -x
# gitlab only accepts NUMBER.NUMBER.NUMBER
# Replace all non-number sequences by dots
# pad numbers to two digits
# remove leading 0
# only leave the first three dots
GITLAB_VERSION=`echo ${PACKAGE_VERSION} | sed -e 's,[[:alpha:]_+-]\+,.,g' -e 's,\.\([0-9]\)\.,.0\1.,g' -e 's,\.\([0-9]\)\.,.0\1.,g' -e 's,\.\([0-9]\)\.,.0\1.,g' -e 's,^0.,0,' -e 's,\.,,3g'` || exit $?
if ${STAGING} == true; then
exit 0
fi
function upload(){
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file $1 "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${GITLAB_VERSION}/`basename $1`"
}
EXIT=0
for f in upload/*.AppImage upload/*.exe upload/${PACKAGE_NAME}-${PACKAGE_VERSION}*.tbz upload/*source*.zip; do
if test -r $f; then
upload $f || EXIT=$?
fi
done
rm -rf source upload ulb secrets ~/.ssh
exit ${EXIT}
......@@ -87,6 +87,13 @@ case ${SERIES}+${SUFFIX}+@version@ in
STEAM_BRANCH="experimental"
;;
AP*)
SF_DIR="ap/${YEAR}"
LP_SERIES=""
ZI_SERIES="ap"
STEAM_BRANCH="ap"
;;
HACK*)
SF_DIR="wip/${YEAR}"
LP_SERIES="hacks"
......@@ -149,7 +156,7 @@ else
# A proper final build. Deploy to LTS ppa.
UBUNTU_PPA=ppa:armagetronad-dev/lts
;;
*+CURRENT|*+EXPERIMENTAL|experimental+*)
*+CURRENT|*+EXPERIMENTAL|experimental+*|*+AP)
# A proper final build. Deploy to regular PPA.
UBUNTU_PPA=ppa:armagetronad-dev/ppa
;;
......
......@@ -52,6 +52,11 @@ if test "${CI_COMMIT_REF_PROTECTED}" = "true"; then
PROGRAM_NAME="armagetronad-experimental"
PROGRAM_TITLE="Armagetron Experimental"
;;
hack-*ap)
SERIES="AP"
PROGRAM_NAME="armagetronad-ap"
PROGRAM_TITLE="Armagetron aP"
;;
hack*)
SERIES="HACK"
PROGRAM_NAME="armagetronad-hack"
......
......@@ -27,6 +27,11 @@ case $1 in
CI_COMMIT_REF_NAME=trunk
CI_COMMIT_BRANCH=trunk
;;
ap)
CI_COMMIT_REF_PROTECTED=true
CI_COMMIT_REF_NAME=hack-0.2.8-sty+ct+ap
CI_COMMIT_BRANCH=hack-0.2.8-sty+ct+ap
;;
hack)
CI_COMMIT_REF_PROTECTED=true
CI_COMMIT_BEFORE_SHA=
......@@ -78,7 +83,7 @@ case $1 in
CI_MERGE_REQUEST_TARGET_BRANCH_NAME=trunk
;;
*)
echo "NO VALID CONFIGURATION SELECTED, available: raw (no CI), hack, wip, alpha, beta, rc, release, tag (unprotected), merge"
echo "NO VALID CONFIGURATION SELECTED, available: raw (no CI), hack, wip, ap (Alpha Project), alpha, beta, rc, release, tag (unprotected), merge"
exit 1
;;
esac
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment