Rake tasks to help with uniform handling of yast modules. It provides setup for packaging tasks and add yast specific tasks.
Create Rakefile with content:
Now lets check what it provides with
Update the latest part of version in spec file.
Runs all RSpec tests ending with _spec.rb or _test.rb.
.rspec_parallel file exists then the tests are executed using the
parallel_rspec command which runs the tests in parallel using all available
CPUs, otherwise the standard RSpec is used.
It is possible to override this behavior via the
variable. Set it to
1 to run the tests in parallel or set it to
to use the standard RSpec with a single process.
You can pass additional
parallel_rspec command options via the
PARALLEL_TESTS_OPTIONS environment. E.g. you might choose to use only the
half of the available CPUs with
PARALLEL_TESTS_OPTIONS="-m 0.5" option
or use just 4 CPUs with the
PARALLEL_TESTS_OPTIONS="-n 4" option.
See the parallel_tests documentation
for more details.
Runs client with paths leading to git. Useful to testing module without installation. If the client is not specified it starts the client with the shortest name.
run[client] above, but the client is started in a Docker container.
The container is automatically removed after the client exits. If you want to
keep the container running use the
rake run:container KEEP_CONTAINER=1
The used Docker image is extracted from the GitHub Actions configuration. If there is no configuration or there are used multiple images then you can set the Docker image explicitly:
rake run:container DOCKER_IMAGE=<image>
Note: The Docker environment is quite different than in usually installed Linux systems (no services running, no systemd, no boot loader, no hardware access,...) so not all YaST modules can work properly there. Or there might be missing dependencies so YaST might report errors or even crash.
Runs ruby console (irb) with paths leading to git and YaST environment.
Collect translatable strings and create
Check for common mistakes in translated texts.
Runs the Rubocop checker in parallel processes to speed up the check.
The additional parameters to Rubocop can be passed via the
check:rubocop above, additionally it passes the auto correct
parameter to Rubocop to try fixing the found issues (it is equivalent to
Checks spelling in
*.html files. It uses a global custom dictionary
lib/tasks/spell.dict in this repository) and supports repository specific
spell.dict file in the repository root directory).
Note: You need to explicitly install
packages and the
raspell Ruby gem. (The reason is to decrease the dependencies
for the packages which do not use this task.)
These commands should work:
sudo zypper in aspell-devel aspell-en ruby-devel sudo gem install raspell
Runs a simple web server which provides a dynamically generated tarball with
the source code. The web server is designed to serve the source tarballs for
script which can easily update the YaST code in the installation system.
That script downloads a source tarball from GitHub, to make it work also with your local Git checkout we need to implement a compatible HTTP tarball provider.
By default the web server runs on port 8000, if that port is already used it tries using port 8001 and so on until a free port is found. This allows starting several servers in parallel easily.
If you need to use a different port you can pass it as an optional argument:
To install the files in a running installation run
yupdate patch my_machine.example.com:8000
To allow accessing the web server from other machines you need to open the appropriate port in the firewall configuration. You can open some more spare ports just in case you need to run several servers in parallel in the future.
Open ports permanently (activated after reboot):
firewall-cmd --permanent --zone=public --add-port=8000-8005/tcp
Open ports (activated immediately):
firewall-cmd --zone=public --add-port=8000-8005/tcp
Note: If you want to open the ports now and keep them open also after reboot you need to run both commands.
Checking the current firewall configuration:
To stop the server press the Ctrl+C key combination.
Print the defined GitHub Action jobs. The jobs are listed in a form of
commands which can be used to start them locally.
Print the details of the defined GitHub Action jobs.
Run the specified GitHub Action job or all jobs locally. It runs all jobs if
job argument is missing. In that case the unsupported jobs are
automatically skipped, if the specified job is not supported an error is reported.
Notes to GitHub Actions
If you need support for more Actions features then check the
act tool. (Hints:
zypper install go,
The used Docker container is automatically removed after the job is finished.
If you want to keep the container running use the
rake actions:run[<action>] KEEP_CONTAINER=1
The rake task then prints some hints how to connect to the running container. The container needs to be stopped and removed manually.
The used Docker image is extracted from the GitHub Actions configuration.
You can override the image name with the
rake actions:run[<action>] DOCKER_IMAGE=<image>
DOCKER_IMAGE option can be used for running all jobs only if all of them
use the same Docker image. If more than one image is used then it is very
unlikely that all jobs will work with the same custom image.
If you are sure that the same image can be used then the workaround is to run the jobs manually one by one.
Yast::Tasks provides a method to change the configuration of the packaging
tasks. As it's just a proxy for
::Packaging.configuration, the same options
Yast::Tasks.configuration do |conf| conf.obs_api = "https://api.opensuse.org/" conf.obs_project = "YaST:openSUSE:42.1" end
To avoid duplication, Yast::Tasks also provides a method to set the whole configuration at once, just specifying the name of one of the available target definitions. For example, if you want to submit to SLE 12 Service Pack 1, you can do:
This method can receive, as a second parameter, the path to your own definitions if needed.
submit_to is not explicitly used, it will be read from the environment
YAST_SUBMIT. If that variable is not set,
:factory will be used.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
This package is licensed under LGPL-2.1.