mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Azure Pipelines: improve steps, use Ninja and designated build directory
This commit is contained in:
parent
c948f65850
commit
6801e4b384
@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
sudo dpkg -i build/softether-common*.deb
|
BUILD_BINARIESDIRECTORY="${BUILD_BINARIESDIRECTORY:-build}"
|
||||||
sudo dpkg -i build/softether-vpnbridge*.deb
|
|
||||||
sudo dpkg -i build/softether-vpnclient*.deb
|
sudo dpkg -i $BUILD_BINARIESDIRECTORY/softether-common*.deb
|
||||||
sudo dpkg -i build/softether-vpncmd*.deb
|
sudo dpkg -i $BUILD_BINARIESDIRECTORY/softether-vpnbridge*.deb
|
||||||
sudo dpkg -i build/softether-vpnserver*.deb
|
sudo dpkg -i $BUILD_BINARIESDIRECTORY/softether-vpnclient*.deb
|
||||||
|
sudo dpkg -i $BUILD_BINARIESDIRECTORY/softether-vpncmd*.deb
|
||||||
|
sudo dpkg -i $BUILD_BINARIESDIRECTORY/softether-vpnserver*.deb
|
||||||
|
|
||||||
sudo systemctl restart softether-vpnserver || (sudo journalctl -xe --no-pager >> systemctl.log && appveyor PushArtifact systemctl.log && exit 1)
|
sudo systemctl restart softether-vpnserver || (sudo journalctl -xe --no-pager >> systemctl.log && appveyor PushArtifact systemctl.log && exit 1)
|
||||||
|
|
||||||
|
@ -1,20 +1,25 @@
|
|||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
|
if (Test-Path "env:BUILD_BINARIESDIRECTORY") {
|
||||||
|
$BUILD_BINARIESDIRECTORY = $env:BUILD_BINARIESDIRECTORY
|
||||||
|
} else {
|
||||||
|
$BUILD_BINARIESDIRECTORY = "build"
|
||||||
|
}
|
||||||
|
|
||||||
# ('s', 'c', 'b', 'sm', 'cm') ??
|
# ('s', 'c', 'b', 'sm', 'cm') ??
|
||||||
('s', 'c', 'b') | % {
|
('s', 'c', 'b') | % {
|
||||||
|
|
||||||
[String] $mode = $_
|
[String] $mode = $_
|
||||||
Write-Host "testing: $mode"
|
Write-Host "testing: $mode"
|
||||||
|
|
||||||
$full = (Write-Output "q\n" | & .\build\vpntest.exe $mode)
|
$full = (Write-Output "q\n" | & "$BUILD_BINARIESDIRECTORY\vpntest.exe" $mode)
|
||||||
$t = ($full | Select-String -Pattern 'NO MEMORY LEAKS' -CaseSensitive)
|
$t = ($full | Select-String -Pattern 'NO MEMORY LEAKS' -CaseSensitive)
|
||||||
|
|
||||||
if( ($t).Count -ne 1){
|
if (($t).Count -ne 1) {
|
||||||
$full
|
$full
|
||||||
Write-Error 'failed'
|
Write-Error 'failed'
|
||||||
return $false
|
return $false
|
||||||
}else{
|
} else {
|
||||||
Write-Host 'ok'
|
Write-Host 'ok'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,15 +3,17 @@ jobs:
|
|||||||
displayName: 'Ubuntu (x86_64)'
|
displayName: 'Ubuntu (x86_64)'
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-16.04
|
vmImage: ubuntu-16.04
|
||||||
variables:
|
|
||||||
CPACK_GENERATOR: DEB
|
|
||||||
steps:
|
steps:
|
||||||
- script: |
|
- script: |
|
||||||
sudo apt -y install cmake gcc g++ libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev
|
cd $BUILD_BINARIESDIRECTORY
|
||||||
./configure
|
sudo apt -y install cmake gcc g++ ninja-build libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev
|
||||||
make package -C build -j $(nproc || sysctl -n hw.ncpu || echo 4)
|
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo $BUILD_SOURCESDIRECTORY
|
||||||
|
cmake --build .
|
||||||
|
cpack -C Release -G DEB
|
||||||
|
displayName: 'Build'
|
||||||
|
- script: |
|
||||||
.ci/appveyor-deb-install-test.sh
|
.ci/appveyor-deb-install-test.sh
|
||||||
sudo apt-get -y install autoconf libtool liblzo2-dev libpam-dev fping unzip # openvpn build deps
|
sudo apt-get -y install autoconf libtool liblzo2-dev libpam-dev fping unzip # To build OpenVPN
|
||||||
sudo .ci/start-se-openvpn.sh
|
sudo BUILD_BINARIESDIRECTORY=$BUILD_BINARIESDIRECTORY .ci/start-se-openvpn.sh
|
||||||
sudo .ci/run-openvpn-tests.sh
|
sudo BUILD_BINARIESDIRECTORY=$BUILD_BINARIESDIRECTORY .ci/run-openvpn-tests.sh
|
||||||
displayName: 'Ubuntu 16.04'
|
displayName: 'Test'
|
||||||
|
@ -5,22 +5,21 @@ jobs:
|
|||||||
vmImage: vs2017-win2016
|
vmImage: vs2017-win2016
|
||||||
steps:
|
steps:
|
||||||
- script: |
|
- script: |
|
||||||
|
cd /d %BUILD_BINARIESDIRECTORY%
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
configure
|
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=cl "-DCMAKE_CXX_COMPILER=cl" %BUILD_SOURCESDIRECTORY%
|
||||||
- script: |
|
cmake --build .
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
displayName: 'Build'
|
||||||
cd build
|
|
||||||
nmake
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. .ci\appveyor-vpntest.ps1
|
. .ci\appveyor-vpntest.ps1
|
||||||
- powershell: |
|
displayName: 'Test'
|
||||||
New-Item -Path '$(build.artifactstagingdirectory)/publish' -ItemType Directory
|
|
||||||
- task: CopyFiles@2
|
- task: CopyFiles@2
|
||||||
inputs:
|
inputs:
|
||||||
sourceFolder: '$(Build.SourcesDirectory)'
|
sourceFolder: '$(Build.BinariesDirectory)'
|
||||||
contents: 'build/?(*.exe|*.se2|*.pdb)'
|
contents: '?(*.exe|*.se2|*.pdb)'
|
||||||
TargetFolder: '$(build.artifactstagingdirectory)/publish'
|
TargetFolder: '$(Build.StagingDirectory)'
|
||||||
|
flattenFolders: true
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
inputs:
|
inputs:
|
||||||
pathtoPublish: '$(build.artifactstagingdirectory)/publish'
|
pathtoPublish: '$(Build.StagingDirectory)'
|
||||||
artifactName: vs2017
|
artifactName: 'Binaries'
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
cd
|
BUILD_BINARIESDIRECTORY="${BUILD_BINARIESDIRECTORY:-build}"
|
||||||
|
|
||||||
|
cd $BUILD_BINARIESDIRECTORY
|
||||||
|
|
||||||
git clone https://github.com/openvpn/openvpn
|
git clone https://github.com/openvpn/openvpn
|
||||||
cd openvpn
|
cd openvpn
|
||||||
autoreconf -iv
|
autoreconf -iv
|
||||||
|
@ -2,13 +2,17 @@
|
|||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
build/vpnserver start
|
BUILD_BINARIESDIRECTORY="${BUILD_BINARIESDIRECTORY:-build}"
|
||||||
|
|
||||||
build/vpncmd 127.0.0.1:443 /SERVER /HUB:DEFAULT /CMD:SecureNatEnable
|
cd $BUILD_BINARIESDIRECTORY
|
||||||
build/vpncmd 127.0.0.1:443 /SERVER /CMD:"OpenVpnEnable yes"
|
|
||||||
build/vpncmd 127.0.0.1:443 /SERVER /CMD:"PortsUDPSet 1194"
|
|
||||||
build/vpncmd 127.0.0.1:443 /SERVER /HUB:DEFAULT /CMD:"UserCreate test /GROUP:none /REALNAME:none /NOTE:none"
|
|
||||||
build/vpncmd 127.0.0.1:443 /SERVER /HUB:DEFAULT /CMD:"UserPasswordSet test /PASSWORD:test"
|
|
||||||
build/vpncmd 127.0.0.1:443 /SERVER /CMD:"OpenVpnMakeConfig ~/my_openvpn_config.zip"
|
|
||||||
|
|
||||||
unzip -d /tmp ~/my_openvpn_config.zip
|
./vpnserver start
|
||||||
|
|
||||||
|
./vpncmd 127.0.0.1:443 /SERVER /HUB:DEFAULT /CMD:SecureNatEnable
|
||||||
|
./vpncmd 127.0.0.1:443 /SERVER /CMD:"OpenVpnEnable yes"
|
||||||
|
./vpncmd 127.0.0.1:443 /SERVER /CMD:"PortsUDPSet 1194"
|
||||||
|
./vpncmd 127.0.0.1:443 /SERVER /HUB:DEFAULT /CMD:"UserCreate test /GROUP:none /REALNAME:none /NOTE:none"
|
||||||
|
./vpncmd 127.0.0.1:443 /SERVER /HUB:DEFAULT /CMD:"UserPasswordSet test /PASSWORD:test"
|
||||||
|
./vpncmd 127.0.0.1:443 /SERVER /CMD:"OpenVpnMakeConfig my_openvpn_config.zip"
|
||||||
|
|
||||||
|
unzip -d /tmp my_openvpn_config.zip
|
||||||
|
Loading…
Reference in New Issue
Block a user