New pipeline which may/may not work
This commit is contained in:
parent
f86c841167
commit
a7d09be523
@ -0,0 +1,9 @@
|
||||
include:
|
||||
- local: 'ci/builder.yml'
|
||||
|
||||
build-ansible-image:
|
||||
extends: .builder
|
||||
script:
|
||||
- build-image.sh ansible
|
||||
|
||||
|
34
build-image.sh
Normal file
34
build-image.sh
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# This script is a generic builder script which only builds
|
||||
# images if the latest commit modifies the given folder in some way
|
||||
|
||||
target="$1"
|
||||
tag="$2"
|
||||
|
||||
# Ensure we have a target
|
||||
if [ -z "$target" ]; then
|
||||
echo "$target is not defined ( empty )"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure the target is real
|
||||
if [ ! -d "$target" ]; then
|
||||
echo "$target is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the tag if not already set
|
||||
if [ -z "$tag" ]; then
|
||||
tag=latest
|
||||
echo "Tag for \"$target\" defaulting to \"latest\""
|
||||
fi
|
||||
|
||||
# Finally set the project root
|
||||
PROJECT_ROOT=`pwd`
|
||||
|
||||
cd "$target"
|
||||
docker build . -t "$tag"
|
||||
cd "$PROJECT_ROOT"
|
14
ci/builder.yml
Normal file
14
ci/builder.yml
Normal file
@ -0,0 +1,14 @@
|
||||
# This template is for the main builder jobs to inherit generic properties from
|
||||
|
||||
stages:
|
||||
- publish
|
||||
|
||||
.builder:
|
||||
image: docker:stable
|
||||
stage: publish
|
||||
services:
|
||||
- docker:dind
|
||||
only:
|
||||
refs:
|
||||
- master
|
||||
|
Loading…
Reference in New Issue
Block a user