image: buildstream/buildstream-fedora:latest variables: YBD_base: "/cache/ybd_base" YBD_gits: "/cache/ybd_base/gits" cache: paths: - "${YBD_gits}/" before_script: # Work around https://github.com/fedora-cloud/docker-brew-fedora/issues/14 - export LANG="C.UTF-8" - export LC_ALL="C.UTF-8" # Update to latest BuildStream - | cd ~/buildstream git pull origin master dnf install -y python3-pip pip3 install . cd - # Store cache in the shared Docker volume - export XDG_CACHE_HOME=/cache # Create ~/.ssh for storing keys - mkdir -p ~/.ssh # Private key stored as a protected variable that allows pushing to # ostree@ostree.baserock.org - | if [ -z "$baserock_ostree_cache_private_key" ]; then echo >&2 "Private key for ostree.baserock.org is not available." else echo "$baserock_ostree_cache_private_key" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub fi # Trust the host key of the cache server. - ssh-keyscan -p 22200 ostree.baserock.org >> ~/.ssh/known_hosts # Enable push and pull for Baserock artifact cache - | mkdir -p ~/.config echo "artifacts:" > ~/.config/buildstream.conf echo " pull-url: https://ostree.baserock.org/cache/" >> ~/.config/buildstream.conf if [ -n "$baserock_ostree_cache_private_key" ]; then echo " push-url: ostree@ostree.baserock.org:cache" >> ~/.config/buildstream.conf echo " push-port: 22200" >> ~/.config/buildstream.conf fi cat ~/.config/buildstream.conf # Install and configure YBD - | export LC_ALL="C.UTF-8" export CI_YBD_BRANCH=`[[ "$CI_BUILD_REF_NAME" =~ ^staging/fromybd/ ]] && echo -b ${CI_BUILD_REF_NAME#staging/fromybd/}` git clone https://gitlab.com/baserock/spec.git git clone https://gitlab.com/baserock/ybd.git $CI_YBD_BRANCH cd ybd && ./install_dependencies.sh && cd .. pip install -r spec/requirements.txt stages: - preprocess - build-1 - deploy-1 - build-2 - build-3 ybd-validate-all-definitions: stage: preprocess script: - python spec/quick_check.py . ybd-gnome-build-64: stage: build-1 script: - ybd/ybd.py gnome/systems/gnome-system-x86_64.morph x86_64 - ybd/ybd.py systems/initramfs-x86_64.morph x86_64 ########################################## # BuildStream conversions and tests # ########################################## # Convert the Baserock definitions to BuildStream format bst-convert: stage: preprocess script: # Install YBD and defs2bst - | if [ ! -d ./ybd ]; then git clone https://gitlab.com/baserock/ybd.git cd ybd && ./install_dependencies.sh && cd - ]; fi git clone https://gitlab.com/BuildStream/defs2bst.git echo "defs2bst version: $(git -C ./defs2bst rev-parse HEAD)" - ./convert artifacts: paths: - elements/ bst-build-gnome-system: stage: build-1 script: - scripts/bst-build-or-show systems/gnome-system-content.bst