Commit 06ee356c authored by David Danier's avatar David Danier

mysql

parents
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest
services:
- docker:dind
stages:
- build
build:
stage: build
script:
- /bin/sh build.sh
FROM mysql:5.6
COPY docker-entrypoint-set-charset.sh /docker-entrypoint-initdb.d/docker-entrypoint-set-charset.sh
FROM mysql:5.7
COPY docker-entrypoint-set-charset.sh /docker-entrypoint-initdb.d/docker-entrypoint-set-charset.sh
FROM mysql:8
COPY docker-entrypoint-set-charset.sh /docker-entrypoint-initdb.d/docker-entrypoint-set-charset.sh
#!/bin/bash
# Configuration
VERSIONS="5 10"
LATEST_VERSION="10"
# Let's do it
if [ -z "$CI_REGISTRY" ]
then # outside gitlab ci runner
docker login docker.team23.de
BUILD_PROJECT_NAME=$( basename $( pwd ) )
BUILD_IMAGE_BASE="docker.team23.de/docker/$BUILD_PROJECT_NAME"
else # inside gitlab ci runner
docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
BUILD_IMAGE_BASE="$CI_REGISTRY/$CI_PROJECT_PATH"
fi
for VERSION in $VERSIONS
do
# Copy shared files
cp -rp shared/* "$VERSION/"
# Build Image
docker build --pull -t "$BUILD_IMAGE_BASE:$VERSION" "$VERSION"
docker push "$BUILD_IMAGE_BASE:$VERSION"
done
# Build latest image
docker build --pull -t "$BUILD_IMAGE_BASE:latest" "$LATEST_VERSION"
docker push "$BUILD_IMAGE_BASE:latest"
#!/usr/bin/env sh
echo "ALTER DATABASE \`${MYSQL_DATABASE}\` CHARACTER SET utf8 COLLATE utf8_unicode_ci;" | mysql -u "${MYSQL_USER}" -p"${MYSQL_PASSWORD}"
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