-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: create an osc container for package maintenance
- Loading branch information
Showing
4 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Packaging Container | ||
|
||
This is the openSUSE packaging container image, it includes all the necessary | ||
software to create and modify packages on the [Open Build | ||
Service](https://build.opensuse.org/) using | ||
[osc](https://github.com/openSUSE/osc/). | ||
|
||
|
||
## How to use this container image | ||
|
||
This container image is intended for interactive usage with your `.oscrc` | ||
mounted into the container: | ||
|
||
```ShellSession | ||
# podman run --rm -it -v ~/.config/osc/oscrc:/root/.config/osc/oscrc:Z \ | ||
{{ image.reference }} | ||
``` | ||
|
||
The above command launches an interactive shell where your local osc config will | ||
be used. You can then proceed to checkout packages, perform modifications and | ||
send submissions to OBS. | ||
|
||
You can also let the container image's entrypoint generate a `oscrc` for you | ||
using the environment variables `OSC_USER` and `OSC_PASSWORD`. It will create a | ||
configuration for the OBS instance with the API URL saved in the environment variable | ||
`OSC_APIURL` (defaults to api.opensuse.org): | ||
|
||
```ShellSession | ||
# podman run --rm -it -e OSC_USER=my_user -e OSC_PASSWORD=mySecretPassword \ | ||
{{ image.reference }} | ||
``` | ||
|
||
Note that you should disable your shell's history as it will otherwise container | ||
your password in plain text. | ||
|
||
|
||
## Limitations | ||
|
||
- It is currently not possible to build packages in a container. | ||
|
||
- Cannot communicate with build.suse.de | ||
|
||
|
||
## Volumes | ||
|
||
The container image is preconfigured to put `/var/tmp` into a volume. This | ||
directory is used by `osc` to store the buildroot and the package cache. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
if [ ! -f "$HOME/.config/osc/oscrc" ]; then | ||
mkdir -p "$HOME/.config/osc" | ||
if [ -z ${OSC_USER+x} ] && [ -z ${OSC_PASSWORD+y} ]; then | ||
echo "[general] | ||
apiurl = ${OSC_APIURL} | ||
[${OSC_APIURL}] | ||
user = ${OSC_USER} | ||
pass = ${OSC_PASSWORD} | ||
" > "$HOME/.config/osc/oscrc" | ||
fi | ||
fi | ||
|
||
exec "$@" |