Skip to content

Commit

Permalink
Release istio images workflow (istio#111)
Browse files Browse the repository at this point in the history
* 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
ashleywang1 committed Dec 14, 2021
1 parent f72189a commit 897c46d
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/release-istio-images.yaml
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
2 changes: 1 addition & 1 deletion .solo-io/Dockerfile.proxy-centos-arm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG VERSION
LABEL "io.istio.repo"="https://github.com/istio/tools"
LABEL "io.istio.version"="${VERSION}"

# hadolint ignore=DL3031,DL3033
# hadolint ignore=DL3031,DL3033,DL3041
RUN dnf install -y epel-release && \
dnf update -y && \
dnf install -y git glibc fedpkg sudo java-1.8.0-openjdk-headless rsync wget \
Expand Down
46 changes: 46 additions & 0 deletions .solo-io/release-istio-images.sh
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

0 comments on commit 897c46d

Please sign in to comment.