Skip to content

Commit

Permalink
internal: update vcpkg & docker-related files (#1295)
Browse files Browse the repository at this point in the history
Also deletes overlay port to use upstream chakracore port (includes #1273 and #1290)
  • Loading branch information
nic11 authored Jan 8, 2023
1 parent 49bedbc commit 2574e0e
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 167 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.git
.github
build
docs
Expand All @@ -8,6 +9,5 @@ skymp5-functions-lib/node_modules
skymp5-functions-lib/coverage
skymp5-functions-lib/gamemode.js
skymp5-server/node_modules
skymp5-server/cmake-js-fetch-build
skyrim-platform/node_modules
vcpkg
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ RUN \


# Intermediate image to build
# TODO: copy less stuff, use args to pass the desired vcpkg submodule revision
# TODO: copy less stuff
# TODO: build huge deps separately
FROM skymp-build-base AS skymp-vcpkg-deps-builder
ARG VCPKG_URL
ARG VCPKG_COMMIT

COPY --chown=skymp:skymp . /src

USER skymp

RUN cd /src \
&& git submodule update --init --recursive \
&& git clone "$VCPKG_URL" vcpkg \
&& git -C vcpkg checkout "$VCPKG_COMMIT" \
&& ./build.sh --configure


Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ "`basename "$PWD"`" = "build" ]; then
cd ..
fi

if [ ! -e .git ]; then
if [ ! -e build.sh ]; then
eecho "This script should be run from either source root or build directory."
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion ci/deploy/remote/branchctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ docker run -d --restart=always --name="skymp-server-$branch" --network=host \
-u "`id -u`:`id -g`" \
--cpu-period=50000 --cpu-quota=25000 \
--cap-add=SYS_PTRACE \
skymp/skymp-runtime-base:20221216-1 ./run.sh
skymp/skymp-runtime-base:20230105-1 ./run.sh
# ^ limited to 50% of CPU: https://stackoverflow.com/a/41552172

# This looks a bit ugly, but apparently is more fault-tolerant than older version:
Expand Down
2 changes: 1 addition & 1 deletion ci/github_env_linux
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SKYMP_VCPKG_DEPS_IMAGE=skymp/skymp-vcpkg-deps:20221216-1
SKYMP_VCPKG_DEPS_IMAGE=skymp/skymp-vcpkg-deps:20230105-1
30 changes: 30 additions & 0 deletions misc/build-docker-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# run from repository root:
# nice ./misc/build-docker-image.sh YYYYMMDD-rev

if [ "" == "$1" ]; then
echo Expected version tag >&2
exit 1
fi
VERSION_TAG="$1"
shift

set -e
set -x

VCPKG_URL="`git -C vcpkg remote get-url origin`"
VCPKG_COMMIT="`git -C vcpkg rev-parse HEAD`"

sed -i -r -e 's/(skymp-(vcpkg-deps|runtime-base):)[-0-9a-zA-Z]+/\1'"$VERSION_TAG"'/g' ci/github_env_linux ci/deploy/remote/branchctl.sh

podman build . --target=skymp-vcpkg-deps --tag=skymp/skymp-vcpkg-deps:"$VERSION_TAG" --cpu-quota=$((100000*10)) --build-arg VCPKG_URL="$VCPKG_URL" --build-arg VCPKG_COMMIT="$VCPKG_COMMIT"
podman build . --target=skymp-runtime-base --tag=skymp/skymp-runtime-base:"$VERSION_TAG" --cpu-quota=$((100000*10)) --build-arg VCPKG_URL="$VCPKG_URL" --build-arg VCPKG_COMMIT="$VCPKG_COMMIT"

set +x
echo -n 'ENTER to push'
read
set -x

podman push localhost/skymp/skymp-vcpkg-deps:"$VERSION_TAG" docker.io/skymp/skymp-vcpkg-deps:"$VERSION_TAG"
podman push localhost/skymp/skymp-runtime-base:"$VERSION_TAG" docker.io/skymp/skymp-runtime-base:"$VERSION_TAG"
8 changes: 0 additions & 8 deletions overlay_ports/chakracore/no-warning-as-error.props

This file was deleted.

144 changes: 0 additions & 144 deletions overlay_ports/chakracore/portfile.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions overlay_ports/chakracore/vcpkg.json

This file was deleted.

2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 1006 files

0 comments on commit 2574e0e

Please sign in to comment.