source: branches/3.3/ansible/roles/mageia-docker/files/mageia-docker.sh @ 3676

Last change on this file since 3676 was 3676, checked in by bruno, 22 months ago

minor printing improvement for ansible

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 731 bytes
Line 
1#!/bin/bash
2#
3# Script to automate mageia docker images creation.
4#
5
6# Variables management
7WORKDIR=$HOME/tmp
8if [ -f $HOME/.mageia-docker ]; then
9    . $HOME/.mageia-docker
10fi
11if [ _"$GITDIR" = _"" ]; then
12    GITDIR=$HOME/mageia-docker
13fi
14
15# Cleanup before doing anything
16sudo rm -rf $GITDIR
17
18# Clone again from git
19git clone -q git@github.com:bcornec/mageia-docker.git $GITDIR
20
21# Detect mirror server if any
22if [ _"$1" != _"" ]; then
23    opt="-m $1"
24else
25    opt=""
26fi
27
28# Launch script
29for v in 5 6 cauldron; do
30    sudo rm -rf $WORKDIR/$v
31    echo "---------------------------"
32    $GITDIR/mageia-docker -v $v -w $WORKDIR $opt
33    sudo rm -rf $WORKDIR/$v
34done
35
36# Clean after run in Docker
37docker container prune -f
38docker image prune -f
39docker images
Note: See TracBrowser for help on using the repository browser.