Skip to content

Commit

Permalink
Merge pull request #3 from Akaizoku/develop
Browse files Browse the repository at this point in the history
Fix issue #2
  • Loading branch information
Akaizoku authored Nov 23, 2021
2 parents c670ac8 + 1e26b6a commit fddeef8
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to the [Alteryx deploy](https://github.com/Akaizoku/alteryx-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.1](https://github.com/Akaizoku/alteryx-deploy/releases/1.1.1) - 2021-11-23

### Changed

- Updated default sources location

### Fixed

- Fixed an issue with upgrade from 2021.3 (or lower) to 2021.4 ([#2](https://github.com/Akaizoku/alteryx-deploy/issues/2))

## [1.1.0](https://github.com/Akaizoku/alteryx-deploy/releases/1.1.0) - 2021-11-21

### Added
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Example script structure with embedded dependencies:

### Alteryx

Alteryx installation files must be made available in the source directory (default `D:\Sources`). See the [compatibility section](#compatibility) for more information about the supported versions.
Alteryx installation files must be made available in the source directory (default `C:\Sources`). See the [compatibility section](#compatibility) for more information about the supported versions.

You can download them from <https://downloads.alteryx.com>.

Expand Down Expand Up @@ -344,12 +344,12 @@ Below are the steps to restart the Alteryx application.

Transcript log files are generated in the log directory of the script.

- The naming convention is as follows: `<Timestamp>_<Action>-Alteryx.log`
- The naming convention of the transcript log file is: `<Timestamp>_<Action>-Alteryx.log`
- The format of the log is: `<Timestamp>\t<Message type>\t<Message>`

Additional log files are generated during the installation, upgrade, or uninstallation of Alteryx as an XML file in teh same log directory.
Additional log files are generated by [InstallAware](https://www.installaware.com/) during the installation, upgrade, or uninstallation of Alteryx as an XML file in the same log directory. Those are disabled by default because of the negative impact on the speed of execution, but they can be enabled by setting the configuration variable `InstallAwareLog` to `true`.

- The naming convention is as follows: `<Timestamp>_<Setup.exe>.log`
The naming convention of the InstallAware log file is: `<Timestamp>_<Setup.exe>.log`

Below is an example of a successful installation log:

Expand Down Expand Up @@ -385,6 +385,7 @@ Only the first version supported is listed. Later releases should also be compat
| ---------------- | -------- | ---------- | ------ | ------- |
| [1.0.0] | [2021.3] | 5.0 | 1.2.4 | 1.0.0 |
| [1.1.0] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 |
| [1.1.1] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 |

## Known issues

Expand All @@ -405,4 +406,5 @@ It can be prevented by configuring a temporary directory (`TempDirectory`) that
[PSAYX]: https://www.powershellgallery.com/packages/PSAYX
[1.0.0]:https://github.com/Akaizoku/alteryx-deploy/releases/1.0.0
[1.1.0]:https://github.com/Akaizoku/alteryx-deploy/releases/1.1.0
[1.1.1]:https://github.com/Akaizoku/alteryx-deploy/releases/1.1.1
[2021.3]:https://help.alteryx.com/release-notes/server/server-20213-release-notes
2 changes: 1 addition & 1 deletion conf/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TempDirectory = \tmp
# Resources directory
ResDirectory = \res
# Sources directory
SrcDirectory = C:\Program Files\Alteryx\Sources
SrcDirectory = C:\Sources
# Alteryx installation directory
InstallationPath = C:\Program Files\Alteryx
# Backup directory
Expand Down
6 changes: 3 additions & 3 deletions powershell/Invoke-BackupAlteryx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Invoke-BackupAlteryx {
File name: Invoke-BackupAlteryx.ps1
Author: Florian Carrier
Creation date: 2021-08-26
Last modified: 2021-11-21
Last modified: 2021-11-22
#>
[CmdletBinding (
SupportsShouldProcess = $true
Expand All @@ -35,8 +35,8 @@ function Invoke-BackupAlteryx {
Get-CallerPreference -Cmdlet $PSCmdlet -SessionState $ExecutionContext.SessionState
# Variables
$ISOTimeStamp = Get-Date -Format "yyyyMMdd_HHmmss"
$BackupPath = Join-Path -Path $Properties.BackupDirectory -ChildPath "${ISOTimeStamp}_Alteryx_Server.zip"
$TempBackupPath = Join-Path -Path $Properties.TempDirectory -ChildPath "${ISOTimeStamp}_Alteryx_Server"
$BackupPath = Join-Path -Path $Properties.BackupDirectory -ChildPath "${ISOTimeStamp}_Alteryx_Server_$($Properties.Version).zip"
$TempBackupPath = Join-Path -Path $Properties.TempDirectory -ChildPath "${ISOTimeStamp}_Alteryx_Server_$($Properties.Version)"
$MongoDBPath = Join-Path -Path $TempBackupPath -ChildPath "MongoDB"
$ServicePath = Join-Path -Path $Properties.InstallationPath -ChildPath "bin\AlteryxService.exe"
# Backup options
Expand Down
26 changes: 14 additions & 12 deletions powershell/Update-Alteryx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Update-Alteryx {
File name: Update-Alteryx.ps1
Author: Florian Carrier
Creation date: 2021-09-02
Last modified: 2021-11-20
Last modified: 2021-11-22
#>
[CmdletBinding (
SupportsShouldProcess = $true
Expand Down Expand Up @@ -45,29 +45,31 @@ function Update-Alteryx {
$AlteryxService = Get-AlteryxUtility -Utility "Service" -Path $Properties.InstallationPath
# Clear error pipeline
$Error.Clear()
}
Process {
Write-Log -Type "CHECK" -Object "Starting Alteryx Server upgrade to $($Properties.Version)"
# Retrieve current version
Write-Log -Type "INFO" -Object "Retrieving current version"
Write-Log -Type "DEBUG" -Object "Retrieving current version"
if ($PSCmdlet.ShouldProcess("Alteryx version", "Retrieve")) {
$BackupVersion = Get-AlteryxVersion -Path $AlteryxService
$AlteryxVersion = Get-AlteryxVersion -Path $AlteryxService
Write-Log -Type "DEBUG" -Object $AlteryxVersion
$BackupVersion = Select-String -InputObject $AlteryxVersion -Pattern "\d+\.\d+.\d+(.\d+)?" | ForEach-Object { $PSItem.Matches.Value }
}
Write-Log -Type "DEBUG" -Object $BackupVersion
}
Process {
Write-Log -Type "CHECK" -Object "Starting Alteryx Server upgrade from $BackupVersion to $($Properties.Version)"
# Create back-up
Invoke-BackupAlteryx -Properties $Properties -Unattended:$Unattended
$BackUpProperties = Copy-OrderedHashtable -Hashtable $Properties
$BackUpProperties.Version = $BackupVersion
Invoke-BackupAlteryx -Properties $BackUpProperties -Unattended:$Unattended
# Upgrade
Install-Alteryx -Properties $Properties -InstallationProperties $InstallationProperties -Unattended:$Unattended
# Check for errors
if ($Error.Count -gt 0) {
# Rollback
Write-Log -Type "ERROR" -Object "Upgrade process failed with $($Error.Count) errors"
Write-Log -Type "WARN" -Object "Restoring previous version ($BackupVersion)"
# Overwrite target version
$Properties.Version = $BackupVersion
# Reinstall Alteryx
Install-Alteryx -Properties $Properties -Unattended:$Unattended
Install-Alteryx -Properties $BackUpProperties -Unattended:$Unattended
# Restore backup
Invoke-RestoreAlteryx -Properties $Properties -Unattended:$Unattended
Invoke-RestoreAlteryx -Properties $BackUpProperties -Unattended:$Unattended
} else {
Write-Log -Type "CHECK" -Object "Alteryx Server upgrade completed successfully"
}
Expand Down

0 comments on commit fddeef8

Please sign in to comment.