Skip to content

Commit 9a82b12

Browse files
committed
apicula: rebase and update (#11)
1 parent 257d973 commit 9a82b12

File tree

4 files changed

+63
-20
lines changed

4 files changed

+63
-20
lines changed

.github/workflows/apicula.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636

3737
apicula:
3838
runs-on: ubuntu-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
os:
43+
- debian-buster
3944
steps:
4045

4146
- uses: actions/checkout@v2
@@ -44,11 +49,25 @@ jobs:
4449

4550
- run: echo "$(pwd)/.github/bin" >> $GITHUB_PATH
4651

47-
- run: dockerBuild pkg:apicula apicula pkg
48-
- run: dockerBuild apicula apicula
52+
- run: dockerBuild -b ${{ matrix.os }} -i pkg:apicula -d apicula -t pkg
53+
- run: dockerBuild -b ${{ matrix.os }} -i apicula -d apicula
4954

50-
- run: dockerTestPkg apicula
51-
- run: dockerTest apicula
55+
- run: dockerTestPkg ${{ matrix.os }} apicula
56+
- run: dockerTest ${{ matrix.os }} apicula
57+
58+
- name: Login to ghcr.io
59+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
60+
uses: docker/login-action@v1
61+
with:
62+
registry: ghcr.io
63+
username: gha
64+
password: ${{ github.token }}
65+
66+
- if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
67+
run: >-
68+
dockerPush ${{ matrix.os }}
69+
pkg:apicula
70+
apicula
5271
5372
- name: Login to DockerHub
5473
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
@@ -57,9 +76,17 @@ jobs:
5776
username: ${{ secrets.DOCKER_USER }}
5877
password: ${{ secrets.DOCKER_PASS }}
5978

60-
- run: dockerPush pkg:apicula
61-
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
79+
# Mirror to docker.io/hdlc
6280

63-
- run: dockerPush apicula
64-
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers'
81+
- name: Login to docker.io
82+
if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' && ${{ matrix.os }} == 'debian-buster'
83+
uses: docker/login-action@v1
84+
with:
85+
username: ${{ secrets.DOCKER_USER }}
86+
password: ${{ secrets.DOCKER_PASS }}
6587

88+
- if: github.event_name != 'pull_request' && github.repository == 'hdl/containers' && ${{ matrix.os }} == 'debian-buster'
89+
run: >-
90+
dockerMirror ${{ matrix.os }}
91+
pkg:apicula
92+
apicula

apicula.dockerfile renamed to debian-buster/apicula.dockerfile

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# syntax=docker/dockerfile:experimental
1+
# syntax=docker/dockerfile:1.2
2+
23
# Authors:
34
# Unai Martinez-Corral
45
# Lucas Teske
@@ -19,26 +20,40 @@
1920
#
2021
# SPDX-License-Identifier: Apache-2.0
2122

22-
FROM hdlc/build:build AS build
23+
ARG REGISTRY='ghcr.io/hdl/debian-buster'
24+
25+
#---
26+
27+
FROM $REGISTRY/build:build AS build
2328

2429
RUN apt-get update -qq \
25-
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends wget
30+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
31+
wget \
32+
python3-dev \
33+
python3-setuptools \
34+
python3-wheel
2635

27-
RUN mkdir /opt/apicula \
36+
RUN mkdir /opt/apicula /tmp/apicula \
2837
&& wget https://files.pythonhosted.org/packages/1a/d6/b3162f87ff114d639095fe7c0655080ee16caff9037d6629f738d8b28d92/Apycula-0.0.1a6.tar.gz \
2938
&& tar -xvf Apycula-0.0.1a6.tar.gz --strip-components=1 -C /opt/apicula \
30-
&& ls -lah /opt/apicula
39+
&& cd /opt/apicula \
40+
&& python3 setup.py bdist_wheel \
41+
&& mv dist/*.whl /tmp/apicula/
3142

3243
#---
3344

3445
FROM scratch AS pkg
35-
COPY --from=build /opt/apicula /apicula
46+
COPY --from=build /tmp/apicula /apicula
3647

3748
#---
3849

39-
FROM hdlc/build:base
50+
FROM $REGISTRY/build:base
4051

41-
RUN --mount=type=cache,from=build,src=/opt/apicula,target=/opt/apicula cd /opt/apicula \
42-
&& python3 setup.py install \
43-
&& rm -rf ~/.cache
52+
RUN apt-get update -qq \
53+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
54+
python3-pip \
55+
python3-setuptools \
56+
python3-wheel
4457

58+
RUN --mount=type=cache,from=build,src=/tmp/apicula,target=/tmp/apicula pip3 install -U /tmp/apicula/*.whl --progress-bar off \
59+
&& rm -rf ~/.cache

debian-buster/base.dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ RUN apt-get update -qq \
2424
ca-certificates \
2525
curl \
2626
python3 \
27-
python3-setuptools \
2827
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
2928
&& update-ca-certificates \
3029
&& rm -rf /var/lib/apt/lists/*

test/apicula.pkg.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ set -e
2424

2525
cd $(dirname "$0")
2626

27-
tree /
27+
./_tree.sh
28+
29+
ls -la /*.whl
2830

2931
./_todo.sh

0 commit comments

Comments
 (0)