Skip to content

Commit 848166b

Browse files
opajonkmaba274463matthiasb85
authored
Pepare Release 1.8.0 (#65)
- revert some inadvertently removed things - bump version to `v1.8.0` --------- Co-authored-by: Manjoo Bentur <Manjunath.BasappaBentur@elektrobit.com> Co-authored-by: Matthias Beckert <matthias.beckert@elektrobit.com>
1 parent 17c3b22 commit 848166b

7 files changed

Lines changed: 150 additions & 2 deletions

File tree

configuration/build_config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
Base-Name: ebcl_dev_container
22
Repository: ghcr.io/elektrobit
33
Base-Container: ubuntu:22.04
4-
Version: v1.7.0
5-
Version_packages: v1.7.0
4+
Version: v1.8.0
5+
Version_packages: v1.8.0
66
Layers:
77
- ../layers/base
88
- ../layers/yocto
99
- ../layers/pbuilder
10+
- ../layers/helper
1011
- ../layers/appdev
1112
- ../layers/build_tools
1213
- ../layers/vscode

layers/helper/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:latest
2+
3+
ARG CONTAINER_USER="ebcl"
4+
5+
# "Activate" Python env
6+
ENV VIRTUAL_ENV=/build/venv
7+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
8+
9+
USER $CONTAINER_USER
10+
WORKDIR /build
11+
12+
# copy apt helper scripts
13+
COPY scripts/apt/* /build/bin/
14+
15+
# copy gpg helper scripts
16+
COPY scripts/gpg/* /build/bin/
17+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
# Generate the apt repo metadata
4+
cd /build/results/packages
5+
6+
mkdir -p dists/local/main/{binary-arm64,binary-amd64}
7+
8+
dpkg-scanpackages -m -a amd64 . /dev/null > dists/local/main/binary-amd64/Packages
9+
dpkg-scanpackages -m -a arm64 . /dev/null > dists/local/main/binary-arm64/Packages
10+
dpkg-scanpackages -m -a amd64 . /dev/null | gzip -9c > dists/local/main/binary-amd64/Packages.gz
11+
dpkg-scanpackages -m -a arm64 . /dev/null | gzip -9c > dists/local/main/binary-arm64/Packages.gz
12+
dpkg-scanpackages -m -a amd64 . /dev/null | xz -9 > dists/local/main/binary-amd64/Packages.xz
13+
dpkg-scanpackages -m -a arm64 . /dev/null | xz -9 > dists/local/main/binary-arm64/Packages.xz
14+
15+
# generate the release file
16+
cd dists/local
17+
18+
do_hash() {
19+
HASH_NAME=$1
20+
HASH_CMD=$2
21+
echo "${HASH_NAME}:"
22+
for f in $(find -type f -name "Packages*"); do
23+
f=$(echo $f | cut -c3-) # remove ./ prefix
24+
if [ "$f" = "Release" ]; then
25+
continue
26+
fi
27+
echo " $(${HASH_CMD} ${f} | cut -d" " -f1) $(wc -c $f)"
28+
done
29+
}
30+
31+
cat > Release << EOF
32+
Origin: EBcL workspace local repository
33+
Label: LocalRepo
34+
Suite: local
35+
Codename: local
36+
Version: 1.0
37+
Architectures: amd64 arm64
38+
Description: An example software repository
39+
Components: main
40+
Date: $(date -Ru)
41+
EOF
42+
43+
do_hash "MD5Sum" "md5sum" >> Release
44+
do_hash "SHA1" "sha1sum" >> Release
45+
do_hash "SHA256" "sha256sum" >> Release
46+
47+
# Generate Release signature
48+
gpg -b --output Release.gpg --armor Release
49+
50+
# Generate InRelease file
51+
gpg --clearsign -o InRelease Release
52+
53+
# Export signing key
54+
gpg --export $DEBMAIL > Release.key
55+
56+
# Update local apt config
57+
sudo cp Release.key /etc/apt/trusted.gpg.d/local.gpg
58+
sudo bash -c "echo 'deb file:/build/results/packages local main' > /etc/apt/sources.list.d/local.list"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
if [ -z "$APT_PATH" ]; then
4+
export APT_PATH="/build/results/packages"
5+
fi
6+
7+
if [ -n "$1" ]; then
8+
APT_PATH=$1
9+
# complete apt path
10+
if [[ "${APT_PATH}" != "/"* ]]; then
11+
# handle relative path
12+
if [ ! -d "${APT_PATH}" ]; then
13+
# relative path from current folder does not exist
14+
# use relative path in workspace apps folder
15+
APT_PATH="/build/workspace/${APT_PATH}"
16+
else
17+
APT_PATH=$(realpath $APT_PATH)
18+
fi
19+
fi
20+
export APT_PATH=${APT_PATH}
21+
fi
22+
23+
# serve the apt repo
24+
echo "Now serving the local apt repository from ${APT_PATH}."
25+
echo "Press Strg + C to stop the server."
26+
python3 -m http.server --directory ${APT_PATH}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
PROC=$(lsof -i :8000 | grep LISTEN)
4+
if [ $? -eq 0 ]; then
5+
echo "Killing process ${PROC}."
6+
PID=$(lsof -i :8000 | grep LISTEN | awk '{print $2}')
7+
kill $PID
8+
fi
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Key-Type: 1
2+
Key-Length: 4096
3+
Subkey-Type: 1
4+
Subkey-Length: 4096
5+
Name-Real: DEBFULLNAME
6+
Name-Email: DEBEMAIL
7+
Expire-Date: 0
8+
%no-ask-passphrase
9+
%no-protection
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Ensure env is up-to-date
4+
source /workspace/identity/env
5+
GNUPGHOME="/workspace/gpg-keys/.gnupg"
6+
export GNUPGHOME
7+
8+
# prepare folder if not exists
9+
mkdir -p $GNUPGHOME
10+
chmod -R 700 $GNUPGHOME
11+
12+
# generate gnupg script
13+
mkdir -p /workspace/gpg-keys
14+
cp /build/bin/gen_key_script /workspace/gpg-keys/
15+
sed -i "s/DEBFULLNAME/${DEBFULLNAME}/g" /workspace/gpg-keys/gen_key_script
16+
sed -i "s/DEBEMAIL/${DEBEMAIL}/g" /workspace/gpg-keys/gen_key_script
17+
18+
# test if key already exists
19+
gpg --list-secret-keys $DEBEMAIL
20+
# get appliance name
21+
if [ $? -ne 0 ]; then
22+
gpg --batch --gen-key /workspace/gpg-keys/gen_key_script
23+
fi
24+
25+
gpg --list-keys
26+
gpg --list-secret-keys
27+
28+
sudo chown -R ebcl:ebcl $GNUPGHOME
29+
sudo chmod -R 700 $GNUPGHOME

0 commit comments

Comments
 (0)