Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move build of setup image into docker-compose #171

Merged
merged 1 commit into from Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.rst
Expand Up @@ -159,9 +159,7 @@ to initialize the required cloud resources.
REGISTRATION_PASSWORD={some password for the registration endpoint}
EOM

docker build -t setup -f docker/setup/Dockerfile .

docker run \
docker-compose run \
-e SP_APPID={appId field of your service principal} \
-e SP_PASSWORD={password field of your service principal} \
-e SP_TENANT={tenant field of your service principal} \
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Expand Up @@ -80,6 +80,13 @@ services:
- azurite
- rabbitmq

setup:
image: ${DOCKER_REPO}/opwenserver_setup:${BUILD_TAG}
build:
context: .
dockerfile: docker/setup/Dockerfile
command: /app/setup.sh --help

rabbitmq:
image: rabbitmq:3.7.8-management

Expand Down
5 changes: 5 additions & 0 deletions docker/setup/setup.sh
Expand Up @@ -31,6 +31,11 @@ scriptname="${BASH_SOURCE[0]}"
# shellcheck disable=SC1090
. "${scriptdir}/utils.sh"

if [[ "$1" = "--help" ]]; then
usage "${scriptname}"
exit 0
fi

#
# verify inputs
#
Expand Down
7 changes: 2 additions & 5 deletions travis/cd.sh
Expand Up @@ -19,9 +19,6 @@ docker login --username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD"
for tag in "latest" "$TRAVIS_TAG"; do
BUILD_TAG="$tag" DOCKER_REPO="$DOCKER_USERNAME" docker-compose build
BUILD_TAG="$tag" DOCKER_REPO="$DOCKER_USERNAME" docker-compose push

docker build -t "$DOCKER_USERNAME/opwenserver_setup:$tag" -f "./docker/setup/Dockerfile" "."
docker push "$DOCKER_USERNAME/opwenserver_setup:$tag"
done

#
Expand All @@ -35,13 +32,13 @@ fi
kubeconfig_path="$PWD/kube-config"
curl -sfL "$KUBECONFIG_URL" -o "$kubeconfig_path"

docker run \
docker-compose run \
-e IMAGE_REGISTRY="$DOCKER_USERNAME" \
-e DOCKER_TAG="$TRAVIS_TAG" \
-e HELM_NAME="$HELM_NAME" \
-e LOKOLE_DNS_NAME="$LOKOLE_DNS_NAME" \
-v "$kubeconfig_path:/secrets/kube-config" \
"$DOCKER_USERNAME/opwenserver_setup:$TRAVIS_TAG" \
setup \
/app/upgrade.sh

rm "$kubeconfig_path"
Expand Down