Skip to content

Commit 04db2fd

Browse files
committed
apicula: rebase and update (#11)
1 parent 9853d2b commit 04db2fd

File tree

5 files changed

+95
-54
lines changed

5 files changed

+95
-54
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

Lines changed: 0 additions & 44 deletions
This file was deleted.

debian-buster/apicula.dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# syntax=docker/dockerfile:1.2
2+
3+
# Authors:
4+
# Unai Martinez-Corral
5+
# Lucas Teske
6+
#
7+
# Copyright 2019-2021 Unai Martinez-Corral <[email protected]>
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
#
21+
# SPDX-License-Identifier: Apache-2.0
22+
23+
ARG REGISTRY='ghcr.io/hdl/debian-buster'
24+
25+
#---
26+
27+
FROM $REGISTRY/build:build AS build
28+
29+
RUN apt-get update -qq \
30+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
31+
python3-dev \
32+
python3-setuptools \
33+
python3-wheel
34+
35+
RUN mkdir /opt/apicula /tmp/apicula \
36+
&& curl -fsSL https://files.pythonhosted.org/packages/1a/d6/b3162f87ff114d639095fe7c0655080ee16caff9037d6629f738d8b28d92/Apycula-0.0.1a6.tar.gz | tar -xvzf - --strip-components=1 -C /opt/apicula \
37+
&& cd /opt/apicula \
38+
&& python3 setup.py bdist_wheel \
39+
&& mv dist/*.whl /tmp/apicula/
40+
41+
#---
42+
43+
FROM scratch AS pkg
44+
COPY --from=build /tmp/apicula /apicula
45+
46+
#---
47+
48+
FROM $REGISTRY/build:base
49+
50+
RUN apt-get update -qq \
51+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
52+
python3-pip \
53+
python3-setuptools \
54+
python3-wheel
55+
56+
RUN --mount=type=cache,from=build,src=/tmp/apicula,target=/tmp/apicula pip3 install -U /tmp/apicula/*.whl --progress-bar off \
57+
&& 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)