forked from EclipseFdn/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_init.sh
executable file
·28 lines (23 loc) · 926 Bytes
/
build_init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /usr/bin/env bash
#*****************************************************************************
# Copyright (c) 2019 Eclipse Foundation and others.
# This program and the accompanying materials are made available
# under the terms of the Eclipse Public License 2.0
# which is available at http://www.eclipse.org/legal/epl-v20.html
# SPDX-License-Identifier: EPL-2.0
#*****************************************************************************
# Bash strict-mode
set -o errexit
set -o nounset
set -o pipefail
REPO_NAME="${REPO_NAME:-docker.io/eclipsefdn}"
build() {
docker build --pull -t "${REPO_NAME}/${1}:${2}" -f "${1}/${2}/Dockerfile" "${1}/${2}"
#if [[ "${BRANCH_NAME:-none}" = "master" ]]; then
docker push "${REPO_NAME}/${1}:${2}"
if [[ "${3:-}" == "latest" ]]; then
docker tag "${REPO_NAME}/${1}:${2}" "${REPO_NAME}/${1}:latest"
docker push "${REPO_NAME}/${1}:latest"
fi
#fi
}