forked from istio/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release istio images workflow (istio#111)
* Script to release istio images * Address comments * Add github workflow * fetch repo fix * small command fix * lint * lint * add lint ignore line * add lint ignore line * bash script lint * lint fix * no need for exports * license
- Loading branch information
1 parent
f72189a
commit 897c46d
Showing
3 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Release Solo.io Istio Images | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: The version to publish (e.g. 1.12.0) | ||
required: true | ||
default: "" | ||
|
||
jobs: | ||
# First we need to get the list of tags that we need to create PRs for | ||
release_solo_istio_images: | ||
runs-on: ubuntu-latest | ||
name: Release Solo.io Istio Images | ||
steps: | ||
# Setup gcloud with credentials that will allow us to push our docker images | ||
- name: Setup - gcloud / gsutil | ||
uses: google-github-actions/setup-gcloud@master | ||
with: | ||
service_account_key: ${{ secrets.GC_PUBLISHER_GLOO_MESH_SA_JSON_KEY }} | ||
project_id: gloo-mesh | ||
export_default_credentials: true | ||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: gcr.io | ||
username: _json_key | ||
password: ${{ secrets.GC_PUBLISHER_ISTIO_ENTERPRISE_SA_JSON_KEY }} | ||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: gcr.io | ||
username: _json_key | ||
password: ${{ secrets.GC_PUBLISHER_GLOO_MESH_SA_JSON_KEY }} | ||
# Download the istio-enterprise-private images and publish them to gloo-mesh | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Download and Upload docker images | ||
id: set-tags | ||
env: | ||
VERSION: ${{ github.event.inputs.version }} | ||
run: | | ||
bash .solo-io/release-istio-images.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# Copyright Solo.io Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://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. | ||
|
||
set -e # Exit immediately for non zero status | ||
set -x # Print commands | ||
|
||
if [[ ${VERSION} == "" ]]; then | ||
echo "Need to pass in a VERSION (e.g. 1.12.0)" | ||
exit 1; | ||
fi | ||
|
||
SALT=p2InTc6rfVyk | ||
VERSION_MINOR="${VERSION%.*}" | ||
REPO=istio-$(echo istio-"${VERSION_MINOR}"-"${SALT}" | shasum | head -c12) | ||
|
||
if ! gcloud beta artifacts repositories describe --project gloo-mesh --location us "${REPO}"; then | ||
gcloud beta artifacts repositories create "${REPO}" --project gloo-mesh --repository-format docker --location us --labels istio-build-pipeline=solo-io | ||
fi | ||
|
||
for image in "proxyv2" "pilot" "operator" | ||
do | ||
for buildtype in "" "-distroless" "-fips" "-fips-distroless" "-solo" "-solo-distroless" "-solo-fips" "-solo-fips-distroless" | ||
do | ||
IMAGE_TAG="${VERSION}""${buildtype}" | ||
docker pull gcr.io/istio-enterprise-private/"${image}":"${IMAGE_TAG}" | ||
docker tag gcr.io/istio-enterprise-private/"${image}":"${IMAGE_TAG}" us-docker.pkg.dev/gloo-mesh/"${REPO}"/"${image}":latest"${buildtype}" | ||
if ! docker push us-docker.pkg.dev/gloo-mesh/"${REPO}"/"${image}":latest"${buildtype}" | ||
then | ||
exit 1 | ||
fi | ||
|
||
done | ||
done |