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

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

last fixes for logrotate and docker scripts

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 695 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    $GITDIR/mageia-docker -v $v -w $WORKDIR $opt
32    sudo rm -rf $WORKDIR/$v
33done
34
35# Clean after run in Docker
36docker container prune -f
37docker image prune -f
38docker images
Note: See TracBrowser for help on using the repository browser.