diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e813985..7f975f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,8 +16,11 @@ build: - "update-binfmts --enable" - apt-get update; apt-get install --no-install-recommends -y ca-certificates jq - "VERSION=$(curl -s \"https://dl$BRANCH.b-cdn.net/linux-index.json\" | jq -r .[0].version | sed \"s/v0/v/\")" - - if [ "$BRANCH" == "test" ]; then VERSION="$BRANCH-$VERSION"; fi + - TAG=$VERSION + - if [ "$BRANCH" == "test" ]; then TAG="$BRANCH-$VERSION"; fi script: - - "docker buildx build --platform linux/arm64/v8,linux/amd64 --build-arg \"BRANCH=$BRANCH\" -t \"corysanin/clone-hero-server:latest\" ." + - "docker buildx build --platform linux/amd64 --build-arg \"BRANCH=$BRANCH\" --build-arg \"VERSION=$VERSION\" -t \"corysanin/clone-hero-server:latest\" ." + - "docker buildx build --platform linux/arm64/v8 --build-arg \"BRANCH=$BRANCH\" --build-arg \"VERSION=$VERSION\" -t \"corysanin/clone-hero-server:latest\" ." + - "docker buildx build --platform linux/arm/v7 --build-arg \"BRANCH=$BRANCH\" --build-arg \"VERSION=$VERSION\" -t \"corysanin/clone-hero-server:latest\" ." - docker create --name=chs corysanin/clone-hero-server:latest - - "if [ ! -z ${DOCKER_PASSWORD+x} ]; then echo \"$DOCKER_PASSWORD\" | docker login -u \"$DOCKER_USERNAME\" --password-stdin; docker buildx build --push --platform linux/arm64/v8,linux/amd64 --build-arg \"BRANCH=$BRANCH\" -t \"corysanin/clone-hero-server:latest\" .; docker buildx build --push --platform linux/arm64/v8,linux/amd64 --build-arg \"BRANCH=$BRANCH\" -t \"corysanin/clone-hero-server:$VERSION\" .; fi" + - "if [ ! -z ${DOCKER_PASSWORD+x} ]; then echo \"$DOCKER_PASSWORD\" | docker login -u \"$DOCKER_USERNAME\" --password-stdin; docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --build-arg \"BRANCH=$BRANCH\" --build-arg \"VERSION=$VERSION\" -t \"corysanin/clone-hero-server:latest\" .; docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --build-arg \"BRANCH=$BRANCH\" --build-arg \"VERSION=$VERSION\" -t \"corysanin/clone-hero-server:$TAG\" .; fi" diff --git a/Dockerfile b/Dockerfile index dad5ba7..f2ec4ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,13 +6,15 @@ RUN apt-get update \ WORKDIR /clonehero ARG BRANCH=test -RUN chversion=$(curl -s "https://dl$BRANCH.b-cdn.net/linux-index.json" | jq -r .[0].version | sed "s/v0/v/") \ - && wget -O chserver.zip https://dl.clonehero.net/chserver/ChStandaloneServer-$chversion.zip \ +ARG VERSION +RUN if [ -z ${VERSION+x} ]; then VERSION=$(curl -s "https://dl$BRANCH.b-cdn.net/linux-index.json" | jq -r .[0].version | sed "s/v0/v/"); fi \ + && wget -O chserver.zip https://dl.clonehero.net/chserver/ChStandaloneServer-$VERSION.zip \ && unzip chserver.zip \ && rm ./chserver.zip \ && mv ./ChStandaloneServer-* ./chserver \ && mv ./chserver/linux-x64 ./chserver/linux-x86_64 \ && mv ./chserver/linux-arm64 ./chserver/linux-aarch64 \ + && mv ./chserver/linux-arm ./chserver/linux-armv7l \ && mv ./chserver/linux-$(arch)/* . \ && rm -rf ./chserver \ && chmod +x ./Server \