mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
feat(CORE): docker permissions and rework (#13454)
- fix docker permissions with mounted volumes on new docker versions (https://github.com/docker/desktop-linux/issues/31) - fix ac-tools image - cleanup unused env - add `cap_add: SYS_NICE` to allow setting process high priority - fix ccache in docker - allow to switch between root user (default) to acore user in any container - fix cache of the downloaded client data - split docker github actions in 2 parts - versioning mysql images - performance improvements
This commit is contained in:
1
.github/workflows/build_dbimport.yml
vendored
1
.github/workflows/build_dbimport.yml
vendored
@@ -21,6 +21,7 @@ jobs:
|
||||
name: ${{ matrix.compiler }}
|
||||
env:
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache
|
||||
|
||||
2
.github/workflows/core_build.yml
vendored
2
.github/workflows/core_build.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
||||
env:
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache
|
||||
|
||||
11
.github/workflows/core_matrix_build.yml
vendored
11
.github/workflows/core_matrix_build.yml
vendored
@@ -29,7 +29,16 @@ jobs:
|
||||
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
||||
env:
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'file-cpp') || github.event.label.name == 'file-cpp' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
if: |
|
||||
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
&& !github.event.pull_request.draft
|
||||
&& (
|
||||
github.ref == 'refs/heads/master'
|
||||
|| contains(github.event.pull_request.labels.*.name, 'file-cpp'
|
||||
|| github.event.label.name == 'file-cpp'
|
||||
|| contains(github.event.pull_request.labels.*.name, 'run-build')
|
||||
|| github.event.label.name == 'run-build')
|
||||
)
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache
|
||||
|
||||
11
.github/workflows/core_modules_build.yml
vendored
11
.github/workflows/core_modules_build.yml
vendored
@@ -23,7 +23,16 @@ jobs:
|
||||
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.modules }}-modules
|
||||
env:
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'file-cpp') || github.event.label.name == 'file-cpp' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
if: |
|
||||
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
&& !github.event.pull_request.draft
|
||||
&& (
|
||||
github.ref == 'refs/heads/master'
|
||||
|| contains(github.event.pull_request.labels.*.name, 'file-cpp'
|
||||
|| github.event.label.name == 'file-cpp'
|
||||
|| contains(github.event.pull_request.labels.*.name, 'run-build')
|
||||
|| github.event.label.name == 'run-build')
|
||||
)
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout modules
|
||||
|
||||
87
.github/workflows/docker_build.yml
vendored
87
.github/workflows/docker_build.yml
vendored
@@ -11,13 +11,16 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
docker-build-n-deploy:
|
||||
docker-build-n-deploy-dev:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
if: |
|
||||
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
&& !github.event.pull_request.draft
|
||||
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
env:
|
||||
COMPOSE_DOCKER_CLI_BUILD: 1
|
||||
DOCKER_BUILDKIT: 1
|
||||
@@ -40,14 +43,6 @@ jobs:
|
||||
docker --version
|
||||
docker compose --version
|
||||
|
||||
# TODO: make it work
|
||||
# - uses: whoan/docker-build-with-cache-action@v5
|
||||
# with:
|
||||
# image_tag: master
|
||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
# compose_file: docker-compose.yml
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||
uses: docker/login-action@v1
|
||||
@@ -55,19 +50,17 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
|
||||
# before cache
|
||||
# needed to avoid ccache injected into these images
|
||||
- name: Build Dev
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
env:
|
||||
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
|
||||
DOCKER_EXTENDS_BIND: abstract-no-bind
|
||||
DOCKER_CLIENT_TIMEOUT: 400
|
||||
COMPOSE_HTTP_TIMEOUT: 400
|
||||
run: |
|
||||
export DOCKER_USER_ID=$(id -u)
|
||||
export DOCKER_GROUP_ID=$(id -u)
|
||||
# pull the images first to load the docker cache layers
|
||||
./acore.sh docker pull
|
||||
./acore.sh docker build
|
||||
|
||||
- name: Deploy Dev
|
||||
@@ -76,6 +69,47 @@ jobs:
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||
run: |
|
||||
docker compose --profile dev --profile local push
|
||||
output=$(./acore.sh version | grep "AzerothCore Rev.") && version=${output#"AzerothCore Rev."}
|
||||
DOCKER_IMAGE_TAG=$version docker compose --profile local push
|
||||
|
||||
docker-build-n-deploy-prod:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: |
|
||||
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
&& !github.event.pull_request.draft
|
||||
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
env:
|
||||
COMPOSE_DOCKER_CLI_BUILD: 1
|
||||
DOCKER_BUILDKIT: 1
|
||||
BUILDKIT_INLINE_CACHE: 1
|
||||
|
||||
steps:
|
||||
- name: Extract branch name
|
||||
shell: bash
|
||||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
||||
id: extract_branch
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
sudo rm -rf /usr/local/lib/android
|
||||
sudo rm -rf /usr/share/dotnet
|
||||
sudo rm -rf /opt/ghc
|
||||
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||
docker --version
|
||||
docker compose --version
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
@@ -90,16 +124,17 @@ jobs:
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
env:
|
||||
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
|
||||
DOCKER_EXTENDS_BIND: abstract-no-bind
|
||||
DOCKER_AC_BUILD_TARGET: build
|
||||
DOCKER_CLIENT_TIMEOUT: 220
|
||||
COMPOSE_HTTP_TIMEOUT: 220
|
||||
run: |
|
||||
export DOCKER_USER_ID=$(id -u)
|
||||
export DOCKER_GROUP_ID=$(id -u)
|
||||
# pull the images first to load the docker cache layers
|
||||
./acore.sh docker prod:pull
|
||||
./acore.sh docker prod:build
|
||||
docker compose run --no-deps --name build ac-build echo "image created"
|
||||
docker cp build:/azerothcore/var/ccache var/docker/
|
||||
# create the container to allow the copy right after
|
||||
docker compose create ac-build-prod
|
||||
docker compose cp ac-build-prod:/azerothcore/var/ccache var/docker/
|
||||
echo "ccache exported"
|
||||
|
||||
- name: Deploy Production images
|
||||
@@ -108,3 +143,19 @@ jobs:
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||
run: |
|
||||
docker compose --profile prod push
|
||||
output=$(./acore.sh version | grep "AzerothCore Rev.") && version=${output#"AzerothCore Rev."}
|
||||
DOCKER_IMAGE_TAG=$version docker compose --profile prod push
|
||||
|
||||
|
||||
dispatch-acore-docker:
|
||||
needs: [ docker-build-n-deploy-prod , docker-build-n-deploy-dev]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Repository Dispatch
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.ACORE_DOCKER_REPO_ACCESS_TOKEN }}
|
||||
repository: azerothcore/acore-docker
|
||||
# event-type: my-event
|
||||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
||||
|
||||
2
.github/workflows/import_pending.yml
vendored
2
.github/workflows/import_pending.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
|
||||
2
.github/workflows/issue-labeler.yml
vendored
2
.github/workflows/issue-labeler.yml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
|
||||
jobs:
|
||||
issue_labeler:
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||
runs-on: ubuntu-latest
|
||||
name: Issue Labeler
|
||||
steps:
|
||||
|
||||
5
.github/workflows/macos_build.yml
vendored
5
.github/workflows/macos_build.yml
vendored
@@ -20,7 +20,10 @@ jobs:
|
||||
- macos-12
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: ${{ matrix.os }}
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
if: |
|
||||
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
&& !github.event.pull_request.draft
|
||||
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache
|
||||
|
||||
2
.github/workflows/tools_build.yml
vendored
2
.github/workflows/tools_build.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
||||
env:
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache
|
||||
|
||||
5
.github/workflows/windows_build.yml
vendored
5
.github/workflows/windows_build.yml
vendored
@@ -20,7 +20,10 @@ jobs:
|
||||
name: ${{ matrix.os }}
|
||||
env:
|
||||
BOOST_ROOT: C:\local\boost_1_79_0
|
||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
if: |
|
||||
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||
&& !github.event.pull_request.draft
|
||||
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Configure OS
|
||||
|
||||
Reference in New Issue
Block a user