Skip to content

Commit

Permalink
added mechanism to build "ditto-ui" Docker image
Browse files Browse the repository at this point in the history
* also build "nightly" images

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Jul 20, 2022
1 parent 7fe9470 commit ccaa12c
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 29 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/docker-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1 # setup buildx in order to do build and push multi-architecture images
uses: docker/setup-buildx-action@v2 # setup buildx in order to do build and push multi-architecture images
-
name: Inspect buildx builder
run: |
Expand All @@ -39,7 +39,7 @@ jobs:
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
-
name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: eclipsedittobot
password: ${{ secrets.DOCKER_HUB_TOKEN }}
Expand All @@ -54,7 +54,7 @@ jobs:
echo $IMAGE_TAG
-
name: Build and push ditto-policies
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -68,7 +68,7 @@ jobs:
eclipse/ditto-policies:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-things
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -82,7 +82,7 @@ jobs:
eclipse/ditto-things:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-concierge
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -96,7 +96,7 @@ jobs:
eclipse/ditto-concierge:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-gateway
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -110,7 +110,7 @@ jobs:
eclipse/ditto-gateway:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-thingsearch
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -124,7 +124,7 @@ jobs:
eclipse/ditto-things-search:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-connectivity
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -136,3 +136,14 @@ jobs:
push: true
tags: |
eclipse/ditto-connectivity:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-ui
uses: docker/build-push-action@v3
with:
context: ./ui
file: Dockerfile
platforms: linux/amd64,linux/arm64
pull: true
push: true
tags: |
eclipse/ditto-ui:${{ env.IMAGE_TAG }}
2 changes: 1 addition & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
check-license-header-year:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: jitterbit/get-changed-files@v1
id: the-files
continue-on-error: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
Expand Down
56 changes: 40 additions & 16 deletions .github/workflows/push-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1 # setup buildx in order to do build and push multi-architecture images
uses: docker/setup-buildx-action@v2 # setup buildx in order to do build and push multi-architecture images
-
name: Inspect buildx builder
run: |
Expand All @@ -39,7 +39,7 @@ jobs:
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
-
name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: eclipsedittobot
password: ${{ secrets.DOCKER_HUB_TOKEN }}
Expand All @@ -62,7 +62,7 @@ jobs:
-
name: Build and push ditto-policies
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -80,7 +80,7 @@ jobs:
-
name: Build and push ditto-things
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -98,7 +98,7 @@ jobs:
-
name: Build and push ditto-concierge
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -116,7 +116,7 @@ jobs:
-
name: Build and push ditto-gateway
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -134,7 +134,7 @@ jobs:
-
name: Build and push ditto-thingsearch
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -152,7 +152,7 @@ jobs:
-
name: Build and push ditto-connectivity
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -167,10 +167,22 @@ jobs:
eclipse/ditto-connectivity:${{ env.IMAGE_MINOR_TAG }}
eclipse/ditto-connectivity:${{ env.IMAGE_MAJOR_TAG }}
eclipse/ditto-connectivity:latest
-
name: Build and push ditto-ui
if: env.MILESTONE_OR_RC_SUFFIX == env.IMAGE_TAG
uses: docker/build-push-action@v3
with:
context: ./ui
file: Dockerfile
platforms: linux/amd64,linux/arm64
pull: true
push: true
tags: |
eclipse/ditto-ui:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-policies milestone/RC
if: env.MILESTONE_OR_RC_SUFFIX != env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -185,7 +197,7 @@ jobs:
-
name: Build and push ditto-things milestone/RC
if: env.MILESTONE_OR_RC_SUFFIX != env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -200,7 +212,7 @@ jobs:
-
name: Build and push ditto-concierge milestone/RC
if: env.MILESTONE_OR_RC_SUFFIX != env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -215,7 +227,7 @@ jobs:
-
name: Build and push ditto-gateway milestone/RC
if: env.MILESTONE_OR_RC_SUFFIX != env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -230,7 +242,7 @@ jobs:
-
name: Build and push ditto-thingsearch milestone/RC
if: env.MILESTONE_OR_RC_SUFFIX != env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -245,7 +257,7 @@ jobs:
-
name: Build and push ditto-connectivity milestone/RC
if: env.MILESTONE_OR_RC_SUFFIX != env.IMAGE_TAG
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: dockerfile-release
Expand All @@ -257,3 +269,15 @@ jobs:
push: true
tags: |
eclipse/ditto-connectivity:${{ env.IMAGE_TAG }}
-
name: Build and push ditto-ui milestone/RC
if: env.MILESTONE_OR_RC_SUFFIX != env.IMAGE_TAG
uses: docker/build-push-action@v3
with:
context: ./ui
file: Dockerfile
platforms: linux/amd64,linux/arm64
pull: true
push: true
tags: |
eclipse/ditto-ui:${{ env.IMAGE_TAG }}
17 changes: 17 additions & 0 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,27 @@ build_docker_image() {
fi
}

build_ditto_ui_docker_image() {
image_tag=$(printf "${CONTAINER_REGISTRY}/ditto-ui")
printf "\nBuilding Docker image <%s> for Ditto-UI\n" \
"$image_tag"

$DOCKER_BIN build --pull -f $SCRIPTDIR/ui/Dockerfile \
--build-arg HTTP_PROXY="$HTTP_PROXY_LOCAL" \
--build-arg HTTPS_PROXY="$HTTPS_PROXY_LOCAL" \
-t "$image_tag":$IMAGE_VERSION \
"${SCRIPTDIR}/ui"

if [[ "$PUSH_CONTAINERS" == "true" ]]; then
$DOCKER_BIN push "$image_tag":$IMAGE_VERSION
fi
}

build_all_docker_images() {
for i in "${SERVICES[@]}"; do
build_docker_image "$i"
done
build_ditto_ui_docker_image
}

set_proxies() {
Expand Down
19 changes: 19 additions & 0 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2022 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# 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-2.0
#
# SPDX-License-Identifier: EPL-2.0

FROM nginxinc/nginx-unprivileged:latest

WORKDIR /usr/share/nginx/html

COPY ./index.html .
COPY ./index.css .
COPY ./main.js .
COPY ./modules ./modules

0 comments on commit ccaa12c

Please sign in to comment.