From 7cad8f3e32018d5cee9a10ba3c0b126147b5048e Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 17 Jan 2023 16:18:17 +0100 Subject: [PATCH] Add helper script --- Dockerfile | 6 +++++- files/artifact_publish | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 files/artifact_publish diff --git a/Dockerfile b/Dockerfile index 50acc87..d6838a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ MAINTAINER CodingWorkshop RUN pacman -Syu --noconfirm --noprogressbar --quiet # Install additional packages -RUN pacman -Syu --noconfirm --noprogressbar --quiet autoconf automake binutils bison cppcheck docker flex gcc git libedit libmd linux-headers mtools parted patch pkgconfig texinfo wget +RUN pacman -Syu --noconfirm --noprogressbar --quiet autoconf automake binutils bison cppcheck docker flex gcc git libedit libmd linux-headers mtools openssh parted patch pkgconfig texinfo wget # Set locale RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && \ @@ -33,6 +33,10 @@ RUN wget https://github.com/xt-sys/xtchain/releases/download/2.7/xtchain-2.7-lin COPY files/github_publish /usr/local/bin/ RUN chmod a+x /usr/local/bin/github_publish +# Install artifacts publishing script +COPY files/artifact_publish /usr/local/bin/ +RUN chmod a+x /usr/local/bin/artifact_publish + # Set system path ENV PATH="/opt/xtchain:/opt/xtchain/bin:${PATH}" diff --git a/files/artifact_publish b/files/artifact_publish new file mode 100644 index 0000000..521c463 --- /dev/null +++ b/files/artifact_publish @@ -0,0 +1,11 @@ +#!/bin/bash + +SOURCE="${1}" +DESTINATION="${2}" + +echo "Publishing CI/CD artifacts for '${CI_COMMIT_REF}'" + +echo "$OSCW_ARTIFACTS_USERKEY" | base64 -d > ~/artifacts.key +chmod 600 ~/artifacts.key + +scp -o StrictHostKeyChecking=no -i ~/artifacts.key ${SOURCE} $OSCW_ARTIFACTS_USERNAME@$OSCW_ARTIFACTS_HOSTNAME:artifacts/${DESTINATION}/