Updated ci config to support both iis and apache release and dev
This commit is contained in:
parent
88a1044a57
commit
a813c42d33
29
.ci-dev.ps1
Normal file
29
.ci-dev.ps1
Normal file
@ -0,0 +1,29 @@
|
||||
if (Test-Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev" -Recurse -Force
|
||||
}
|
||||
|
||||
New-Item -Path "C:\inetpub\wwwroot\" -Name "build-tmp.enpaul-dev" -ItemType Directory -Force
|
||||
|
||||
Copy-Item -Path ".\*" -Destination "C:\inetpub\wwwroot\build-tmp.enpaul-dev\" -Force -Recurse
|
||||
|
||||
if (Test-Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\.git") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\.git" -Recurse -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\.gitlab-ci.yml") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\.gitlab-ci.yml" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\deploy.ps1") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\deploy.ps1" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\.gitignore") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\.gitignore" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\.htaccess") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev\.htaccess" -Force
|
||||
}
|
||||
|
||||
Rename-Item -Path "C:\inetpub\wwwroot\enpaul-dev" -NewName "enpaul-dev.old" -Force
|
||||
Rename-Item -Path "C:\inetpub\wwwroot\build-tmp.enpaul-dev" -NewName "enpaul-dev" -Force
|
||||
|
||||
Remove-Item -path "C:\inetpub\wwwroot\enpaul-dev.old" -Recurse -Force
|
||||
exit
|
29
.ci-release.ps1
Normal file
29
.ci-release.ps1
Normal file
@ -0,0 +1,29 @@
|
||||
if (Test-Path "C:\inetpub\wwwroot\tmp-build.enpaul") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\tmp-build.enpaul" -Recurse -Force
|
||||
}
|
||||
|
||||
New-Item -Path "C:\inetpub\wwwroot\" -Name "tmp-build.enpaul" -ItemType Directory -Force
|
||||
|
||||
Copy-Item -Path ".\*" -Destination "C:\inetpub\wwwroot\tmp-build.enpaul\" -Force -Recurse
|
||||
|
||||
if (Test-Path "C:\inetpub\wwwroot\tmp-build.enpaul\.git") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\tmp-build.enpaul\.git" -Recurse -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\tmp-build.enpaul\.gitlab-ci.yml") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\tmp-build.enpaul\.gitlab-ci.yml" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\tmp-build.enpaul\deploy.ps1") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\tmp-build.enpaul\deploy.ps1" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\tmp-build.enpaul\.gitignore") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\tmp-build.enpaul\.gitignore" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\tmp-build.enpaul\.htaccess") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\tmp-build.enpaul\.htaccess" -Force
|
||||
}
|
||||
|
||||
Rename-Item -Path "C:\inetpub\wwwroot\enpaul" -NewName "enpaul.old" -Force
|
||||
Rename-Item -Path "C:\inetpub\wwwroot\tmp-build.enpaul" -NewName "enpaul" -Force
|
||||
|
||||
Remove-Item -path "C:\inetpub\wwwroot\enpaul.old" -Recurse -Force
|
||||
exit
|
@ -1,24 +1,61 @@
|
||||
stages:
|
||||
- deploy-apache
|
||||
- deploy-release-apache
|
||||
- deploy-dev-apache
|
||||
- deploy-release-iis
|
||||
- deploy-dev-iis
|
||||
|
||||
#IIS Deployment:
|
||||
# stage: deploy-iis
|
||||
# script:
|
||||
# - powershell .\deploy.ps1
|
||||
# tags:
|
||||
# - iis
|
||||
|
||||
Apache Deployment:
|
||||
stage: deploy-apache
|
||||
IIS Production:
|
||||
stage: deploy-release-iis
|
||||
script:
|
||||
- mkdir /var/www/html/enpaul.new
|
||||
- rm ./deploy.ps1
|
||||
- rm ./web.config
|
||||
- rm ./.gitlab-ci.yml
|
||||
- cp -r ./* /var/www/html/enpaul.new/
|
||||
- cp ./.htaccess /var/www/html/enpaul.new/
|
||||
- mv /var/www/html/enpaul /var/www/html/enpaul.old
|
||||
- mv /var/www/html/enpaul.new /var/www/html/enpaul
|
||||
- rm -r /var/www/html/enpaul.old
|
||||
- powershell .\.ci-release.ps1
|
||||
only:
|
||||
- master
|
||||
tags:
|
||||
- apache
|
||||
- release-iis
|
||||
|
||||
IIS Development:
|
||||
stage: deploy-dev-iis
|
||||
script:
|
||||
- powershell .\.ci-dev.ps1
|
||||
only:
|
||||
- development
|
||||
tags:
|
||||
- dev-iis
|
||||
|
||||
Apache Production:
|
||||
stage: deploy-release-apache
|
||||
script:
|
||||
- [ -d /var/www/html/build-tmp.enpaul ] && rm -r /var/www/html/build-tmp.enpaul
|
||||
- mkdir /var/www/html/build-tmp.enpaul
|
||||
- cp -r ./* /var/www/html/build-tmp.enpaul/
|
||||
- rm /var/www/html/build-tmp.enpaul/.ci-release.ps1
|
||||
- rm /var/www/html/build-tmp.enpaul/.ci-dev.ps1
|
||||
- rm /var/www/html/build-tmp.enpaul/web.config
|
||||
- rm /var/www/html/build-tmp.enpaul/.gitlab-ci.yml
|
||||
- rm -r /var/www/html/build-tmp.enpaul/.git
|
||||
- [ -d /var/www/html/enpaul ] && mv /var/www/html/enpaul /var/www/html/enpaul.old
|
||||
- mv /var/www/html/build-tmp.enpaul /var/www/html/enpaul
|
||||
- rm -r /var/www/html/enpaul.old
|
||||
only:
|
||||
- master
|
||||
tags:
|
||||
- release-apache
|
||||
|
||||
Apache Development:
|
||||
stage: deploy-dev-apache
|
||||
script:
|
||||
- [ -d /var/www/html/build-tmp.enpaul-dev ] && rm -r /var/www/html/build-tmp.enpaul-dev
|
||||
- mkdir /var/www/html/build-tmp.enpaul-dev
|
||||
- cp -r ./* /var/www/html/build-tmp.enpaul-dev/
|
||||
- rm /var/www/html/build-tmp.enpaul-dev/.ci-release.ps1
|
||||
- rm /var/www/html/build-tmp.enpaul-dev/.ci-dev.ps1
|
||||
- rm /var/www/html/build-tmp.enpaul-dev/web.config
|
||||
- rm /var/www/html/build-tmp.enpaul-dev/.gitlab-ci.yml
|
||||
- rm -r /var/www/html/build-tmp.enpaul-dev/.git
|
||||
- [ -d /var/www/html/enpaul-dev ] && mv /var/www/html/enpaul-dev /var/www/html/enpaul-dev.old
|
||||
- mv /var/www/html/build-tmp.enpaul-dev /var/www/html/enpaul-dev
|
||||
- rm -r /var/www/html/enpaul-dev.old
|
||||
only:
|
||||
- development
|
||||
tags:
|
||||
- dev-apache
|
||||
|
29
deploy.ps1
29
deploy.ps1
@ -1,29 +0,0 @@
|
||||
if (Test-Path "C:\inetpub\wwwroot\enpaul.net.new") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\enpaul.net.new" -Recurse -Force
|
||||
}
|
||||
|
||||
New-Item -Path "C:\inetpub\wwwroot\" -Name "enpaul.net.new" -ItemType Directory -Force
|
||||
|
||||
Copy-Item -Path ".\*" -Destination "C:\inetpub\wwwroot\enpaul.net.new\" -Force -Recurse
|
||||
|
||||
if (Test-Path "C:\inetpub\wwwroot\enpaul.net.new\.git") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\enpaul.net.new\.git" -Recurse -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\enpaul.net.new\.gitlab-ci.yml") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\enpaul.net.new\.gitlab-ci.yml" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\enpaul.net.new\deploy.ps1") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\enpaul.net.new\deploy.ps1" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\enpaul.net.new\.gitignore") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\enpaul.net.new\.gitignore" -Force
|
||||
}
|
||||
if (Test-Path "C:\inetpub\wwwroot\enpaul.net.new\.htaccess") {
|
||||
Remove-Item -Path "C:\inetpub\wwwroot\enpaul.net.new\.htaccess" -Force
|
||||
}
|
||||
|
||||
Rename-Item -Path "C:\inetpub\wwwroot\enpaul.net" -NewName "enpaul.net.old" -Force
|
||||
Rename-Item -Path "C:\inetpub\wwwroot\enpaul.net.new" -NewName "enpaul.net" -Force
|
||||
|
||||
Remove-Item -path "C:\inetpub\wwwroot\enpaul.net.old" -Recurse -Force
|
||||
exit
|
Loading…
Reference in New Issue
Block a user