Skip to content

Commit

Permalink
temporary test image build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattia Di Eleuterio authored and Mattia Di Eleuterio committed Nov 5, 2023
1 parent af28b1e commit 6fe872b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/docker-image-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: remove dev deps and version (for cache purposes)
run: |
sh .github/workflows/remove_dev_deps_and_version.sh beta
sh .github/workflows/remove_dev_deps_and_version.sh test
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -37,7 +37,7 @@ jobs:
context: ./
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-amd64-beta
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-amd64-test
platforms: linux/amd64
cache-from: type=gha,scope=main-amd64
cache-to: type=gha,mode=max,scope=main-amd64
Expand All @@ -55,7 +55,7 @@ jobs:
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: remove dev deps and version (for cache purposes)
run: |
sh .github/workflows/remove_dev_deps_and_version.sh beta
sh .github/workflows/remove_dev_deps_and_version.sh test
shell: bash
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -72,7 +72,7 @@ jobs:
context: ./
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-arm64-beta
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-arm64-test
platforms: linux/arm64
cache-from: type=gha,scope=main-arm64
cache-to: type=gha,mode=max,scope=main-arm64
Expand All @@ -94,7 +94,7 @@ jobs:
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: remove dev deps and version (for cache purposes)
run: |
sh .github/workflows/remove_dev_deps_and_version.sh beta
sh .github/workflows/remove_dev_deps_and_version.sh test
shell: bash
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -111,7 +111,7 @@ jobs:
context: ./
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-armv7-beta
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-armv7-test
platforms: linux/arm/v7
cache-from: type=gha,scope=main-armv7
cache-to: type=gha,mode=max,scope=main-armv7
Expand All @@ -135,6 +135,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: merge into version
run: docker buildx imagetools create -t ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:beta ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-armv7-beta ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-arm64-beta ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-amd64-beta
run: docker buildx imagetools create -t ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:test ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-armv7-test ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-arm64-test ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-amd64-test
- name: merge into version
run: docker buildx imagetools create -t ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-beta ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-armv7-beta ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-arm64-beta ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-amd64-beta
run: docker buildx imagetools create -t ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-test ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-armv7-test ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-arm64-test ${{ secrets.DOCKERHUB_USERNAME }}/vod2pod-rss:${{ env.VERSION }}-amd64-test
19 changes: 11 additions & 8 deletions .github/workflows/remove_dev_deps_and_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ SHORT_HASH=$(git rev-parse --short HEAD | cut -c1-7)

RELEASE_TYPE=${1:-beta}

if [ "$RELEASE_TYPE" != "beta" ] && [ "$RELEASE_TYPE" != "stable" ]; then
echo "Please provide either 'beta' or 'stable' as input."
exit 1
if [ "$RELEASE_TYPE" != "beta" ] && [ "$RELEASE_TYPE" != "stable" ] && [ "$RELEASE_TYPE" != "test" ]; then
echo "Please provide either 'beta' or 'stable' as input."
exit 1
fi

# specify the path to the TOML file
Expand All @@ -17,19 +17,22 @@ TMP_FILE=$(mktemp)

# use sed to delete the [dev-dependencies] section from the TOML file
VERSION=$(grep -oP '^version = "\K[0-9]+\.[0-9]+\.[0-9]+' $TOML_FILE)
sed '/\[dev-dependencies\]/,/^$/d' $TOML_FILE | sed 's/^version = .*$/version = "0\.0\.1"/' > "$TMP_FILE"
sed '/\[dev-dependencies\]/,/^$/d' $TOML_FILE | sed 's/^version = .*$/version = "0\.0\.1"/' >"$TMP_FILE"
echo "$0: version found $VERSION"

if [ "$RELEASE_TYPE" = "beta" ]; then
VERSION="$VERSION-beta-$SHORT_HASH"
VERSION="$VERSION-beta-$SHORT_HASH"
fi

echo "$VERSION" > version.txt
if [ "$RELEASE_TYPE" = "test" ]; then
VERSION="$VERSION-test-$SHORT_HASH"
fi

echo "$VERSION" >version.txt
cat version.txt

# print the modified TOML code to the console
cat "$TMP_FILE" > "$TOML_FILE"
cat "$TMP_FILE" >"$TOML_FILE"

# remove the temporary file
rm "$TMP_FILE"

0 comments on commit 6fe872b

Please sign in to comment.