-
-
Notifications
You must be signed in to change notification settings - Fork 135
/
Copy path.appveyor.yml
133 lines (130 loc) · 4.91 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
version: build-{build}.{branch}
image: Visual Studio 2019
branches:
only:
# - windows
# - /^23.11$/
- master
- "23.11"
# - /v*/
# skip_non_tags: true
clone_depth: 1
clone_folder: C:\Users\appveyor\lnmp
# clone_folder: D:\lnmp
build_script:
- pwsh: |
[System.Environment]::OSVersion
$PSVersionTable
echo $HOME
echo $env:PATH
get-command bash
get-command wsl
- pwsh: docker version
- pwsh: docker info
- pwsh: docker compose version
- ps: get-command docker
- ps: date
- ps: |
& $Env:ProgramFiles\Docker\Docker\DockerCli.exe -Shutdown
- ps: date
- ps: get-command Switch-DockerLinux
- ps: net user
- ps: ls C:\Users
- ps: cat $HOME\Documents\WindowsPowerShell\Modules\docker-appveyor\docker-appveyor.psm1
# - ps: choco uninstall docker-desktop -force
# - ps: rm -Force $Env:ProgramFiles\Docker\Docker\"Docker for windows Installer.exe" -ErrorAction SilentlyContinue
# - ps: start-process powershell -Argumentlist "-c","rm","-Force","'C:\Program Files\Docker\Docker\Docker for windows Installer.exe'" -Verb Runas -WindowStyle Hidden -wait
# - ps: wsl -u root -- rm -rf '/mnt/c/Program Files/Docker/Docker/Docker for windows Installer.exe'
# - ps: ls $Env:ProgramFiles\Docker\Docker\
# - ps: choco install docker-desktop --pre --no-progress
# - ps: start-process choco -Argumentlist "upgrade","docker-desktop","--no-progress","-f" -wait -verb RunAs -WindowStyle Hidden
# - ps: cat C:\ProgramData\chocolatey\logs\chocolatey.log
# - ps: choco install docker-desktop --no-progress
# - ps: |
# copy-item $Env:ProgramFiles\Docker\Docker\resources\bin\docker.exe $Env:ProgramFiles\Docker\
# copy-item $Env:ProgramFiles\Docker\Docker\resources\bin\docker-compose.exe $Env:ProgramFiles\Docker\
- ps: date
- ps: echo $env:PATH
- ps: |
ls $Env:ProgramFiles\Docker\
- ps: |
ls $Env:ProgramFiles\Docker\Docker
- ps: |
ls $Env:ProgramFiles\Docker\Docker\resources\bin
- ps: get-command docker
# - ps: |
# Stop-Service docker
- ps: Write-host "`nSwitch to linux engine" -foregroundcolor green
# - ps: |
# & $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchLinuxEngine
- ps: Switch-DockerLinux
# - ps: ./lnmp-docker wait-docker
- ps: docker info
# - ps: |
# [environment]::SetEnvironmentvariable("Path", "C:\;$env:PATH","Process")
- ps: echo $env:PATH
- ps: |
& $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SharedDrives
# - ps: ./lnmp-docker wait-docker
- pwsh: ./lnmp-docker
- pwsh: icacls C:\Users\appveyor\lnmp /grant 'DockerExchange:f' /T | out-null
- pwsh: icacls C:\Users\appveyor\lnmp\log /grant 'DockerExchange:f' /T
- pwsh: |
./lnmp-docker services
./lnmp-docker config | out-file docker-compose.yml
docker compose config -q
./lnmp-docker config > docker-compose.yml
docker compose config -q
- ps: echo $env:DOCKER_HOST
- ps: |
[environment]::SetEnvironmentvariable("DOCKER_HOST","npipe:////./pipe/docker_engine","Process")
ls $HOME/.docker
- pwsh: |
docker compose up -d $(./lnmp-docker services)
sleep 20
docker ps -a
curl 127.0.0.1
./lnmp-docker down
- pwsh: ./lnmp-docker up
- pwsh: |
sleep 60
docker ps -a
cat log/php/php-fpm-error.log
cat log/nginx/error.log
docker compose logs
(Invoke-WebRequest 127.0.0.1).content
./lnmp-docker down
# - ps: Write-host "`nSwitch to Windows engine" -foregroundcolor green
# - ps: Switch-DockerWindows
# - ps: |
# cd dockerfile-windows
# echo "WIN_VERSION=/servercore:1809" >> .env
# docker build --build-arg WIN_VERSION=/servercore:1809 -t khs1994/nginx:1.17.3-windowsservercore-1903 nginx
# docker run --isolation=process -it -d -p 8080:80 -p 443:443 khs1994/nginx:1.17.3-windowsservercore-1903
# sleep 10
# docker ps -a
# (Invoke-WebRequest 127.0.0.1:8080).content
# docker rm -f $(docker ps -a -q)
# docker build --build-arg WIN_VERSION=/servercore:1809 -t khs1994/php:7.3.8-windowsservercore-1903 php
# cd ..
# remove-item windows/config/nginx/www.conf
# move-item windows/config/nginx/www.container.config windows/config/nginx/www.conf
# - ps: docker compose -f docker-windows.yml up -d nginx php
# - ps: |
# sleep 60
# docker ps -a
# (Invoke-WebRequest 127.0.0.1:8080).content
# (Invoke-WebRequest https://demo.t.khs1994.com/index.html).content
# (Invoke-WebRequest https://demo.t.khs1994.com/index.php).content
# docker compose -f docker-windows.yml down
test_script:
- ps: wsl --help
- ps: wslconfig /setdefault ubuntu-18.04
- ps: wsl cat /etc/os-release
- ps: wsl ls -la /mnt/c/Users/appveyor/lnmp
- ps: |
if($APPVEYOR_REPO_TAG){
& $HOME\lnmp\windows\lnmp-windows-pm install php composer nginx node
& $HOME\lnmp\windows\lnmp-windows-pm install deno
& $HOME\lnmp\windows\lnmp-windows-pm install python
}