Skip to content

Commit

Permalink
Merge pull request #13 from Akaizoku/release-1.1.2
Browse files Browse the repository at this point in the history
Release 1.1.2
  • Loading branch information
Akaizoku authored Dec 13, 2021
2 parents 59d0b54 + c27be28 commit d1119dd
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 56 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ 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.2](https://github.com/Akaizoku/alteryx-deploy/releases/1.1.2) - 2021-12-13

UX improvements

### Changed

- Automatically update environment variables during restore (installation path, Gallery URL, etc.)

### Fixed

- Fixed an issue when the license email was not specified ([#4](https://github.com/Akaizoku/alteryx-deploy/issues/4))
- Fixed an issue when the license email was not specified and the Active Directory server was unreachable ([#5](https://github.com/Akaizoku/alteryx-deploy/issues/5))
- Fixed an issue preventing the restoration on a different machine ([#8](https://github.com/Akaizoku/alteryx-deploy/issues/8))

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

### Changed
Expand All @@ -17,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

2021.4 hotfix

### Added

- `Invoke-StartAlteryx` now checks for release version to ensure compatibility
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,12 @@ Below are the steps to restore the Alteryx application database.
2. Check backup path;
- If backup file is an archive (.ZIP), extract files from archive.
- If backup path is a directory, select most recent backup file (using [last write time](https://docs.microsoft.com/en-us/dotnet/api/system.io.filesysteminfo.lastwritetime)).
3. Restore MongoDB database;
4. Restore application configuration files;
3. Restore application configuration files;
4. Update configuration to match new environment;
5. Restore controller token;
6. Reset storage keys;
7. Restart Alteryx Service (if it was running previously).
7. Restore MongoDB database;
8. Restart Alteryx Service (if it was running previously).

### Start

Expand Down Expand Up @@ -388,6 +389,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 |
| [1.1.2] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 |

## Known issues

Expand All @@ -409,4 +411,5 @@ It can be prevented by configuring a temporary directory (`TempDirectory`) that
[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
[1.1.2]:https://github.com/Akaizoku/alteryx-deploy/releases/1.1.2
[2021.3]:https://help.alteryx.com/release-notes/server/server-20213-release-notes
4 changes: 4 additions & 0 deletions conf/custom.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ------------------------------------------------------------------------------
# Add your custom configuration here
# e.g. TempDirectory = D:\Temp
# ------------------------------------------------------------------------------
4 changes: 4 additions & 0 deletions conf/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Version = 2021.3.3.63061
EnableSSL = false
# InstallAware log
InstallAwareLog = false
# Activate Alteryx during installation
ActivateOnInstall = true
# Activate Alteryx during upgrade
ActivateOnUpgrade = true

[License]
# Licensing system URL
Expand Down
38 changes: 28 additions & 10 deletions powershell/Install-Alteryx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Install-Alteryx {
File name: Install-Alteryx.ps1
Author: Florian Carrier
Creation date: 2021-07-05
Last modified: 2021-11-20
Last modified: 2021-12-08
.LINK
https://www.powershellgallery.com/packages/PSAYX
Expand Down Expand Up @@ -87,9 +87,17 @@ function Install-Alteryx {
if (Test-Path -Path $ServerPath) {
if ($Properties.InstallAwareLog -eq $true) {
$InstallAwareLog = Join-Path -Path $Properties.LogDirectory -ChildPath "${ISOTimeStamp}_${ServerFileName}.log"
$ServerInstall = Install-AlteryxServer -Path $ServerPath -InstallDirectory $Properties.InstallationPath -Log $InstallAwareLog -Serial $Properties.LicenseEmail -Language $Properties.Language -AllUsers -Unattended:$Unattended
if ($null -eq $Properties.LicenseEmail -Or $Properties.LicenseEmail -eq "") {
$ServerInstall = Install-AlteryxServer -Path $ServerPath -InstallDirectory $Properties.InstallationPath -Log $InstallAwareLog -Language $Properties.Language -AllUsers -Unattended:$Unattended
} else {
$ServerInstall = Install-AlteryxServer -Path $ServerPath -InstallDirectory $Properties.InstallationPath -Log $InstallAwareLog -Serial $Properties.LicenseEmail -Language $Properties.Language -AllUsers -Unattended:$Unattended
}
} else {
$ServerInstall = Install-AlteryxServer -Path $ServerPath -InstallDirectory $Properties.InstallationPath -Serial $Properties.LicenseEmail -Language $Properties.Language -AllUsers -Unattended:$Unattended
if ($null -eq $Properties.LicenseEmail -Or $Properties.LicenseEmail -eq "") {
$ServerInstall = Install-AlteryxServer -Path $ServerPath -InstallDirectory $Properties.InstallationPath -Language $Properties.Language -AllUsers -Unattended:$Unattended
} else {
$ServerInstall = Install-AlteryxServer -Path $ServerPath -InstallDirectory $Properties.InstallationPath -Serial $Properties.LicenseEmail -Language $Properties.Language -AllUsers -Unattended:$Unattended
}
}
Write-Log -Type "DEBUG" -Message $ServerInstall
if ($ServerInstall.ExitCode -eq 0) {
Expand All @@ -99,7 +107,8 @@ function Install-Alteryx {
}
} else {
Write-Log -Type "ERROR" -Message "Path not found $ServerPath"
Write-Log -Type "ERROR" -Message "Alteryx $($InstallationProperties.Product) installation file could not be located" -ExitCode 1
Write-Log -Type "ERROR" -Message "Alteryx $($InstallationProperties.Product) installation file could not be located"
Write-Log -Type "WARN" -Message "Alteryx installation failed" -ExitCode 1
}
}
# Configuration
Expand Down Expand Up @@ -139,7 +148,8 @@ function Install-Alteryx {
}
} else {
Write-Log -Type "ERROR" -Message "Path not found $RPath"
Write-Log -Type "ERROR" -Message "Predictive Tools installation file could not be located" -ExitCode 1
Write-Log -Type "ERROR" -Message "Predictive Tools installation file could not be located"
Write-Log -Type "WARN" -Message "Predictive Tools installation failed" -ExitCode 1
}
}
}
Expand All @@ -164,7 +174,8 @@ function Install-Alteryx {
}
} else {
Write-Log -Type "ERROR" -Message "Path not found $AISPath"
Write-Log -Type "ERROR" -Message "Alteryx Intelligence Suite installation file could not be located" -ExitCode 1
Write-Log -Type "ERROR" -Message "Intelligence Suite installation file could not be located"
Write-Log -Type "WARN" -Message "Intelligence Suite installation failed" -ExitCode 1
}
}
}
Expand All @@ -179,7 +190,8 @@ function Install-Alteryx {
$DataPackageLog = Join-Path -Path $Properties.LogDirectory -ChildPath "${ISOTimeStamp}_${DataPackage}.log"
if (-Not (Test-Path -Path $DataPackagePath)) {
Write-Log -Type "ERROR" -Message "Path not found $DataPackagePath"
Write-Log -Type "ERROR" -Message "Data package could not be located" -ExitCode 1
Write-Log -Type "ERROR" -Message "Data package could not be located"
Write-Log -Type "WARN" -Message "Data package installation failed" -ExitCode 1
}
# Unzip data package
$Destination = $DataPackagePath.Replace('.7z', '')
Expand All @@ -195,7 +207,8 @@ function Install-Alteryx {
}
} else {
Write-Log -Type "ERROR" -Message "Path not found $($Properties.'7zipPath')"
Write-Log -Type "ERROR" -Message "7zip could not be located" -ExitCode 1
Write-Log -Type "ERROR" -Message "7zip could not be located"
Write-Log -Type "WARN" -Message "Data package installation failed" -ExitCode 1
}
# ! TODO check unzip
Write-Log -Type "DEBUG" -Message $Unzip
Expand All @@ -209,7 +222,8 @@ function Install-Alteryx {
}
} else {
Write-Log -Type "ERROR" -Message "Path not found $Destination"
Write-Log -Type "ERROR" -Message "Data package unzipping failed" -ExitCode 1
Write-Log -Type "ERROR" -Message "Data package unzipping failed"
Write-Log -Type "WARN" -Message "Data package installation failed" -ExitCode 1
}
} else {
Write-Log -Type "DEBUG" -Message "No data package specified"
Expand All @@ -218,7 +232,11 @@ function Install-Alteryx {
# ------------------------------------------------------------------------------
# Licensing
# ------------------------------------------------------------------------------
Invoke-ActivateAlteryx -Properties $Properties -Unattended:$Unattended
if ($Properties.ActivateOnInstall -eq $true) {
Invoke-ActivateAlteryx -Properties $Properties -Unattended:$Unattended
} else {
Write-Log -Type "WARN" -Message "Skipping license activation"
}
}
End {
Write-Log -Type "CHECK" -Message "Alteryx $($InstallationProperties.Product) $($Properties.Version) installed successfully"
Expand Down
51 changes: 36 additions & 15 deletions powershell/Invoke-ActivateAlteryx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Invoke-ActivateAlteryx {
File name: Invoke-ActivateAlteryx.ps1
Author: Florian Carrier
Creation date: 2021-07-05
Last modified: 2021-11-21
Last modified: 2021-12-09
.LINK
https://www.powershellgallery.com/packages/PSAYX
Expand Down Expand Up @@ -56,30 +56,44 @@ function Invoke-ActivateAlteryx {
if ((Test-HTTPStatus -URI $Properties.LicensingURL) -eq $true) {
# Check license key(s)
if (-Not (Find-Key -Hashtable $Properties -Key "LicenseKey")) {
# Check license file
if ($null -eq $Properties.LicenseFile -Or $Properties.LicenseFile -eq "") {
Write-Log -Type "ERROR" -Message "No license key or file have been specified"
Write-Log -Type "WARN" -Message "Alteryx product activation failed" -ExitCode 1
}
# Read keys from license file
if (Test-Object -Path $Properties.LicenseFile -NotFound) {
Write-Log -Type "ERROR" -Message "License file path not found $($Properties.LicenseFile)" -ExitCode 1
Write-Log -Type "ERROR" -Message "License file path not found $($Properties.LicenseFile)"
Write-Log -Type "WARN" -Message "Alteryx product activation failed" -ExitCode 1
}
$Properties.LicenseKey = @(Get-Content -Path $Properties.LicenseFile)
}
# Count keys
if ($Properties.LicenseKey.Count -gt 1) {
$Success = "$($Properties.LicenseKey.Count) licenses were successfully activated"
$Failure = "Licenses could not be activated"
$Grammar = "licenses"
$Properties.LicenseKey = $Properties.LicenseKey -join " "
} elseif ($Properties.LicenseKey.Count -eq 1) {
$Success = "$($Properties.LicenseKey.Count) license was successfully activated"
$Failure = "License could not be activated"
$Grammar = "license"
} else {
Write-Log -Type "ERROR" -Message "No license key was provided" -ExitCode 1
Write-Log -Type "ERROR" -Message "No license key was provided"
Write-Log -Type "WARN" -Message "Alteryx product activation failed" -ExitCode 1
}
# Check email address
if ($null -eq $Properties.LicenseEmail) {
if ($null -eq $Properties.LicenseEmail -Or $Properties.LicenseEmail -eq "") {
if ($Unattended) {
Write-Log -Type "ERROR" -Message "No email address provided for license activation"
Write-Log -Type "WARN" -Message "Retrieving email address associated with current session through Windows Active Directory"
$Email = Get-ADUser -Identity $env:UserName -Properties "mail" | Select-Object -ExpandProperty "mail"
Write-Log -Type "DEBUG" -Message $Email
try {
$Email = Get-ADUser -Identity $env:UserName -Properties "mail" | Select-Object -ExpandProperty "mail"
Write-Log -Type "DEBUG" -Message $Email
} catch {
Write-Log -Type "ERROR" -Message $Error[0].Exception
$Email = $null
}
} else {
# Prompt for email address and validate format
do {
Expand All @@ -89,19 +103,26 @@ function Invoke-ActivateAlteryx {
} else {
$Email = $Properties.LicenseEmail
}
# Call license utility
$Activation = Add-AlteryxLicense -Path $LicenseUtility -Key $Properties.LicenseKey -Email $Email
# Check activation status
if (Select-String -InputObject $Activation -Pattern "License(s) successfully activated." -SimpleMatch -Quiet) {
Write-Log -Type "CHECK" -Message $Success
# TODO check email format
if ($Email -as [System.Net.Mail.MailAddress]) {
# Call license utility
Write-Log -Type "INFO" -Message "Activating $Grammar"
$Activation = Add-AlteryxLicense -Path $LicenseUtility -Key $Properties.LicenseKey -Email $Email
# Check activation status
if (Select-String -InputObject $Activation -Pattern "License(s) successfully activated." -SimpleMatch -Quiet) {
Write-Log -Type "CHECK" -Message $Success
} else {
# Output error and stop script
Write-Log -Type "ERROR" -Message $Activation
Write-Log -Type "ERROR" -Message $Failure -ExitCode 1
}
} else {
# Output error and stop script
Write-Log -Type "ERROR" -Message $Activation
Write-Log -Type "ERROR" -Message $Failure -ExitCode 1
Write-Log -Type "ERROR" -Message "Email address is missing or invalid"
Write-Log -Type "WARN" -Message "Skipping product activation"
}
} else {
Write-Log -Type "ERROR" -Message "Unable to reach licensing system"
Write-Log -Type "WARN" -Message "Skipping license activation"
Write-Log -Type "WARN" -Message "Skipping product activation"
}
}
}
Expand Down
13 changes: 10 additions & 3 deletions powershell/Invoke-DeactivateAlteryx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Invoke-DeactivateAlteryx {
File name: Invoke-DeactivateAlteryx.ps1
Author: Florian Carrier
Creation date: 2021-11-20
Last modified: 2021-11-21
Last modified: 2021-12-08
.LINK
https://www.powershellgallery.com/packages/PSAYX
Expand Down Expand Up @@ -73,14 +73,21 @@ function Invoke-DeactivateAlteryx {
} else {
# Check license key(s)
if (-Not (Find-Key -Hashtable $Properties -Key "LicenseKey")) {
# Check license file
if ($null -eq $Properties.LicenseFile -Or $Properties.LicenseFile -eq "") {
Write-Log -Type "ERROR" -Message "No license key or file have been specified"
Write-Log -Type "WARN" -Message "Alteryx product deactivation failed" -ExitCode 1
}
# Read keys from license file
if (Test-Object -Path $Properties.LicenseFile -NotFound) {
Write-Log -Type "ERROR" -Message "License file path not found $($Properties.LicenseFile)" -ExitCode 1
Write-Log -Type "ERROR" -Message "License file path not found $($Properties.LicenseFile)"
Write-Log -Type "WARN" -Message "Alteryx product deactivation failed" -ExitCode 1
}
$Properties.LicenseKey = @(Get-Content -Path $Properties.LicenseFile)
}
if ($Properties.LicenseKey.Count -eq 0) {
Write-Log -Type "ERROR" -Message "No license key was provided" -ExitCode 1
Write-Log -Type "ERROR" -Message "No license key was provided"
Write-Log -Type "WARN" -Message "Alteryx product deactivation failed" -ExitCode 1
}
# Deactivate each key
$Count = 0
Expand Down
Loading

0 comments on commit d1119dd

Please sign in to comment.