Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerile and add docker service file to release #7

Merged
merged 1 commit into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
python-version: '3.11'
debian-dist-type: 'application'
debian-dist-command: 'make package'
post-build-command: 'make service TAG=$GIT_TAG'
- name: Set up QEMU for multi-architecture builds
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx for multi-architecture builds
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ COPY dist/*.deb /etc/apt-server/
RUN apt install -y /etc/apt-server/*.deb
ENV PATH="/opt/venvs/apt-server/bin:$PATH"

# Create symbolic link of the lib directory with the actual python version
RUN export SOURCE_VERSION=$(ls /opt/venvs/apt-server/lib/ | grep python | awk -Fpython '{print $2}') && \
export TARGET_VERSION=$(python3 --version | awk '{print $2}' | awk -F. '{print $1"."$2}') && \
ln -s /opt/venvs/apt-server/lib/python$SOURCE_VERSION /opt/venvs/apt-server/lib/python$TARGET_VERSION

# Copy keys
COPY tests/keys/* /etc/apt-server/keys/

Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
colon := :
$(colon) := :
IMG_TAG=latest
TAG=latest
PACKAGE_ARCHS=armhf,arm64,amd64
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

.PHONY: clean package image
.PHONY: clean package image service

clean:
rm -rf build dist *.egg-info

package:
apt-get update && apt-get install -y build-essential debhelper devscripts equivs dh-virtualenv python3-virtualenv
dpkg-buildpackage -us -ui -uc --buildinfo-option=-udist --buildinfo-option=-Odist/apt-server.buildinfo --changes-option=-udist --changes-option=-Odist/apt-server.changes
rm dist/*.buildinfo dist/*.changes dist/*.dsc dist/*_*.tar.gz

image:
docker build $(ROOT_DIR) --file Dockerfile --tag effectiverange/apt-server$(:)$(IMG_TAG) --build-arg PACKAGE_ARCHS=$(PACKAGE_ARCHS)
docker build $(ROOT_DIR) --file Dockerfile --tag effectiverange/apt-server$(:)$(TAG) --build-arg PACKAGE_ARCHS=$(PACKAGE_ARCHS)

service:
@cat $(ROOT_DIR)/service/apt-server.docker.service | TAG=$(TAG) envsubst > $(ROOT_DIR)/dist/apt-server-$(TAG).docker.service
18 changes: 0 additions & 18 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
apt-server (1.1.4) stable; urgency=medium

* Release 1.1.4

-- GitHub Action <[email protected]> Sun, 16 Jun 2024 16:09:03 +0000

apt-server (1.1.4) stable; urgency=medium

* Release 1.1.4

-- GitHub Action <[email protected]> Sat, 15 Jun 2024 16:14:48 +0000

apt-server (1.1.4) stable; urgency=medium

* Release 1.1.4

-- GitHub Action <[email protected]> Sat, 15 Jun 2024 14:03:53 +0000

apt-server (1.1.3) stable; urgency=medium

* Release 1.1.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Type=simple
Restart=always
RestartSec=10
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker pull effectiverange/apt-server:latest
ExecStart=/usr/bin/docker run --net=host --name=apt-server -v /opt/debs:/opt/debs -v /var/log/effective-range/apt-server:/var/log/effective-range/apt-server effectiverange/apt-server:latest
ExecStartPre=-/usr/bin/docker pull effectiverange/apt-server:${TAG}
ExecStart=/usr/bin/docker run --net=host --name=apt-server -v /opt/debs:/opt/debs -v /var/log/effective-range/apt-server:/var/log/effective-range/apt-server effectiverange/apt-server:${TAG}
ExecStop=/usr/bin/docker kill apt-server
ExecStopPost=/usr/bin/docker rm apt-server

Expand Down
Loading