Skip to content

Commit

Permalink
Add Dockerfile for local F-Droid builds
Browse files Browse the repository at this point in the history
  • Loading branch information
charlag committed Jan 14, 2025
1 parent 0c6fbca commit 11bff68
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ci/containers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ You're going to have to do this as root unless you have rootless containers set
* remove the container:
```podman rm linux-build```
* remove the image:
```podman image rm linux-build:latest```
```podman image rm linux-build:latest```

## F-Droid container
* building the image
``` podman build -t fdroid --network=host -f ci/containers/fdroid-build.dockerfile```
* run a build against the latest metadata version (run in fdroiddata repo)
``` podman run --rm -v $(pwd):/repo -v /opt/android-sdk-linux:/opt/android-sdk -e ANDROID_HOME:/opt/android-sdk fdroid```
5 changes: 5 additions & 0 deletions ci/containers/fdroid-build.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM registry.gitlab.com/fdroid/docker-executable-fdroidserver:master

COPY fdroid-build.sh /

ENTRYPOINT ["bash", "/fdroid-build.sh"]
31 changes: 31 additions & 0 deletions ci/containers/fdroid-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/env bash

set -x;

echo "Building latest de.tutao.tutanota"
VERCODE=$(grep CurrentVersionCode metadata/de.tutao.tutanota.yml | awk '{print $2}')
echo "Version: $VERCODE"

# get all those good env vars that we need (like $fdroidserver and $home_vagrant)
source /etc/profile.d/bsenv.sh;

# PYTHONPATH is needed to find the plugins, we need fetchsrclibs.
export fdroid="sudo --preserve-env --user vagrant
env PATH=$fdroidserver:$PATH
env PYTHONPATH=$fdroidserver:$fdroidserver/examples
env PYTHONUNBUFFERED=true
env TERM=$TERM
env HOME=$home_vagrant
fdroid";

# We move the data we need into vagrant home. There are some guards against just running in the data repo.
ln -s $PWD/srclibs/ $home_vagrant/srclibs;
mkdir $home_vagrant/metadata;
cp metadata/de.tutao.tutanota.yml $home_vagrant/metadata/;

# Start the build in home dir.
cd $home_vagrant;
# This will fetch rustup for us but not actually install anything.
$fdroid fetchsrclibs de.tutao.tutanota:$VERCODE --verbose;
# Run the actual build.
$fdroid build --verbose --test --on-server --no-tarball de.tutao.tutanota:$VERCODE;

0 comments on commit 11bff68

Please sign in to comment.