source: ProjectBuilder/devel/contrib/mkctn@ 2386

Last change on this file since 2386 was 2386, checked in by Bruno Cornec, 5 years ago

Print a warning if docker image doesn't exists for mkctn

  • Property svn:executable set to *
File size: 1.1 KB
RevLine 
[2351]1#!/bin/bash
2#
[2373]3PBPRJ=$1
4DISTRO=$2
5DISTROVER=$3
6ORIGREPO=$4
[2369]7ARCH=x86_64
[2124]8
[2369]9M=$DISTRO-$DISTROVER-$ARCH
[2124]10
[2373]11if [ _"$PBPRJ" = _"" ]; then
12 echo "Syntax: mkctn project distro version [repo]"
13 exit -1
14fi
[2369]15if [ _"$DISTRO" = _"mageia" ]; then
16 ORIGREPO=mageiaofficial
17 DISTROVER=${DISTROVER}-$ARCH
18elif [ _"$DISTRO" = _"opensuse" ]; then
19 vm=`echo $DISTROVER | cut -d . -f1`
20 if [ $vm -ge 15 ] && [ $vm -lt 42 ]; then
21 ORIGREPO=opensuse/leap
[2372]22 else
23 ORIGREPO=$DISTRO
[2369]24 fi
25else
26 ORIGREPO="$DISTRO"
[2351]27fi
28
[2369]29echo "Working on $M ..."
[2356]30echo "-----------------------------------"
[2369]31if [ _"$DISTRO" != _"mageia" ]; then
32 docker pull ${ORIGREPO}:$DISTROVER
[2386]33 if [ $? -ne 0 ]; then
34 echo "WARNING: No image found in Docker Hub"
35 echo "Sleeping 5 seconds ..."
36 echo " "
37 echo " "
38 sleep 5
39 fi
[2369]40fi
41pb -p pb -T docker --stop-on-error -m $M newve -i ${ORIGREPO}:$DISTROVER && \
[2374]42pb -p pb -T docker --stop-on-error -m $M sbx2setupve all
43if [ $PBPRJ != "pb" ]; then
44 pb -p $PBPRJ -T docker --stop-on-error -m $M sbx2build all
45fi
[2373]46pb -p $PBPRJ -T docker --stop-on-error -m $M prepve && \
47pb -p $PBPRJ -T docker --stop-on-error -m $M build2ve
[2356]48docker image prune -f
Note: See TracBrowser for help on using the repository browser.