Hello World

File obs_example.obscpio of Package build

07070100000000000081a400000000000000000000000163e504ba0000031c000000000000000000000000000000000000001700000000obs_example/DockerfileFROM opensuse/tumbleweed AS tw

# debug
RUN cat /etc/os-release

FROM opensuse/leap:15.2
# Make obs_pkg_mgr available
ARG OBS_REPOSITORY_URL
ADD obs_pkg_mgr /usr/bin/obs_pkg_mgr
RUN chmod +x /usr/bin/obs_pkg_mgr

RUN obs_pkg_mgr add_repo http://download.opensuse.org/repositories/Virtualization:/containers/openSUSE_Leap_15.2/ "Virtualization:Containers (openSUSE_Leap_15.2)" && ls ; obs_pkg_mgr add_repo http://example.com/my_project:/mysubproject/my_package/ "My example project" && ls

RUN obs_pkg_mgr install util-linux calcurse # amarok
RUN obs_pkg_mgr install awk gcc \
  which

RUN ls # irrelevant command before additional dependencies

RUN obs_pkg_mgr install glibc \
  file-magic && ls ; ls -la ; obs_pkg_mgr install nethogs

RUN obs_pkg_mgr install ssh-contact dumb-init; ls && ls -la
07070100000001000081a400000000000000000000000163e504ba00000118000000000000000000000000000000000000002500000000obs_example/fissile_example_spec.ymlName: "uaa-fissile-package"
Version: 0.0
Release: 0
Summary: This package generates docker images for uaa-fissile-release
License: [TBD]
Description: "This is a very long description"
DockerImageDeps:
  - "fissile-dev:201707081450"
Build: "./build"
Artifacts:
  - ".bosh/cache/*"
07070100000002000081ed00000000000000000000000163e504ba00000563000000000000000000000000000000000000001800000000obs_example/obs_pkg_mgr#!/bin/bash
VERSION="0.1"
DESCRIPTION="Command/Subcommand line script template"

usage() {
  echo "Usage: $0 (install|add_repo) args" 1>&2; exit 1;
}
function disable_repos {
  # Disable all repos
  for repo in "${repos[@]}"; do
    zypper modifyrepo -d $repo
  done

  # Add OBS repository
  zypper ar $OBS_REPOSITORY_URL obs_repository
}

function enable_repos {
  # Remove our obs repository
  zypper rr obs_repository

  # Enable all repos
  for repo in "${repos[@]}"; do
    zypper modifyrepo -e $repo
  done
}

install() {
  shift # remove the subcommand

  # Get enables repos and store them so we can enable them in the end.
  readarray -t repos <<< "$(zypper ls -E | grep "Yes" | awk '{print $1}' )"

  [ ! -z "$OBS_REPOSITORY_URL" ] && disable_repos

  zypper ref
  # TODO: use the "-r" option to avoid disabling/enabling repos
  zypper --no-gpg-checks -n in "$@"

  [ ! -z "$OBS_REPOSITORY_URL" ] && enable_repos
}

# Currently only this format is supported:
# obs_pkg_mgr add_repo <URI> <alias>
# obs_pkg_mgr add_repo <URI> <alias>
add_repo() {
  shift # remove the subcommand

  # No need to refresh the repo if we are inside OBS
  if [ ! -z "$OBS_REPOSITORY_URL" ]; then
    zypper ar -C -G "$@"
  else
    zypper ar -G "$@"
  fi
}

case "$1" in
  install)
    install "$@"
    ;;
  add_repo)
    add_repo "$@"
    ;;
  *)
    usage
    exit 1
    ;;
esac

exit 0;
07070100000003000041ed00000000000000000000000163e504ba00000000000000000000000000000000000000000000000c00000000obs_example07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!