Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Ubuntu18 support #185

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ wbi is a CLI tool aimed at streamlining the installation and configuration of Po

### Apt Install

To install wbi on Ubuntu 18.04, 20.04 or 22.04 using apt install:
To install wbi on Ubuntu 22.04 or 20.04 using apt install:
```
echo "deb [trusted=yes] https://apt.fury.io/wbi/ /" | sudo tee -a /etc/apt/sources.list.d/fury.list && sudo apt update && sudo apt install wbi

Expand All @@ -17,7 +17,7 @@ sudo wbi setup

### Yum Install

To install wbi on RHEL 7/CentOS 7, RHEL 8 or RHEL 9 using yum install:
To install wbi on RHEL 7/CentOS 7, RHEL 8/CentOS 8 or RHEL 9/CentOS 9 using yum install:
```
sudo tee -a /etc/yum.repos.d/fury.repo > /dev/null <<EOT
[fury]
Expand All @@ -42,12 +42,11 @@ Visit the [release page](https://github.com/sol-eng/wbi/releases) to find instal
- Internet access (online installation)

## Supported Operating Systems
- RHEL 9
- RHEL 8
- RHEL 9/CentOS 9
- RHEL 8/CentOS 8
- RHEL 7/CentOS 7
- Ubuntu 22.04
- Ubuntu 20.04
- Ubuntu 18.04

## Usage

Expand Down
2 changes: 1 addition & 1 deletion cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func newSetup(setupOpts setupOpts) error {

var adDocURL string
switch osType {
case config.Ubuntu18, config.Ubuntu20, config.Ubuntu22:
case config.Ubuntu20, config.Ubuntu22:
adDocURL = "https://support.posit.co/hc/en-us/articles/360024137174-Integrating-Ubuntu-with-Active-Directory-for-RStudio-Workbench-RStudio-Server-Pro"
case config.Redhat7, config.Redhat8, config.Redhat9:
adDocURL = "https://support.posit.co/hc/en-us/articles/360016587973-Integrating-RStudio-Workbench-RStudio-Server-Pro-with-Active-Directory-using-CentOS-RHEL"
Expand Down
3 changes: 0 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ type OperatingSystem int

const (
Unknown OperatingSystem = iota
Ubuntu18
Ubuntu20
Ubuntu22
Redhat7
Expand All @@ -14,8 +13,6 @@ const (

func (os OperatingSystem) ToString() string {
switch os {
case Ubuntu18:
return "Ubuntu 18"
case Ubuntu20:
return "Ubuntu 20"
case Ubuntu22:
Expand Down
2 changes: 1 addition & 1 deletion internal/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func InstallLanguage(language string, filepath string, osType config.OperatingSy
// Creates the proper command to install R/Python based on the operating system
func RetrieveInstallCommand(filepath string, osType config.OperatingSystem) (string, error) {
switch osType {
case config.Ubuntu22, config.Ubuntu20, config.Ubuntu18:
case config.Ubuntu22, config.Ubuntu20:
return "DEBIAN_FRONTEND=noninteractive gdebi -n " + filepath, nil
case config.Redhat7, config.Redhat8, config.Redhat9:
return "yum install -y " + filepath, nil
Expand Down
6 changes: 0 additions & 6 deletions internal/languages/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ type InstallerInfo struct {

func PopulateInstallerInfo(language string, version string, osType config.OperatingSystem) (InstallerInfo, error) {
switch osType {
case config.Ubuntu18:
return InstallerInfo{
Name: language + "-" + version + "_1_amd64.deb",
URL: "https://cdn.rstudio.com/" + language + "/ubuntu-1804/pkgs/" + language + "-" + version + "_1_amd64.deb",
Version: version,
}, nil
case config.Ubuntu20:
return InstallerInfo{
Name: language + "-" + version + "_1_amd64.deb",
Expand Down
2 changes: 0 additions & 2 deletions internal/logging/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ func DetectOS() (config.OperatingSystem, error) {
return config.Ubuntu22, nil
} else if strings.Contains(string(releaseVersionUbuntu), "Ubuntu 20") {
return config.Ubuntu20, nil
} else if strings.Contains(string(releaseVersionUbuntu), "Ubuntu 18") {
return config.Ubuntu18, nil
} else {
return config.Unknown, errors.New("unsupported operating system")
}
Expand Down
2 changes: 0 additions & 2 deletions internal/operatingsystem/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ func DetectOS() (config.OperatingSystem, error) {
return config.Ubuntu22, nil
} else if strings.Contains(string(releaseVersionUbuntu), "Ubuntu 20") {
return config.Ubuntu20, nil
} else if strings.Contains(string(releaseVersionUbuntu), "Ubuntu 18") {
return config.Ubuntu18, nil
} else {
return config.Unknown, errors.New("unsupported operating system")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/operatingsystem/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func InstallPrereqs(osType config.OperatingSystem) error {
system.PrintAndLogInfo("Installing prerequisites...")
// Update apt and install gdebi-core if an Ubuntu system
if osType == config.Ubuntu22 || osType == config.Ubuntu20 || osType == config.Ubuntu18 {
if osType == config.Ubuntu22 || osType == config.Ubuntu20 {
AptErr := UpgradeApt()
if AptErr != nil {
return fmt.Errorf("UpgradeApt: %w", AptErr)
Expand Down Expand Up @@ -207,7 +207,7 @@ func DisableFirewall(osType config.OperatingSystem) error {
var FWCommand string

switch osType {
case config.Ubuntu18, config.Ubuntu20, config.Ubuntu22:
case config.Ubuntu20, config.Ubuntu22:
FWCommand = "ufw disable"
case config.Redhat7, config.Redhat8, config.Redhat9:
FWCommand = "systemctl stop firewalld && systemctl disable firewalld"
Expand Down
2 changes: 0 additions & 2 deletions internal/packagemanager/construct.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ func BuildPublicPackageManagerFullURL(osType config.OperatingSystem) (string, er
func ConvertOSTypeToOSName(osType config.OperatingSystem) (string, error) {
var osName string
switch osType {
case config.Ubuntu18:
osName = "bionic"
case config.Ubuntu20:
osName = "focal"
case config.Ubuntu22:
Expand Down
4 changes: 2 additions & 2 deletions internal/prodrivers/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func InstallProDrivers(filepath string, osType config.OperatingSystem) error {
func (pd *ProDrivers) GetInstallerInfo(osType config.OperatingSystem) (InstallerInfo, error) {
switch osType {
// Posit Pro Drivers are the same for all Ubuntu versions
case config.Ubuntu18, config.Ubuntu20, config.Ubuntu22:
case config.Ubuntu20, config.Ubuntu22:
return pd.ProDrivers.Installer.Focal, nil
case config.Redhat7:
return pd.ProDrivers.Installer.Redhat7, nil
Expand Down Expand Up @@ -147,7 +147,7 @@ func RetrieveProDriversInstallerInfo() (ProDrivers, error) {

// Installs unixODBC and unixODBC-devel
func InstallUnixODBC(osType config.OperatingSystem) error {
if osType == config.Ubuntu22 || osType == config.Ubuntu20 || osType == config.Ubuntu18 {
if osType == config.Ubuntu22 || osType == config.Ubuntu20 {
prereqCommand := "apt-get -y install unixodbc unixodbc-dev"
err := system.RunCommand(prereqCommand, true, 1, true)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/ssl/trust.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TrustRootCertificate(rootCA *x509.Certificate, osType config.OperatingSyste
var pemCert []string
pemCert = append(pemCert, string(pem.EncodeToMemory(&block)))
switch osType {
case config.Ubuntu18, config.Ubuntu20, config.Ubuntu22:
case config.Ubuntu20, config.Ubuntu22:
err := system.WriteStrings(pemCert, "/usr/local/share/ca-certificates/workbenchCA.crt", 0755, true, true)
if err != nil {
return fmt.Errorf("writing certificate to disk failed: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions internal/workbench/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func InstallWorkbench(filepath string, osType config.OperatingSystem) error {
// Creates the proper command to install Workbench based on the operating system
func RetrieveInstallCommandForWorkbench(filepath string, osType config.OperatingSystem) (string, error) {
switch osType {
case config.Ubuntu22, config.Ubuntu20, config.Ubuntu18:
case config.Ubuntu22, config.Ubuntu20:
return "DEBIAN_FRONTEND=noninteractive gdebi -n " + filepath, nil
case config.Redhat7, config.Redhat8, config.Redhat9:
return "yum install -y " + filepath, nil
Expand All @@ -119,7 +119,7 @@ func RetrieveInstallCommandForWorkbench(filepath string, osType config.Operating
// Pulls out the installer information from the JSON data based on the operating system
func (r *RStudio) GetInstallerInfo(osType config.OperatingSystem) (InstallerInfo, error) {
switch osType {
case config.Ubuntu18, config.Ubuntu20:
case config.Ubuntu20:
return r.Rstudio.Pro.Stable.Server.Installer.Focal, nil
case config.Ubuntu22:
return r.Rstudio.Pro.Stable.Server.Installer.Jammy, nil
Expand Down