Skip to content

Commit

Permalink
Merge pull request #17 from bergwolf/github/image-certs
Browse files Browse the repository at this point in the history
fix image builder ssl issue and trigger build on pull_request and release
  • Loading branch information
changweige authored Jan 26, 2022
2 parents ca0c5d0 + bbf5ca1 commit be252a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: nydus-snapshotter image

on:
schedule:
# Every day at 00:33 clock UTC
- cron: "33 0 * * *"
push:
branches:
- 'main'
tags:
- v[0-9]+.[0-9]+.[0-9]+
pull_request:
branches:
- 'main'

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -35,6 +40,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push nydus-snapshotter image
run: |
TAG=$GITHUB_REF_NAME
[ "$TAG" == "main" ] && TAG="latest"
[ "$GITHUB_EVENT_NAME" == "pull_request" ] && TAG="local"
cd misc/snapshotter
docker build -t ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/nydus-snapshotter:latest .
docker push ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/nydus-snapshotter:latest
docker build -t ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/nydus-snapshotter:$TAG .
# Only push for non pull_request
if [ "$GITHUB_EVENT_NAME" != "pull_request" ]; then
docker push ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/nydus-snapshotter:$TAG
fi
4 changes: 2 additions & 2 deletions misc/snapshotter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:20.04 AS sourcer

RUN apt update; apt install --no-install-recommends -y curl wget
RUN apt update; apt install --no-install-recommends -y curl wget ca-certificates
RUN export NYDUS_VERSION=$(curl --silent "https://api.github.com/repos/dragonflyoss/image-service/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'); \
wget --no-check-certificate https://github.com/dragonflyoss/image-service/releases/download/$NYDUS_VERSION/nydus-static-$NYDUS_VERSION-x86_64.tgz; \
wget https://github.com/dragonflyoss/image-service/releases/download/$NYDUS_VERSION/nydus-static-$NYDUS_VERSION-x86_64.tgz; \
tar xzf nydus-static-$NYDUS_VERSION-x86_64.tgz
RUN mv nydus-static/* /; mv nydusd-fusedev nydusd

Expand Down

0 comments on commit be252a0

Please sign in to comment.