Skip to content
Snippets Groups Projects
Commit bf621a47 authored by calrama's avatar calrama
Browse files

Clean up helper scripts

parent 92fc64b9
No related branches found
No related tags found
No related merge requests found
...@@ -127,4 +127,3 @@ ADD agki-nas01.imp.fu-berlin.de-ca-cert.crt /usr/local/share/ca-certificates/agk ...@@ -127,4 +127,3 @@ ADD agki-nas01.imp.fu-berlin.de-ca-cert.crt /usr/local/share/ca-certificates/agk
RUN update-ca-certificates RUN update-ca-certificates
RUN apt-get clean RUN apt-get clean
COPY profile.sh /etc/profile.d/robofish.sh
function gitlab-fetch-artifacts {
curl -o artifacts.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://git.imp.fu-berlin.de/api/v4/projects/$1/jobs/artifacts/$2/download?job=$3"
7z e artifacts.zip; rm artifacts.zip
}
function gitlab-trigger-pipeline {
curl --request POST --form "token=$2" --form "ref=$3" "https://git.imp.fu-berlin.de/api/v4/projects/$1/trigger/pipeline"
}
function cmake-extract-package {
7z e $1-*.tar.xz; rm $1-*.tar.xz
7z x $1-*.tar; rm $1-*.tar
mkdir -p vendor
mv $1-* vendor/$1
}
function cmake-enable-package-discovery {
ln -s $(realpath vendor/$1) /usr/local/$1
}
function cmake-integrate-package {
cmake-extract-package $1
cmake-enable-package-discovery $1
}
#
# Sets up Visual Studio Development environment
#
function VSDevEnv {
pushd "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/Common7/Tools"
cmd /c "VsDevCmd.bat $args & set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
}
# #
# Sets exit to error when the command fails # Sets exit to error when the command fails
# #
...@@ -26,39 +12,3 @@ function Must-Run { ...@@ -26,39 +12,3 @@ function Must-Run {
Exit(1) Exit(1)
} }
} }
#
# Fetches GitLab CI job artifacts
#
function GitLab-Fetch-Artifacts {
& curl.exe -o artifacts.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://git.imp.fu-berlin.de/api/v4/projects/$($args[0])/jobs/artifacts/$($args[1])/download?job=$($args[2])"
7z e artifacts.zip; Remove-Item -Force artifacts.zip
}
#
# Unpacks a CMake package from its tarball into the vendor directory
#
function CMake-Extract-Package {
$name = $args[0]
7z e $name-*.tar.xz; Remove-Item -Force $name-*.tar.xz
7z x $name-*.tar; Remove-Item -Force $name-*.tar
New-Item -ItemType Directory -Force 'vendor'
Move-Item $name-* vendor/$name
}
#
# Enable discovery of a CMake package in the vendor directory via find_package
#
function CMake-Enable-Package-Discovery {
$name = $args[0]
& cmd.exe /c mklink /J "C:/Program Files/$name" "$(resolve-path vendor/$name)"
}
#
# Sets up a tarballed CMake package for find_package discovery
#
function CMake-Integrate-Package {
$name = $args[0]
CMake-Extract-Package $name
CMake-Enable-Package-Discovery $name
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment