Commit fc287327 by Nithish Reddy Billa

Update .gitlab-ci.yml

parent b7ad9e23
Pipeline #15167 passed with stages
in 23 minutes 6 seconds
Showing with 33 additions and 2 deletions
stages:
- build
- deploy
- deploy_asg
build_website:
stage: build
......@@ -20,4 +21,35 @@ deploy_web:
- $servers = $env:DEPLOY_SERVERS -split ';'
- Copy-FilesToServers -Servers $servers -UserName $env:DEPLOY_USERNAME -Password $env:DEPLOY_PASSWORD -LocalPath ".\Mobile.WYSIWYG\build\web\_PublishedWebsites\Mobile.WYSIWYG\*" -RemotePath "C:\adk-mobile\$env:CI_PROJECT_NAME\Mobile.WYSIWYG\$env:CI_BUILD_ID"
- Set-IISPhysicalPaths -Servers $servers -UserName $env:DEPLOY_USERNAME -Password $env:DEPLOY_PASSWORD -IISSite "Mobile.WYSIWYG" -Path "c:\adk-mobile\$env:CI_PROJECT_NAME\Mobile.WYSIWYG\$env:CI_BUILD_ID"
when: manual
\ No newline at end of file
when: manual
deploy_asg:
stage: deploy_asg
script:
- $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
- $headers.Add("x-api-key", $env:AMI_API_KEY)
- $response = Invoke-RestMethod "https://371e80qilk.execute-api.us-west-2.amazonaws.com/default/create-ami?instanceid=$env:INSTANCE_ID&group=content-vault" -Headers $headers
- Write-Host $response
- $amiId = $response.ImageId
- $headers["x-api-key"] = $env:AMI_CHECK_API_KEY
- $CheckCount = 1
- do {
- Start-Sleep -s 60
- $response = Invoke-RestMethod "https://fv32k5tlel.execute-api.us-west-2.amazonaws.com/default/check-ami-status?amiid=$amiId" -Headers $headers
- Write-Host "ami status $response.state, check count $CheckCount"
- $CheckCount += 1
} until (($response.state -eq "available") -and ($CheckCount -lt 15))
- If (-Not ($response.state -eq "available")) { Exit }
- $headers["x-api-key"] = $env:LAUNCH_CONFIG_API_KEY
- $response = Invoke-RestMethod "https://nl90tc5t7d.execute-api.us-west-2.amazonaws.com/default/create-launch-configuration?amiid=$amiId" -Headers $headers
- Write-Host $response
- $launchConfigName = $response.launch_config_name
- Start-Sleep -s 60
- $headers["x-api-key"] = $env:ASG_UP_API_KEY
- $response = Invoke-RestMethod "https://4pgcnqwrc4.execute-api.us-west-2.amazonaws.com/default/asg-new-tag-scale-up?launch_config_name=$launchConfigName&desire_capacity=2&auto_scale_group_name=aws-content-vault-api-asg" -Headers $headers
- Write-Host $response
- Start-Sleep -s 600
- $headers["x-api-key"] = $env:ASG_DOWN_API_KEY
- $response = Invoke-RestMethod "https://lr50lqs0xg.execute-api.us-west-2.amazonaws.com/default/asg-scale-down?desire_capacity=1&auto_scale_group_name=aws-content-vault-api-asg" -Headers $headers
- Write-Host $response
when: manual
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment