Skip to content

Commit

Permalink
Use Vector RPM from Stackable Nexus
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedweber committed Jul 31, 2023
1 parent 6ca6f8a commit bb3caf1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
8 changes: 7 additions & 1 deletion image_tools/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@
},
{
"name": "vector",
"versions": [{"product": "0.31.0", "stackable-base": "1.0.0"}],
"versions": [
{
"product": "0.31.0",
"rpm_release": "1",
"stackable-base": "1.0.0"
}
],
},
{
"name": "nifi",
Expand Down
3 changes: 2 additions & 1 deletion vector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
FROM stackable/image/stackable-base

ARG PRODUCT
ARG RPM_RELEASE

# https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand All @@ -16,7 +17,7 @@ RUN rpm --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.no
microdnf update && \
microdnf --assumeyes install inotify-tools && \
microdnf clean all && \
rpm --install "https://github.com/vectordotdev/vector/releases/download/v${PRODUCT}/vector-${PRODUCT}-1.$(arch).rpm" && \
rpm --install "https://repo.stackable.tech/repository/packages/vector/vector-${PRODUCT}-${RPM_RELEASE}.$(arch).rpm" && \
mkdir /licenses && \
cp /usr/share/licenses/vector-${PRODUCT}/LICENSE /licenses/VECTOR_LICENSE && \
# Create the directory /stackable/vector/var.
Expand Down
31 changes: 20 additions & 11 deletions vector/upload_new_vector_version.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
#!/usr/bin/env bash

VERSION=${1:?"Missing version number argument (arg 1)"}
NEXUS_USER=${2:?"Missing Nexus username argument (arg 2)"}
RELEASE=${2:?"Missing release number argument (arg 2)"}
NEXUS_USER=${3:?"Missing Nexus username argument (arg 3)"}

ARCHITECTURES=(

This comment has been minimized.

Copy link
@maltesander

maltesander Jul 31, 2023

Member

@Maleware should we document this somewhere for multi arch? In case we want to support more...

x86_64
aarch64
)

read -r -s -p "Nexus Password: " NEXUS_PASSWORD
echo ""

# Vector does not currently publish signatures or SBOMs (as of 2023-06-25, latest version at this point 0.30.0)
# Vector does not currently publish signatures or SBOMs (as of
# 2023-07-31, latest version at this point 0.31.0)

echo "Downloading X86 Vector"
curl -LOs "https://packages.timber.io/vector/$VERSION/vector-$VERSION-x86_64-unknown-linux-gnu.tar.gz"
for arch in "${ARCHITECTURES[@]}"; do
file="vector-$VERSION-$RELEASE.$arch.rpm"

echo "Downloading ARM Vector"
curl -LOs "https://packages.timber.io/vector/$VERSION/vector-$VERSION-aarch64-unknown-linux-gnu.tar.gz"
echo "Downloading $file from timber.io"
curl -LOs "https://packages.timber.io/vector/$VERSION/$file"

echo "Uploading both to Nexus"
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "vector-$VERSION-x86_64-unknown-linux-gnu.tar.gz" 'https://repo.stackable.tech/repository/packages/vector/'
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "vector-$VERSION-aarch64-unknown-linux-gnu.tar.gz" 'https://repo.stackable.tech/repository/packages/vector/'
echo "Uploading $file to Nexus"
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" \
--upload-file "$file" \
'https://repo.stackable.tech/repository/packages/vector/'

rm "vector-$VERSION-x86_64-unknown-linux-gnu.tar.gz"
rm "vector-$VERSION-aarch64-unknown-linux-gnu.tar.gz"
echo "Removing downloaded $file"
rm "$file"
done

echo "Successfully uploaded new version of Vector ($VERSION) to Nexus"
echo "https://repo.stackable.tech/service/rest/repository/browse/packages/vector/"

0 comments on commit bb3caf1

Please sign in to comment.