build juicefs image #204
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build juicefs image | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 8 * * *" | |
jobs: | |
publish-ce-mount-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login Docker Hub | |
env: | |
PASSWORD: ${{ secrets.DOCKERHUB_FUSE_ACCESS_TOKEN }} | |
run: docker login --username chnliyong --password ${PASSWORD} | |
- name: check latest tag | |
continue-on-error: true | |
run: | | |
JUICEFS_CE_LATEST_VERSION=$(curl -fsSL https://api.github.com/repos/juicedata/juicefs/releases/latest | grep tag_name | grep -oE 'v[0-9]+\.[0-9][0-9]*(\.[0-9]+(-[0-9a-z]+)?)?') | |
echo "mount image is juicedata/mount:${JUICEFS_CE_LATEST_VERSION}-$JUICEFS_EE_LATEST_VERSION" | |
echo "MOUNT_IMAGE_EXIST=false" >> $GITHUB_ENV | |
echo "JUICEFS_CE_LATEST_VERSION=$JUICEFS_CE_LATEST_VERSION" >> $GITHUB_ENV | |
docker pull juicedata/mount:ce-${JUICEFS_CE_LATEST_VERSION} | |
rst=$? | |
if [ $rst -eq 0 ]; then | |
echo "MOUNT_IMAGE_EXIST=true" >> $GITHUB_ENV | |
fi | |
- name: Build and Push juicefs latest image | |
env: | |
CEVERSION: latest | |
CEJUICEFS_VERSION: ${{ env.JUICEFS_CE_LATEST_VERSION }} | |
run: | | |
image_exist=${{ env.MOUNT_IMAGE_EXIST }} | |
if [ $image_exist == "false" ]; then | |
echo "Build JuiceFS latest image" | |
make ce-image | |
else | |
echo "JuiceFS latest image already exists" | |
fi | |
- name: Buildx and Push juicefs image | |
env: | |
CEVERSION: ce-${{ env.JUICEFS_CE_LATEST_VERSION }} | |
CEJUICEFS_VERSION: ${{ env.JUICEFS_CE_LATEST_VERSION }} | |
run: | | |
image_exist=${{ env.MOUNT_IMAGE_EXIST }} | |
if [ $image_exist == "false" ]; then | |
echo "Build JuiceFS new version image: $JUICEFS_CE_LATEST_VERSION" | |
export DOCKER_CLI_EXPERIMENTAL=enabled | |
docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d | |
docker buildx create --use --name mybuilder | |
make ce-image-buildx | |
else | |
echo "JuiceFS mount ce version image $JUICEFS_CE_LATEST_VERSION already exists" | |
fi | |
publish-ee-mount-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login Docker Hub | |
env: | |
PASSWORD: ${{ secrets.DOCKERHUB_FUSE_ACCESS_TOKEN }} | |
run: docker login --username chnliyong --password ${PASSWORD} | |
- name: check latest tag | |
continue-on-error: true | |
run: | | |
JUICEFS_EE_LATEST_VERSION=$(curl -sSL https://juicefs.com/static/juicefs -o juicefs-ee && chmod +x juicefs-ee && ./juicefs-ee version | cut -d' ' -f3) | |
echo "mount image is juicedata/mount:ee-$JUICEFS_EE_LATEST_VERSION" | |
echo "MOUNT_IMAGE_EXIST=false" >> $GITHUB_ENV | |
echo "JUICEFS_EE_LATEST_VERSION=$JUICEFS_EE_LATEST_VERSION" >> $GITHUB_ENV | |
docker pull juicedata/mount:ee-$JUICEFS_EE_LATEST_VERSION | |
rst=$? | |
if [ $rst -eq 0 ]; then | |
echo "MOUNT_IMAGE_EXIST=true" >> $GITHUB_ENV | |
fi | |
- name: Buildx and Push juicefs image | |
env: | |
EEVERSION: ee-${{ env.JUICEFS_EE_LATEST_VERSION }} | |
run: | | |
image_exist=${{ env.MOUNT_IMAGE_EXIST }} | |
if [ $image_exist == "false" ]; then | |
echo "Build JuiceFS new version image" | |
export DOCKER_CLI_EXPERIMENTAL=enabled | |
docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d | |
docker buildx create --use --name mybuilder | |
make ee-image-buildx | |
else | |
echo "JuiceFS mount ee version image already exists" | |
fi | |
publish-fuse-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login Docker Hub | |
env: | |
PASSWORD: ${{ secrets.DOCKERHUB_FUSE_ACCESS_TOKEN }} | |
run: docker login --username chnliyong --password ${PASSWORD} | |
- name: check latest tag | |
continue-on-error: true | |
run: | | |
JUICEFS_CE_LATEST_VERSION=$(curl -fsSL https://api.github.com/repos/juicedata/juicefs/releases/latest | grep tag_name | grep -oE 'v[0-9]+\.[0-9][0-9]*(\.[0-9]+(-[0-9a-z]+)?)?') | |
JUICEFS_EE_LATEST_VERSION=$(curl -sSL https://juicefs.com/static/juicefs -o juicefs-ee && chmod +x juicefs-ee && ./juicefs-ee version | cut -d' ' -f3) | |
echo "MOUNT_IMAGE_EXIST=false" >> $GITHUB_ENV | |
echo "mount image is juicedata/juicefs-fuse:${JUICEFS_CE_LATEST_VERSION}-$JUICEFS_EE_LATEST_VERSION" | |
docker pull juicedata/juicefs-fuse:${JUICEFS_CE_LATEST_VERSION}-$JUICEFS_EE_LATEST_VERSION | |
rst=$? | |
if [ $rst -eq 0 ]; then | |
echo "MOUNT_IMAGE_EXIST=true" >> $GITHUB_ENV | |
fi | |
- name: Buildx and Push docker image | |
run: | | |
image_exist=${{ env.MOUNT_IMAGE_EXIST }} | |
if [ $image_exist == "false" ]; then | |
echo "Build JuiceFS version image" | |
export DOCKER_CLI_EXPERIMENTAL=enabled | |
docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d | |
docker buildx create --use --name mybuilder | |
make fuse-image-version | |
else | |
echo "JuiceFS FUSE version image already exists" | |
fi |