From ea84e622eea18f22028c09ed85882d4e42f29787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 12 Apr 2024 18:57:34 -0300 Subject: [PATCH] Removed final docker scripts. --- bin/clean_containers.sh | 29 ------------- bin/clean_docker.sh | 30 ------------- runme_docker.sh | 96 ----------------------------------------- 3 files changed, 155 deletions(-) delete mode 100755 bin/clean_containers.sh delete mode 100755 bin/clean_docker.sh delete mode 100755 runme_docker.sh diff --git a/bin/clean_containers.sh b/bin/clean_containers.sh deleted file mode 100755 index 81d492f08..000000000 --- a/bin/clean_containers.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# mrv2 -# Copyright Contributors to the mrv2 Project. All rights reserved. - -# -# This file will stop and remove all docker containers, images and logs. -# -# You must run it from the root of the mrv2 project. -# - - -DOCKER_EXECUTABLE=docker - -# -# Stop all running containers -# -echo "Stopping all containers..." -containers=`${DOCKER_EXECUTABLE} ps -aq` -if [[ $containers != "" ]]; then - ${DOCKER_EXECUTABLE} stop $containers - - # - # Remove all containers - # - echo "Removing all containers..." - ${DOCKER_EXECUTABLE} rm $containers -fi - diff --git a/bin/clean_docker.sh b/bin/clean_docker.sh deleted file mode 100755 index 5d1f4e68e..000000000 --- a/bin/clean_docker.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# mrv2 -# Copyright Contributors to the mrv2 Project. All rights reserved. - -# -# This file will stop and remove all docker containers, images and logs. -# -# You must run it from the root of the mrv2 project. -# - -bin/clean_containers.sh - -DOCKER_EXECUTABLE=docker - -# -# Remove the images if present -# -echo "Removing all images..." -images=`${DOCKER_EXECUTABLE} images -q` -if [[ $images != "" ]]; then - ${DOCKER_EXECUTABLE} rmi ${images} -fi - -# -# Remove all docker caches -# - -echo "Clear all docker caches..." -${DOCKER_EXECUTABLE} builder prune diff --git a/runme_docker.sh b/runme_docker.sh deleted file mode 100755 index f9eaaaec6..000000000 --- a/runme_docker.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# mrv2 -# Copyright Contributors to the mrv2 Project. All rights reserved. - -# -# -# Main build script for mrv2 using Docker. -# We build binaries on a Rocky Linux 8 image. -# We build the latest tag released by default. -# -# This script, if run without parameters, will build the latest release. -# If run as: -# -# $ runme_docker.sh main -# -# It will build the main HEAD. -# -# If run with any other parameter, it will assume it is a tag or branch name -# and it will build it. -# -# - -# -# Turn on exit on error -# -set -o pipefail -e - -export WHAT=release -for i in $@; do - case $i in - -h|-help|--help) - echo "$0 - Run a docker compilation of mrv2" - echo "" - echo "$0 [main|release|branch|tag]" - echo - echo "The default behavior is release, which builds the latest" - echo "tagged release." - echo "Option main will build the latest head from branch main." - echo "ANy other option is considered a branch or tag." - exit 0 - ;; - latest|HEAD|main) - export WHAT=main - shift - ;; - release) - export WHAT=release - shift - ;; - *) - export WHAT=$i - shift - ;; - esac -done - -export TAG=$WHAT -export TYPE=branch -if [[ $WHAT == release ]]; then - export TAG=`git ls-remote --tags --refs | tail -n1 | cut -d/ -f3` -elif [[ $WHAT != main ]]; then - export has_tag=`git ls-remote --tags origin | grep "${TAG}"` - if [[ "$has_tag" == "" ]]; then - export has_tag=`git ls-remote origin | grep "${TAG}"` - if [[ "$has_tag" == "" ]]; then - echo "Tag or branch ${TAG} does not exist in repository." - exit 1 - fi - else - TYPE=tag - fi -fi - -# -# Build the image -# -echo "Docker will build the ${TYPE} ${TAG} from repository." -echo "" -echo "Are you sure you want to continue? (y/n)" -read input -if [[ $input == n* || $input == N* ]]; then - exit 0 -fi - -bin/clean_containers.sh - -docker build -t mrv2_builder . - -# -# Run the compile and package extraction. We must run it as 1001 user -# not root as creating the docs otherwise fails. -# -docker run -v ${PWD}/packages:/packages \ - --name mrv2_build \ - mrv2_builder $TAG