Skip to content

Commit

Permalink
AppVeyor build pipeline changes (#2849)
Browse files Browse the repository at this point in the history
* Move AppVeyor folder

* path updates

* Update AppVeyorBeforePackage.bat

* Update AppVeyorBeforePackage.bat

* Update AppVeyorBeforePackage.bat

* Add AppVeyorInit

* Add Clone script

* Remove Init/Clone

* .

* .

* Update AppVeyorBeforeCompile.bat

* Update AppVeyorBeforeCompile.bat

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update AppVeyorBeforeCompile.bat

* .

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update AppVeyorBeforeCompile.bat

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* .
  • Loading branch information
LtRipley36706 committed Mar 23, 2020
1 parent 5ed73dd commit 0ab1527
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ Config/
Dats/
Logs/
db-data/
AppVeyor/

# ACEmulator specific files
Source/ACE.Server/config.js
Expand Down
2 changes: 2 additions & 0 deletions AppVeyor/AppVeyorAfterCompile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo on
AppVeyor\MySqlInstall.bat
13 changes: 13 additions & 0 deletions AppVeyor/AppVeyorAfterDeploy.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
REM docker login -u="%DOCKER_USER%" -p="%DOCKER_PASS%"
REM @echo on
REM docker push acemulator/ace
@echo off

git config --global user.email "%GIT_A%"
git config --global user.name "%GIT_B%"

@echo on
git add -A
git commit -m "[ci skip] Updating project files with latest version information"
git push origin master
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
@echo off
echo APPVEYOR_REPO_BRANCH is: %APPVEYOR_REPO_BRANCH%
echo APPVEYOR_REPO_COMMIT is: %APPVEYOR_REPO_COMMIT%
echo APPVEYOR_PULL_REQUEST_HEAD_COMMIT is: %APPVEYOR_PULL_REQUEST_HEAD_COMMIT%
echo APPVEYOR_BUILD_NUMBER is: %APPVEYOR_BUILD_NUMBER%
echo APPVEYOR_BUILD_VERSION is: %APPVEYOR_BUILD_VERSION%

REM for /f "tokens=1,2,3 delims=." %%a in ("%APPVEYOR_BUILD_VERSION%") do set TRUE_VERSION=%%a.%%b & set TRUE_BUILD=%%c

echo BUILD_DATETIME is: %BUILD_DATETIME%
echo TRUE_VERSION is: %TRUE_VERSION%
echo TRUE_BUILD is: %TRUE_BUILD%
echo COMMIT_ID is: %COMMIT_ID%
echo REVISED_VERSION is: %REVISED_VERSION%

REM appveyor UpdateBuild -Version "%REVISED_VERSION%"

REM set APPVEYOR_BUILD_VERSION=%REVISED_VERSION%
REM echo APPVEYOR_BUILD_VERSION is: %APPVEYOR_BUILD_VERSION%

@echo on
nuget restore source\ACE.sln
copy Source\AppVeyor\Config.js Source\ACE.Server\Config.js
nuget restore Source\ACE.sln
copy AppVeyor\Config.js Source\ACE.Server\Config.js

@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
Expand Down
6 changes: 6 additions & 0 deletions AppVeyor/AppVeyorBeforePackage.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo on
dotnet publish "C:\projects\ace\Source\ACE.Server\ACE.Server.csproj" --output C:\projects\ace\publish --configuration Release --verbosity minimal

7z.exe a AppVeyor\ACE.Server-v%APPVEYOR_BUILD_VERSION%.zip "C:\projects\ace\publish\*"

REM docker build -t acemulator/ace:latest -t acemulator/ace:%APPVEYOR_BUILD_VERSION% .
3 changes: 3 additions & 0 deletions AppVeyor/AppVeyorTestScript.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo on
dotnet test --diag AppVeyor\ACETests-Server.txt --no-build "Source\ACE.Server.Tests" --test-adapter-path:. --logger:Appveyor
dotnet test --diag AppVeyor\ACETests-Database.txt --no-build "Source\ACE.Database.Tests" --test-adapter-path:. --logger:Appveyor
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
@echo off
REM Download latest ACE-World database, extract and import it
REM Download latest ACE-World database, extract and import it

REM echo %downloadfile%
REM echo %zipfile%
REM echo %sqlfile%

set /p dbversion=<Source\AppVeyor\dbversion.txt
set /p dbversion=<AppVeyor\dbversion.txt

IF EXIST Source\AppVeyor\db-pr-override.txt (
set /p downloadfile=<Source\AppVeyor\db-pr-override.txt
IF EXIST AppVeyor\db-pr-override.txt (
set /p downloadfile=<AppVeyor\db-pr-override.txt
) ELSE (
set downloadfile=https://github.com/ACEmulator/ACE-World-16PY-Patches/releases/download/v%dbversion%/ACE-World-Database-v%dbversion%.sql.zip
)

FOR /f "delims=" %%i in ("%downloadfile%") DO (
FOR /f "delims=" %%i in ("%downloadfile%") DO (
set zipfile=%%~nxi
)

Expand All @@ -27,4 +27,7 @@ appveyor DownloadFile %downloadfile%
7z x %zipfile%
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_world < %sqlfile%

del %zipfile%
del %sqlfile%

@echo on
14 changes: 7 additions & 7 deletions Source/AppVeyor/MySqlInstall.bat → AppVeyor/MySqlInstall.bat
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
REM create databases
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! mysql < database\Create\create_mysql.sql
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! mysql < Database\Create\create_mysql.sql

REM execute Base Scripts
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_auth < database\base\AuthenticationBase.sql
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_shard < database\base\ShardBase.sql
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_world < database\base\WorldBase.sql
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_auth < Database\Base\AuthenticationBase.sql
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_shard < Database\Base\ShardBase.sql
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_world < Database\Base\WorldBase.sql

REM execute Update Scripts for Authentication Database
REM "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_auth < database\updates\authentication\changeme.sql
For /R "database\updates\authentication\" %%G IN (*.sql) do (
For /R "Database\Updates\Authentication\" %%G IN (*.sql) do (
REM echo Found file: %%G
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_auth < %%G
)

REM execute Update Scripts for Shard Database
REM "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_shard < database\updates\shard\changeme.sql
For /R "database\updates\shard\" %%G IN (*.sql) do (
For /R "Database\Updates\Shard\" %%G IN (*.sql) do (
echo Found file: %%G
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_shard < %%G
)
Expand All @@ -24,7 +24,7 @@ REM execute Update Scripts for World Database
REM "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_world < database\updates\world\changeme.sql

REM Download latest ACE-World database, extract and import it
call Source\AppVeyor\DownloadACEWorld.bat
call AppVeyor\DownloadACEWorld.bat

REM execute Update Scripts for World Database
REM "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" -h localhost -u root -pPassword12! ace_world < database\updates\world\changeme.sql
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions Source/AppVeyor/AppVeyorAfterCompile.bat

This file was deleted.

4 changes: 0 additions & 4 deletions Source/AppVeyor/AppVeyorAfterDeploy.bat

This file was deleted.

4 changes: 0 additions & 4 deletions Source/AppVeyor/AppVeyorBeforePackage.bat

This file was deleted.

3 changes: 0 additions & 3 deletions Source/AppVeyor/AppVeyorTestScript.bat

This file was deleted.

36 changes: 29 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ skip_tags: true
image: Visual Studio 2019
configuration: Release
platform: x64
init:
- cmd: >-
for /f "tokens=1,2,3 delims=." %%a in ("%APPVEYOR_BUILD_VERSION%") do set TRUE_VERSION=%%a.%%b& set TRUE_BUILD=%%c
set BUILD_DATETIME=%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%
set COMMIT_ID=%APPVEYOR_REPO_COMMIT:~0,7%
set REVISED_VERSION=%TRUE_VERSION%.%TRUE_BUILD%.%APPVEYOR_REPO_BRANCH%-%COMMIT_ID%
appveyor UpdateBuild -Version "%REVISED_VERSION%"
set APPVEYOR_BUILD_VERSION=%REVISED_VERSION%
dotnet_csproj:
patch: true
file: '**\*.csproj'
Expand All @@ -19,35 +32,44 @@ environment:
secure: qs6SGmd8XeCqWCMGx5+VAg==
DOCKER_PASS:
secure: AdN3f5EVMXteNIDrqS8FhSezFUuiZ7F4LU0woD5raBE=
GIT_A:
secure: juAGPTUbTXbVFEoEnhGOSc0WOaxbvKKNha5dKPB1P/I=
GIT_B:
secure: bhR4cIOcVqIBZXFOBVTtvQ==
services: mysql
before_build:
- cmd: source\AppVeyor\AppVeyorBeforeCompile.bat
- cmd: AppVeyor\AppVeyorBeforeCompile.bat
build:
project: source\ACE.sln
project: Source\ACE.sln
verbosity: minimal
before_package:
- cmd: source\AppVeyor\AppVeyorBeforePackage.bat
- cmd: AppVeyor\AppVeyorBeforePackage.bat
after_build:
- cmd: source\AppVeyor\AppVeyorAfterCompile.bat
- cmd: AppVeyor\AppVeyorAfterCompile.bat
test_script:
- cmd: source\AppVeyor\AppVeyorTestScript.bat
- cmd: AppVeyor\AppVeyorTestScript.bat
artifacts:
- path: '**\ACETests*.txt'
name: test logs
- path: '**\ACE.Server-*.zip'
name: release candidate
before_deploy:
- ps: >-
git config --global credential.helper store
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
deploy:
- provider: GitHub
tag: v$(appveyor_build_version)
release: ACEmulator Server - v$(appveyor_build_version)
description: <h1> ACEmulator Server - v$(appveyor_build_version) </h1> <blockquote>The following commit is included in this release:</<blockquote> <h1></h1>$(APPVEYOR_REPO_COMMIT_MESSAGE) <p>$(APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED)<h1><h6>automated server build - $(APPVEYOR_REPO_COMMIT_TIMESTAMP)
auth_token:
secure: k8Q9MwG7UgKbocfdJvD4iBwL1K2AsdjZs6B34/vFqkoukW9p3tJ3uRacb1Zmclyp
artifact: ACE.Server-v$(appveyor_build_version).zip
artifact: AppVeyor\ACE.Server-v$(appveyor_build_version).zip
draft: true
prerelease: false
force_update: true
on:
branch: master
after_deploy:
- cmd: source\AppVeyor\AppVeyorAfterDeploy.bat
- cmd: AppVeyor\AppVeyorAfterDeploy.bat

0 comments on commit 0ab1527

Please sign in to comment.