Skip to content

Commit 5c3e595

Browse files
authored
Fixed auto tagging for dockerimages (#113)
* Fixed auto tagging for dockerimages * Fixed typo. * Added check + support for wget if curl does not exist on the target system in setup_tsl.sh
1 parent 9b7a72f commit 5c3e595

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/build_and_push_dockerhub.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,16 @@ jobs:
8686
shell: bash
8787
run: |
8888
set -x
89-
if [ "${{ github.event_name }}" = "pull_request" ]; then
89+
if [ "${{ github.event_name }}" == "pull_request" ]; then
9090
echo "tag=${{ github.head_ref }}" >> "${GITHUB_OUTPUT}"
9191
else
92-
echo "tag=${{ github.ref_name }}" >> "${GITHUB_OUTPUT}"
92+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
93+
TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref }})
94+
BRANCH=$(git branch -r --contains "${TAG_COMMIT}" | sed 's/origin\///' | grep -v HEAD | head -n 1 | awk '{$1=$1};1')
95+
echo "tag=${BRANCH}" >> "${GITHUB_OUTPUT}"
96+
else
97+
echo "tag=${{ github.ref_name }}" >> "${GITHUB_OUTPUT}"
98+
fi
9399
fi
94100
95101
- name: 'Set image name output'

.github/workflows/release/tarball/setup_tsl.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ mkdir -p "${out_path}"
5454
tmp_dir=$(mktemp -ud /tmp/libtsl-dev-XXXXXX)
5555
mkdir -p "${tmp_dir}"
5656

57-
curl -L "https://github.com/db-tu-dresden/TSL/releases/latest/download/libtsl-dev.tar.gz" -o ${tmp_dir}/libtsl-dev.tar.gz
57+
if type curl > /dev/null 2>&1; then
58+
curl -L "https://github.com/db-tu-dresden/TSL/releases/latest/download/libtsl-dev.tar.gz" -o ${tmp_dir}/libtsl-dev.tar.gz
59+
elif type wget > /dev/null 2>&1; then
60+
wget -O ${tmp_dir}/libtsl-dev.tar.gz "https://github.com/db-tu-dresden/TSL/releases/latest/download/libtsl-dev.tar.gz"
61+
else
62+
echo "Please install curl or wget to download the library"
63+
exit 1
64+
fi
5865
tar -xzf "${tmp_dir}/libtsl-dev.tar.gz" -C "${tmp_dir}"
5966
chmod 755 "${tmp_dir}"/*.sh
6067
supported_path=$("${tmp_dir}"/select_flavor.sh "${tmp_dir}")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The latest release is available under [Releases](https://github.com/db-tu-dresde
3535

3636
To download the TSL to the current working directory, just run
3737
~~~console
38-
curl -L -s "https://github.com/db-tu-dresden/TSL/releases/latest/download/install_tsl.sh" | /bin/bash
38+
curl -L -s "https://github.com/db-tu-dresden/TSL/releases/latest/download/setup_tsl.sh" | /bin/bash
3939
~~~
4040

4141
If you want to "install" the TSL (the header files will be placed at /usr/include/tsl), we prepared an `rpm` and a `deb` package.

0 commit comments

Comments
 (0)