Pyra pyra-builder: Docker based toolchain for pyra


sebt3

homebrew player (P. & C.)
Joined
Sep 9, 2008
Messages
4,886
Age
43
Location
France
Website
sebt3.openpandora.org
pyra-builder is a cross-compilation toolchain in a docker image. Actually, it is pretty much my pyra-debian-cross in a container image.
I'm providing 3 distincts images (I may make some for ARM)
  • slim: using debian:buster-slim as rootfs
  • large: using the pyra rootfs as rootfs
  • arm64: for arm64 docker nodes
notice : The host require binfmt-support if you plan on changing the pyra rootfs inside the image.
Basic usage
sudo docker run -it --rm sebt3/pyra-builder:large bash -l
Then use exactly as pyra-debian-cross, the toolchain live in /toolchain

Using a volume mount for dbp
Code:
mkdir /tmp/out
sudo docker run -it --rm -v /tmp/out:/out sebt3/pyra-builder:large bash -l

The produced dbp will still be available in /tmp/out on your host.

Automating build
Included in the image, there's an automated dbp build system.
Here is a little demo :
Code:
mkdir /tmp/out
git clone http://dev.pyra-handheld.com/sebt3/dosbox.git
sudo docker run -it --rm -v /tmp/out:/out -v $PWD/dosbox:/drone/src sebt3/pyra-builder:slim
ls -l /tmp/out/dosbox.dbp

Automated publish to a ssh target

Code:
key="$(cat ~/.ssh/id_rsa)"
sudo docker run -it --rm -e PLUGIN_SSHDEST="user@hostname:/path/where/to/drop/dbp_files/" -e PLUGIN_SSHKEY="$key" -v $PWD/dosbox:/drone/src sebt3/pyra-builder:slim
ssh user@hostname ls -l /path/where/to/drop/dbp_files/

Usage with drone.io
drone.io is a CI/CD docker based solution.
Here is a sample .drone.yml file :
Code:
kind: pipeline
name: default
steps:

- name: pyra
  image: sebt3/pyra-builder:large
  settings:
    sshDest: "user@hostname:/path/where/to/drop/dbp_files/"
    sshKey:
      from_secret: depo_key

---
kind: secret
name: depo_key
get:
  path: depo-ssh
  name: id_rsa

The depo-ssh secret have to contain the id_rsa file.

Usage with gitlab-ci

Here is a sample .gitlab-ci.yml file :
Code:
build:
  image: sebt3/pyra-builder:slim
  stage: build
  script:
    - /usr/bin/entrypoint.sh
    - mv /out/*.dbp .
  artifacts:
    paths:
      - '*.dbp'
That will make the dbp available as a gitlab artifact (so downloadable by anyone)
If you want it to upload to a ssh destination, then get to your gitlab "project settting/CI CD" page, "Expand" the "variables" section.
Then create a line with
- Type: Variable
- Key: PLUGIN_SSHDEST
- Value : something like : "user@hostname:/path/where/to/drop/dbp_files/"
- State: "protected"
And another one :
- Type: File
- Key: PLUGIN_SSHKEY
- Value : the content of your ~/.ssh/id_rsa file that you use to log in on this target
- State: "protected"
This way theses secrets values wont be displayd.
 
Last edited:
Hi @sebt3

If this uses your pyra-debian-cross then this is also only for Debian Buster? I tried the install of pyra-debian-cross on Stretch but could not export the environment-setup file

Thanks
 
If this uses your pyra-debian-cross then this is also only for Debian Buster? I tried the install of pyra-debian-cross on Stretch but could not export the environment-setup file
The docker image does contain a whole Debian Buster (on diet but still).
The very point of this is to be usable anywhere where docker is installable. It can even be used under windows if you feel like it (but if you do and have issues with docker on windows I wont be of any help :p )

Edit: My machine is under bullseye, which have a newer toolchain than buster, incompatible with the buster we have. That was my main motivation for this... So I could update my dbps
I'm mostly using the arm64 image myself now
 
Last edited:
Back
Top