forked from eclipse-tractusx/portal
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (74 loc) · 4.23 KB
/
portal-backend-release-image-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
###############################################################
# 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 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
###############################################################
name: Portal Backend Release Auto-image-update
on:
workflow_dispatch:
inputs:
new-image:
description: 'new available image'
required: true
default: 'no content'
env:
ADMINISTRATION_IMAGE_BEGINN: 'administrationservicetag: '
ADMINISTRATION_IMAGE_FULL_NEW: 'administrationservicetag: ${{ inputs.new-image }}'
PORTALMAINTENANCE_IMAGE_BEGINN: 'portalmaintenancetag: '
PORTALMAINTENANCE_IMAGE_FULL_NEW: 'portalmaintenancetag: ${{ inputs.new-image }}'
APPMARKETPLACE_IMAGE_BEGINN: 'appmarketplaceservicetag: '
APPMARKETPLACE_IMAGE_FULL_NEW: 'appmarketplaceservicetag: ${{ inputs.new-image }}'
NOTIFICATION_IMAGE_BEGINN: 'notificationservicetag: '
NOTIFICATION_IMAGE_FULL_NEW: 'notificationservicetag: ${{ inputs.new-image }}'
PORTALMIGRATIONS_IMAGE_BEGINN: 'portalmigrationstag: '
PORTALMIGRATIONS_IMAGE_FULL_NEW: 'portalmigrationstag: ${{ inputs.new-image }}'
PROCESSES_IMAGE_BEGINN: 'processesworkertag: '
PROCESSES_IMAGE_FULL_NEW: 'processesworkertag: ${{ inputs.new-image }}'
PROVISIONING_IMAGE_BEGINN: 'provisioningservicetag: '
PROVISIONING_IMAGE_FULL_NEW: 'provisioningservicetag: ${{ inputs.new-image }}'
REGISTRATION_IMAGE_BEGINN: 'registrationservicetag: '
REGISTRATION_IMAGE_FULL_NEW: 'registrationservicetag: ${{ inputs.new-image }}'
SERVICES_IMAGE_BEGINN: 'servicesservicetag: '
SERVICES_IMAGE_FULL_NEW: 'servicesservicetag: ${{ inputs.new-image }}'
PROVISIONINGMIGRATIONS_IMAGE_BEGINN: 'provisioningmigrationstag: '
PROVISIONINGMIGRATIONS_IMAGE_FULL_NEW: 'provisioningmigrationstag: ${{ inputs.new-image }}'
jobs:
update-image-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Modify image tag in values.yaml
run: |
sed -i 's/${{ env.ADMINISTRATION_IMAGE_BEGINN }}.*/${{ env.ADMINISTRATION_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.PROCESSES_IMAGE_BEGINN }}.*/${{ env.PROCESSES_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.PORTALMAINTENANCE_IMAGE_BEGINN }}.*/${{ env.PORTALMAINTENANCE_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.APPMARKETPLACE_IMAGE_BEGINN }}.*/${{ env.APPMARKETPLACE_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.NOTIFICATION_IMAGE_BEGINN }}.*/${{ env.NOTIFICATION_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.PORTALMIGRATIONS_IMAGE_BEGINN }}.*/${{ env.PORTALMIGRATIONS_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.PROVISIONING_IMAGE_BEGINN }}.*/${{ env.PROVISIONING_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.REGISTRATION_IMAGE_BEGINN }}.*/${{ env.REGISTRATION_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.SERVICES_IMAGE_BEGINN }}.*/${{ env.SERVICES_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
sed -i 's/${{ env.PROVISIONINGMIGRATIONS_IMAGE_BEGINN }}.*/${{ env.PROVISIONINGMIGRATIONS_IMAGE_FULL_NEW }}/' charts/portal/values.yaml
- name: Commit and push updated values.yaml
run: |
git config user.name eclipse-tractusx-bot
git config user.email [email protected]
git add charts/portal/values.yaml
git commit -m "Add new images for portal backend"
bash ./environments/push.sh