This project is used to store a docker container to upload new package updates to Open Build Service.
It uses a predefined oscrc file which has to be hacked by environment variables to update the user and password to give upload right to osc (OBS command line tool).
In order to use this delivery process some conditions are required:
- OBS project and package must already exist. The process won't create a package.
- .spec and .changes file should be added to the git project or a OBS _service file should be used. Otherwise current .spec and .changes from the OBS package will be used, but this is not recommended if you want a real CD pipeline.
- In case the git repository owns a .spec and the OBS package uses a _service file integration, the .spec file will be copied before the service update, applying the changes. The RPM version will still be calculated by the OBS service.
- Build process is not currently executed, so make sure the project builds locally (this feature might be added in the future).
- Package version will be obtained from "Version: " in the .spec file or calculated in case of the _service file is in use.
These steps must be followed to run the delivery operation:
- Pull the docker image. The image is currently stored in: https://github.com/trento-project/continuous-delivery/pkgs/container/continuous-delivery
docker pull ghcr.io/trento-project/continuous-delivery:main
- Set the environment variables. This is not mandatory but it will facilitate things:
export OBS_USER=my-user # my obs user name
export OBS_PASS=my-pass # my obs user password
export OBS_PROJECT=my-project # obs project
export PACKAGE_NAME=my-package # package name in obs project
Here other optional parameters:
export FOLDER=/package # used folder inside the docker container where our code is located
export TARGET_PROJECT=target-project # target project to create a submit request. If not set submission will b skipped
export TAR_NAME=my-tar # Custom tar name. Otherwise package name will be used
export CHANGESAUTHOR=myemail@company.com # email of the changes author.
- Run the docker container
docker run -t -v "$(pwd):/package" -e OBS_USER=$OBS_USER -e OBS_PASS=$OBS_PASS -e OBS_PROJECT=$OBS_PROJECT -e PACKAGE_NAME=$PACKAGE_NAME ghcr.io/trento-project/continuous-delivery:main /bin/bash -c "cd /package;/scripts/upload.sh"
docker run -t -v "$(pwd):/package" -e OBS_USER=$OBS_USER -e OBS_PASS=$OBS_PASS -e OBS_PROJECT=$OBS_PROJECT -e PACKAGE_NAME=$PACKAGE_NAME ghcr.io/trento-project/continuous-delivery:main /bin/bash -c "cd /package;/scripts/submit.sh"
FOLDER variable must match with the path used in the volume creation and last command execution
To contribute the project just update the project code and create a pull request. After merging the code the new docker image will be created automatically.
Copyright 2024 SUSE LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this code repository except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.