Skip to content
Victor Pereira edited this page Sep 24, 2019 · 5 revisions

OSC

osc is the command line tool to communicate with OBS.

Tips & Tricks

Aliases

Because we have several OBS instances, most people maintain several aliases to communicate with the correct OBS instance:

# in .alias
# Internal osc build.suse.de
alias iosc='osc -A iosc'
# Development osc localhost:3000
alias dosc='osc -A dosc'
# in .oscrc
[https://api.suse.de]
aliases = iosc
user = cbruckmayer

[http://localhost:3000]
aliases = dosc
user = Admin
pass = opensuse
#user= Iggy
#pass= opensuse

Review apps

You can communicate with the review apps like this:

osc -A https://obs-reviewlab.opensuse.org/vpereira-binaries_bootstrap/ api about

where https://obs-reviewlab.opensuse.org/vpereira-binaries_bootstrap/ is the URL of the review-app. It is important to use https, otherwise you will get a 301 (Redirection) which prevents you from doing anything but a GET.

Settings

There are some handy settings you should do in your .oscrc:

# Installs these packages additionally in your build environment
# Comes handy for debugging
extra-pkgs = vim gdb strace grep

Copy package from public OBS instance to development instance

# Make sure that your username is configured in osc for your development instance
osc copypac openSUSE:Factory PACKAGE_NAME --to-apiurl=http://localhost:3000 LOCAL_PROJECT

# Example copying package `hello` from remote project `openSUSE:Factory` to local project `home:Admin`
osc copypac openSUSE:Factory hello --to-apiurl=http://localhost:3000 home:Admin

Create an announcement

If you want to create an announcement, which the users must accept (i.e EULA), you have to do it via osc.

dosc api -X POST -d '<announcement><title>foo</title><content>bar</content></announcement>' /announcements
Clone this wiki locally