-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from red-gate/FWinstaller_corrections
corrected yml name + powershell flyway installer
- Loading branch information
Showing
2 changed files
with
100 additions
and
47 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
Azure-Templatized-YML-Pipeline/templates/Install-Windows-fw.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#Flyway Version to Use - Check here for latest version information - https://documentation.red-gate.com/fd/command-line-184127404.html | ||
|
||
$flywayVersion = '9.21.2' | ||
|
||
#Flyway URL to download CLI | ||
|
||
$Url = "https://download.red-gate.com/maven/release/org/flywaydb/enterprise/flyway-commandline/$flywayVersion/flyway-commandline-$flywayVersion-windows-x64.zip" | ||
|
||
#Insert path for downloaded files | ||
|
||
$DownloadZipFile = "C:\FlywayCLI\" + $(Split-Path -Path $Url -Leaf) | ||
|
||
#Assign location for Flyway to extracted to | ||
|
||
$ExtractPath = "C:\FlywayCLI\" | ||
|
||
#SilentlyContinue informs PowerShell to download the CLI without a progress bar. This often drastically improves the download time. | ||
|
||
$ProgressPreference = 'SilentlyContinue' | ||
|
||
if (Test-Path $ExtractPath) { | ||
|
||
Write-Host "Folder Exists" | ||
|
||
} | ||
else | ||
{ | ||
|
||
#PowerShell Create directory if not exists | ||
New-Item $ExtractPath -ItemType Directory | ||
Write-Host "Folder Created successfully" | ||
} | ||
|
||
# Download the CLI to the desired location | ||
|
||
Invoke-WebRequest -Uri $Url -OutFile $DownloadZipFile | ||
|
||
# Extract the CLI to the desired location | ||
|
||
$ExtractShell = New-Object -ComObject Shell.Application | ||
|
||
$ExtractFiles = $ExtractShell.Namespace($DownloadZipFile).Items() | ||
|
||
$ExtractShell.NameSpace($ExtractPath).CopyHere($ExtractFiles) | ||
Start-Process $ExtractPath | ||
|
||
# Update PATH Variable with Flyway CLI - Azure DevOps # | ||
|
||
# echo "##vso[task.setvariable variable=path]$(PATH);C:\FlywayCLI\flyway-$flywayVersion" | ||
|
||
# Update PATH variable with Flyway CLI - Generic - Comment above and uncomment below to take affect # | ||
|
||
[Environment]::SetEnvironmentVariable("PATH", $Env:PATH + ";${ExtractPath}flyway-$flywayVersion", [EnvironmentVariableTarget]::Machine) |
94 changes: 47 additions & 47 deletions
94
...ne/templates/build-windows-install-fw.yml → ...line/templates/build-Linux-install-fw.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
parameters: | ||
- name: stage | ||
default: Build | ||
- name: displayName | ||
default: Deploy Build | ||
- name: executeBuild | ||
default: true | ||
- name: targetCredentials | ||
default: '' | ||
- name: pipelineParameters | ||
default: '' | ||
|
||
stages: | ||
- ${{if eq(parameters.executeBuild, true)}}: | ||
- stage: Build | ||
pool: $(AGENT_POOL) | ||
displayName: ${{parameters.displayName}} | ||
jobs: | ||
- job: Build | ||
variables: | ||
- group: ${{parameters.targetCredentials}} | ||
- group: ${{parameters.pipelineParameters}} | ||
- group: redgate_global_vars | ||
steps: | ||
- bash: | | ||
wget -q https://download.red-gate.com/maven/release/org/flywaydb/enterprise/flyway-commandline/9.22.3/flyway-commandline-9.22.3-linux-x64.tar.gz | ||
tar -xzf flyway-commandline-9.22.3-linux-x64.tar.gz -C /opt | ||
if [[ ! -L "/usr/local/bin/flyway" ]] | ||
then | ||
sudo ln -s /opt/flyway-9.22.3/flyway /usr/local/bin | ||
fi | ||
flyway --version | ||
failOnStderr: true | ||
displayName: 'Setup Redgate Flyway Commandline' | ||
# - script: '$(FLYWAY) clean info -url="$(target_database_JDBC)"' | ||
# failOnStderr: true | ||
# displayName: 'Clean Build DB' | ||
# env: | ||
# FLYWAY_CLEAN_DISABLED: false | ||
|
||
- script: '$(FLYWAY) migrate info -url="$(target_database_JDBC)"' | ||
failOnStderr: true | ||
displayName: 'Validate Migrate Scripts' | ||
|
||
- script: '$(FLYWAY) undo info -url="$(target_database_JDBC)" -target="$(FIRST_UNDO_SCRIPT)"?' | ||
continueOnError: true | ||
parameters: | ||
- name: stage | ||
default: Build | ||
- name: displayName | ||
default: Deploy Build | ||
- name: executeBuild | ||
default: true | ||
- name: targetCredentials | ||
default: '' | ||
- name: pipelineParameters | ||
default: '' | ||
|
||
stages: | ||
- ${{if eq(parameters.executeBuild, true)}}: | ||
- stage: Build | ||
pool: $(AGENT_POOL) | ||
displayName: ${{parameters.displayName}} | ||
jobs: | ||
- job: Build | ||
variables: | ||
- group: ${{parameters.targetCredentials}} | ||
- group: ${{parameters.pipelineParameters}} | ||
- group: redgate_global_vars | ||
steps: | ||
- bash: | | ||
wget -q https://download.red-gate.com/maven/release/org/flywaydb/enterprise/flyway-commandline/9.22.3/flyway-commandline-9.22.3-linux-x64.tar.gz | ||
tar -xzf flyway-commandline-9.22.3-linux-x64.tar.gz -C /opt | ||
if [[ ! -L "/usr/local/bin/flyway" ]] | ||
then | ||
sudo ln -s /opt/flyway-9.22.3/flyway /usr/local/bin | ||
fi | ||
flyway --version | ||
failOnStderr: true | ||
displayName: 'Setup Redgate Flyway Commandline' | ||
# - script: '$(FLYWAY) clean info -url="$(target_database_JDBC)"' | ||
# failOnStderr: true | ||
# displayName: 'Clean Build DB' | ||
# env: | ||
# FLYWAY_CLEAN_DISABLED: false | ||
|
||
- script: '$(FLYWAY) migrate info -url="$(target_database_JDBC)"' | ||
failOnStderr: true | ||
displayName: 'Validate Migrate Scripts' | ||
|
||
- script: '$(FLYWAY) undo info -url="$(target_database_JDBC)" -target="$(FIRST_UNDO_SCRIPT)"?' | ||
continueOnError: true | ||
displayName: 'Validate Undo Scripts' |