Skip to content

Commit

Permalink
Initial public release (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Mar 28, 2022
1 parent 5dd74e9 commit 5a939cf
Show file tree
Hide file tree
Showing 22 changed files with 1,220 additions and 2 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

name: CI

on: [push, pull_request]

jobs:
Tests:
runs-on: ubuntu-latest
container:
image: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Install Dependencies
run: rake build_dependencies:install

# just for easier debugging...
- name: Inspect Installed Packages
run: rpm -qa | sort

- name: Unit Tests
run: rake test:unit
# enable code coverage reporting
env:
COVERAGE: 1

# send the coverage report to coveralls.io
- name: Coveralls Report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

Rubocop:
runs-on: ubuntu-latest
container:
image: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Rubocop
run: rake check:rubocop

Package:
runs-on: ubuntu-latest
container:
image: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Package Build
run: yast-ci-ruby -o package

Yardoc:
runs-on: ubuntu-latest
container:
image: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Yardoc
run: rake check:doc

# downloading the Docker image takes some time so bundling several fast
# checks into one job avoids that overhead
Checks:
runs-on: ubuntu-latest
container:
image: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: POT Check
run: rake check:pot
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/doc/autodocs
/.yardoc
/coverage
*.bz2
*.pot
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--color --format doc
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# use the shared Yast defaults
inherit_from:
/usr/share/YaST2/data/devtools/data/rubocop-1.24.1_yast_style.yml

# this needs more testing if we can have frozen string literals
Style/FrozenStringLiteralComment:
Enabled: false
7 changes: 7 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--no-private
--markup markdown
--protected
--readme README.md
--output-dir ./doc/autodocs
--files *.md
src/**/*.rb
3 changes: 1 addition & 2 deletions LICENSE → COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ the "copyright" line and a pointer to where the full notice is found.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
Expand Down
117 changes: 117 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# YaST SLE Migration Module

[![Workflow Status](https://github.com/yast/yast-migration-sle/workflows/CI/badge.svg?branch=master)](
https://github.com/yast/yast-migration-sle/actions?query=branch%3Amaster)
[![Jenkins Status](https://ci.opensuse.org/buildStatus/icon?job=yast-yast-migration-sle-master)](
https://ci.opensuse.org/view/Yast/job/yast-yast-migration-sle-master/)
[![Coverage Status](https://img.shields.io/coveralls/yast/yast-migration-sle.svg)](https://coveralls.io/r/yast/yast-migration-sle?branch=master)

![registration dialog](doc/registration_dialog.png)

## Description

This YaST module allows online migration from the openSUSE Leap distribution to
the SUSE Linux Enterprise (SLE) product. The migration is done in a live
running system.

It uses the [yast2-registration](https://github.com/yast/yast-registration) and
[yast2-migration](https://github.com/yast/yast-migration) modules as the backend.
That means it provides the very same functionality which can be done using these
two modules but in a simplified way.

For migrating to SLES you need a SLES registration key, see https://www.suse.com/support/
how to obtain it. You can create a 60-day trial activation code at
https://www.suse.com/download/sles/ (you need to have a SUSE account for that).

### Features

- Simplified workflow for migrating openSUSE Leap installations
to SUSE Linux Enterprise (SLE) product
- Can register against [SUSE Customer Service](https://scc.suse.com/) (SCC)
server or any local [RMT](https://github.com/SUSE/rmt) or SMT server
- Supports [rollback](#rollback) when the migration fails or is aborted
- Because openSUSE Leap shares many packages with SLE the migration should
usually install just few packages, it should not completely reinstall the system

### Workflow

1. Online update check - at the beginning the module checks whether there is
an update for software stack and asks to install it. This should ensure the
package installation later works fine. If an update for this module is needed
it should be marked as a software stack update as well.
2. Entering the registration data - the module asks for the e-mail address and
the SLE registration code, alternatively you can enter the address of the local
RMT/SMT server (email and registration code are not required in that case)
3. Registration - the system is registered to the registration server and
the openSUSE Leap repositories from the server are added into the system
4. Selecting a migration - if only one migration to a SLE product is available
then it is automatically selected, if there are multiple migrations a selection
dialog is displayed and the user needs to select the migration manually
5. Migration - the registration is then migrated to the selected SLE product and the
Leap repositories are changed to the SLE repositories
6. License agreement - displays the SLE product license and requires accepting it,
if the license is not accepted the migration is aborted (see the [rollback](
#rollback) section below)
7. Migration summary - the dialog displays the summary about the installed or
upgraded products and packages, if there is a package dependency problem
then it needs to be manually resolved before continuing
8. Package installation - the SLE packages are installed into the system, this can
take some time
9. Congratulation - a congratulation dialog is displayed to confirm a successful
migration
10. Reboot - it is recommended to manually reboot the system to ensure all changes
take effect

#### Rollback

When the migration fails or is aborted then YaST restores the original
repositories in the system and moves the registration from SLE back to openSUSE
Leap. However, the system still remains in a registered state.

If you want to fully unregister the system then run this command as `root`:

```shell
SUSEConnect --de-register
```

## Development

This module is developed as part of YaST. See the
[development documentation](http://yastgithubio.readthedocs.org/en/latest/development/).

### Getting the Sources

To get the source code, clone the GitHub repository:

```shell
git clone https://github.com/yast/yast-migration-sle.git
```

If you want to contribute into the project you can
[fork](https://help.github.com/articles/fork-a-repo/) the repository and clone your fork.


### Development Environment

The module is developed only for the openSUSE Leap product, the functionality
does not make sense for other products.

### Testing

You can run the module directly from the Git sources provided all dependencies
(esp. `yast2-registration` and `yast2-migration`) are installed in the system.

Just run this command:

```shell
# graphical mode (if available)
rake run
# force text mode
DISPLAY="" rake run
```

## Contact

If you have any question, feel free to ask at the [development mailing
list](http://lists.opensuse.org/yast-devel/) or at the
[#yast](https://web.libera.chat/#yast) IRC channel on libera.chat.
1 change: 1 addition & 0 deletions RPMNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yast2-migration-sle
32 changes: 32 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) [2022] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "yast/rake"

Yast::Tasks.configuration do |conf|
conf.skip_license_check << /\.desktop$/
conf.skip_license_check << /\.svg$/
conf.skip_license_check << /test/

# this package works only in openSUSE Leap, Tumbleweed or SLE is not supported
conf.obs_api = "https://api.opensuse.org"
conf.obs_target = "openSUSE_Leap_15.4"
conf.obs_sr_project = "openSUSE:Leap:15.4"
conf.obs_project = "YaST:openSUSE:15.4"
end
Binary file added doc/registration_dialog.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions package/yast2-migration-sle.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-------------------------------------------------------------------
Fri Mar 25 15:20:58 UTC 2022 - Ladislav Slezák <lslezak@suse.cz>

- Updated README
- Fixed starting the module from the control center
- Allow migration to SLED or other products if supported by SCC
- Added unit tests
- Fixed build problems
- First public release (related to jsc#SLE-17309)
- 4.4.0

-------------------------------------------------------------------
Tue Feb 22 07:35:42 UTC 2022 - Ladislav Slezák <lslezak@suse.cz>

- Initial version
- 4.4.0.pre1

72 changes: 72 additions & 0 deletions package/yast2-migration-sle.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# spec file for package yast2-migration-sle
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name: yast2-migration-sle
Version: 4.4.0
Release: 0
Summary: YaST2 - Online migration
Group: System/YaST
License: GPL-2.0-only
URL: https://github.com/yast/yast-migration-sle

Source0: %{name}-%{version}.tar.bz2

BuildRequires: update-desktop-files
BuildRequires: yast2
BuildRequires: yast2-buildtools
BuildRequires: yast2-ruby-bindings
BuildRequires: yast2-migration
BuildRequires: yast2-registration
BuildRequires: rubygem(%{rb_default_ruby_abi}:rspec)
BuildRequires: rubygem(%{rb_default_ruby_abi}:yast-rake)

Requires: yast2
Requires: yast2-migration
Requires: yast2-registration
Requires: yast2-ruby-bindings

Supplements: yast2-registration

BuildArch: noarch

%description
This package contains the YaST2 component for migrating an openSUSE Leap
system to the SUSE Linux Enterprise (SLE) system.

%prep
%setup -q

%check
%yast_check

%build

%install
%yast_install
%yast_metainfo

%files
%{yast_clientdir}
%{yast_libdir}
%{yast_desktopdir}
%{yast_metainfodir}
%{yast_icondir}
%license COPYING
%doc %{yast_docdir}

%changelog
22 changes: 22 additions & 0 deletions src/clients/migration_sle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) [2022] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "migration_sle/main_workflow"

MigrationSle::MainWorkflow.run

0 comments on commit 5a939cf

Please sign in to comment.