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

Refactor makefile, add ubuntu1804 and fix label bug #117

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
35 changes: 13 additions & 22 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
matrix:
# for OCI runner change to: runner: [ubuntu-latest, self-hosted]
runner: [ubuntu-latest]
os: [ubuntu2004, fedora33]
os: [ubuntu2004, ubuntu1804, fedora33]

steps:
- name: Checkout repository
Expand All @@ -45,13 +45,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# - name: Login to DockerHub
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
Expand Down Expand Up @@ -86,21 +79,19 @@ jobs:
./ipdk install ${{ matrix.os }}
ipdk config IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/ipdk-${{ matrix.os }}-${{ steps.system.outputs.arch }}

- name: IPDK image build and push
if: github.event_name != 'pull_request'
run: |
ipdk build --no-cache \
--tags "${{ steps.image_meta.outputs.tags }}" \
--labels "${{ steps.image_meta.outputs.labels }}" \
--push

- name: IPDK image build and export
if: github.event_name == 'pull_request'
- name: IPDK image build and export or push
run: |
ipdk build --no-cache \
--tags "${{ steps.image_meta.outputs.tags }}" \
--labels "${{ steps.image_meta.outputs.labels }}" \
--export /tmp/${{ matrix.os }}-${{ steps.system.outputs.arch }}.tar
if [ "${{ github.event_name }}" = "pull_request" ]; then
ipdk build --no-cache \
--tags "${{ steps.image_meta.outputs.tags }}" \
--labels "${{ steps.image_meta.outputs.labels }}" \
--export /tmp/${{ matrix.os }}-${{ steps.system.outputs.arch }}.tar
else
ipdk build --no-cache \
--tags "${{ steps.image_meta.outputs.tags }}" \
--labels "${{ steps.image_meta.outputs.labels }}" \
--push
fi

- name: Upload build artifact
if: github.event_name == 'pull_request'
Expand Down
8 changes: 7 additions & 1 deletion build/scripts/ipdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ build_image() {
if [[ "$LABELS" != "" ]] ; then
IFS="," read -r -a LABEL_LIST <<< "${LABELS}"
for i in "${LABEL_LIST[@]}" ; do
ARGS+=("--label" "${i}")
if [[ "$i" == *"="* ]]; then # solve the use of , in label string...
ARGS+=("--label" "${i}")
else
local LAST_INDEX=${#ARGS[@]}-1
local TEMP=${ARGS[${LAST_INDEX}]}
ARGS[${LAST_INDEX}]="${TEMP},${i}"
fi
done
fi

Expand Down