Skip to content

Commit

Permalink
chore(helm-workflow): build the images for init containers within wor…
Browse files Browse the repository at this point in the history
…kflow

#89
  • Loading branch information
evegufy committed Apr 11, 2024
1 parent 261685a commit 36d95ff
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/centralidp-chart-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:
version: v0.19.0
node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.27.3' }}

- name: Build init container image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: .
file: docker/Dockerfile.import
push: true
tags: kind-registry:5000/iam:testing

- name: Set up Helm
uses: azure/setup-helm@b7246b12e77f7134dc2d460a3d5bad15bbe29390 # v4
with:
Expand Down Expand Up @@ -85,7 +93,7 @@ jobs:

# define charts to test with the --charts parameter
- name: Run chart-testing (install)
run: ct install --charts charts/centralidp --config charts/chart-testing-config.yaml
run: helm install portal charts/centralidp -f charts/values-test-centralidp.yaml --namespace install --create-namespace --debug
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'

# Upgrade the released centralidp chart version with the locally available chart
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/sharedidp-chart-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:
version: v0.19.0
node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.27.3' }}

- name: Build init container image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: .
file: docker/Dockerfile.import
push: true
tags: kind-registry:5000/iam:testing

- name: Set up Helm
uses: azure/setup-helm@b7246b12e77f7134dc2d460a3d5bad15bbe29390 # v4
with:
Expand Down Expand Up @@ -85,7 +93,7 @@ jobs:

# define charts to test with the --charts parameter
- name: Run chart-testing (install)
run: ct install --charts charts/sharedidp --config charts/chart-testing-config.yaml
run: helm install portal charts/sharedidp -f charts/values-test-sharedidp.yaml --namespace install --create-namespace --debug
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'

# Upgrade the released sharedidp chart version with the locally available chart
Expand Down
38 changes: 38 additions & 0 deletions charts/values-test-centralidp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
###############################################################
# Copyright (c) 2024 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 Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
###############################################################

keycloak:
initContainers:
- name: import
image: kind-registry:5000/iam:testing
imagePullPolicy: IfNotPresent
command:
- sh
args:
- -c
- |
echo "Copying themes..."
cp -R /import/themes/catenax-central/* /themes
echo "Copying realms..."
cp -R /import/catenax-central/realms/* /realms
volumeMounts:
- name: themes
mountPath: "/themes"
- name: realms
mountPath: "/realms"
42 changes: 42 additions & 0 deletions charts/values-test-sharedidp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
###############################################################
# Copyright (c) 2024 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 Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
###############################################################

keycloak:
initContainers:
- name: import
image: kind-registry:5000/iam:testing
imagePullPolicy: IfNotPresent
command:
- sh
args:
- -c
- |
echo "Copying themes-catenax-shared..."
cp -R /import/themes/catenax-shared/* /themes-catenax-shared
echo "Copying themes-catenax-shared-portal..."
cp -R /import/themes/catenax-shared-portal/* /themes-catenax-shared-portal
echo "Copying realms..."
cp -R /import/catenax-shared/realms/* /realms
volumeMounts:
- name: themes-catenax-shared
mountPath: "/themes-catenax-shared"
- name: themes-catenax-shared-portal
mountPath: "/themes-catenax-shared-portal"
- name: realms
mountPath: "/realms"

0 comments on commit 36d95ff

Please sign in to comment.