Commit bc89ff73 authored by Cooper, Caleb's avatar Cooper, Caleb
Browse files

Update rse-bash-modules.sh

parent 35826997
......@@ -13,11 +13,14 @@ func_rse_docker_cleanup() {
}
func_rse_docker_build_push() {
if [[ "${1}" ]]; then
TAG="/${1}"
fi
while getopts ":t:f:" opt; do
case ${opt} in
t) TAG="/${OPTARG}";;
f) FILE="/${OPTARG}";;
esac
done
COMMIT_REF=$(echo "$CI_COMMIT_REF_NAME" | tr '[:upper:]' '[:lower:]' | tr '/' '_' | sed -e 's/^master$/latest/')
docker build -t ${CI_REGISTRY}/${CI_PROJECT_PATH}${TAG}/${COMMIT_REF} .
docker build -t ${CI_REGISTRY}/${CI_PROJECT_PATH}${TAG}/${COMMIT_REF} ."${FILE}"
docker login --username=$CI_REGISTRY_USER --password=$CI_REGISTRY_PASSWORD $CI_REGISTRY
docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}${TAG}/${COMMIT_REF}
}
......@@ -52,4 +55,4 @@ func_rse_set_authorized_keys() {
func_rse_remove_account() {
ACCOUNT="${1}"
sudo userdel -r ${ACCOUNT}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment