Skip to content

Commit

Permalink
Updated Gaffer version to v2.3.0 (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
wb36499 authored Aug 14, 2024
2 parents 7707a16 + 720a7a6 commit b1c6fe9
Show file tree
Hide file tree
Showing 27 changed files with 139 additions and 153 deletions.
42 changes: 21 additions & 21 deletions .github/release-notes.yml → .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020-2023 Crown Copyright
# Copyright 2020-2024 Crown Copyright
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,23 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

releasenotes:
sections:
- title: "Headliners"
emoji: ":star:"
labels: [ "headliner" ]
- title: "New Features"
emoji: ":gift:"
labels: [ "feature" ]
- title: "Enhancements"
emoji: ":sparkles:"
labels: [ "enhancement" ]
- title: "Bugs Fixed"
emoji: ":beetle:"
labels: [ "bug" ]
- title: "Documentation"
emoji: ":book:"
labels: "documentation"
- title: "Automation"
emoji: ":robot:"
labels: [ "automation" ]
changelog:
categories:
- title: Headliners
labels:
- headliner
- title: New Features
labels:
- feature
- title: Enhancements
labels:
- enhancement
- title: Bugs Fixed
labels:
- bug
- title: Documentation
labels:
- documentation
- title: Automation
labels:
- automation
47 changes: 21 additions & 26 deletions .github/workflows/create-release-branch.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2023 Crown Copyright
# Copyright 2021-2024 Crown Copyright
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,11 +15,9 @@
name: Create Release Branch

on:
workflow_dispatch:
inputs:
version:
description: 'Release Branch Version'
required: false
milestone:
types:
- closed

jobs:
create-release-branch:
Expand All @@ -33,25 +31,9 @@ jobs:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0

- name: Set version from input
if: ${{ github.event.inputs.version }}
run: echo "RELEASE_VERSION=$(echo ${{ github.event.inputs.version }} | sed 's/^v//')" >> $GITHUB_ENV

- name: Get latest tag
if: ${{ !github.event.inputs.version }}
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Format latest tag
if: ${{ !github.event.inputs.version }}
run: echo "CURRENT_VERSION=$(echo ${{ steps.get-latest-tag.outputs.tag }} | sed 's/^v//')" >> $GITHUB_ENV

- name: Bump latest tag variable version
if: ${{ !github.event.inputs.version }}
run: echo "RELEASE_VERSION=$(echo ${{ env.CURRENT_VERSION }} | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/echo \1.$((\2+1)).0/' | sh)" >> $GITHUB_ENV

- name: Verify version regex
run: echo ${{ env.RELEASE_VERSION }} | grep -E '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
- name: Set version from milestone
if: ${{ github.event.milestone.title }}
run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | sed 's/^v//')" >> $GITHUB_ENV

- name: Set release branch
run: echo "BRANCH_NAME=$(echo release/${{ env.RELEASE_VERSION }} )" >> $GITHUB_ENV
Expand All @@ -62,10 +44,23 @@ jobs:
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Update versions
run: ./cd/update_versions.sh ${RELEASE_VERSION}
run: |
./cd/update_versions.sh ${RELEASE_VERSION}
- name: Push to release branch
run: |
git checkout -b $BRANCH_NAME
git commit -a -m "prepare release v${RELEASE_VERSION}" --allow-empty
git push --set-upstream origin $BRANCH_NAME
- name: Tag release branch
run: |
git tag v${RELEASE_VERSION}
git push origin v${RELEASE_VERSION}
git push
- name: Create PR to master
run: |
gh pr create -B master -H $BRANCH_NAME --title 'Updated Gaffer version to ${{ github.event.milestone.title }}' --body 'Created by GH Action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106 changes: 36 additions & 70 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release
name: Full Release

on:
milestone:
types:
- closed
workflow_dispatch:
pull_request:
branches:
- master
types: [closed]

jobs:
create-release-tag:
get-release-version:
runs-on: ubuntu-latest
if: github.event_name == 'milestone'
if: ${{ github.event.pull_request.merged }}
outputs:
branch_name: ${{ steps.branch.outputs.branch_name }}
release_version: ${{ steps.release-version.outputs.release_version }}

steps:
- name: Checkout master
Expand All @@ -34,66 +34,48 @@ jobs:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Set release version
run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV

- name: Set branch name
run: echo "BRANCH_NAME=$(git branch -a | grep $RELEASE_VERSION | tail -n 1 | cut -c 18-)" >> $GITHUB_ENV
- name: Output branch name
id: branch
run: echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Fail if no branch found
if: ${{ !env.BRANCH_NAME }}
run: exit 1
- name: Format latest tag
run: echo "CURRENT_VERSION=$(echo ${{ steps.get-latest-tag.outputs.tag }} | sed 's/^v//')" >> $GITHUB_ENV

- name: Merge release into master
run: |
git checkout ${{ env.BRANCH_NAME }}
git checkout master
git merge ${{ env.BRANCH_NAME }}
- name: Push changes
run: |
git tag v${RELEASE_VERSION}
git push origin v${RELEASE_VERSION}
git push
- name: Set release version
id: release-version
run: echo "release_version=$(echo $CURRENT_VERSION)" >> $GITHUB_OUTPUT

update-branches:
runs-on: ubuntu-latest
if: github.event_name == 'milestone'
strategy:
matrix:
branch:
- develop
- gh-pages
needs:
- create-release-tag
- get-release-version

steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Merge release into branch
- name: Merge master into branches
run: |
git checkout ${{ needs.create-release-tag.outputs.branch_name }}
git checkout ${{ matrix.branch }}
git merge ${{ needs.create-release-tag.outputs.branch_name }} --strategy-option theirs
git merge origin/master
git push
publish-images-to-dockerhub:
Expand All @@ -103,7 +85,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: develop

- name: Build images with Accumulo 2 dependency
run: ./cd/build_images.sh ./docker/accumulo2.env

Expand All @@ -118,46 +100,31 @@ jobs:
GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: ./cd/publish_images.sh

create-release-notes:
update-github-releases:
runs-on: ubuntu-latest
if: github.event_name == 'milestone'
needs:
- create-release-tag
- update-branches

outputs:
release_upload_url: ${{ steps.upload_notes.outputs.upload_url }}
- get-release-version

steps:
- uses: actions/checkout@v4
with:
ref: develop

- name: Create Release Notes
id: create_release_notes
uses: docker://decathlon/release-notes-generator-action:3.1.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: master

- name: Set version
run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV
run: echo "RELEASE_VERSION=$(echo ${{ needs.get-release-version.outputs.release_version }})" >> $GITHUB_ENV

- name: Upload notes
id: upload_notes
- name: Create github release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.RELEASE_VERSION }}
name: Gaffer Docker ${{ env.RELEASE_VERSION }}
body_path: release_file.md

upload-release-artifacts:
runs-on: ubuntu-latest
if: github.event_name == 'milestone'
needs:
- create-release-tag
- create-release-notes
- get-release-version
strategy:
matrix:
chart:
Expand All @@ -171,33 +138,32 @@ jobs:
- uses: actions/checkout@v4
with:
ref: develop

- name: Install dependencies
run: ./cd/install_dependencies.sh

- name: Create Asset
env:
chart: ${{ matrix.chart }}
run: |
helm package "kubernetes/${chart}"
filename=$(ls | grep ${chart}-[0-9]*.[0-9]*.[0-9]*.tgz)
echo "ASSET_FILENAME=${filename}" >> $GITHUB_ENV
- name: Upload chart artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.chart }}
path: ${{ env.ASSET_FILENAME }}
retention-days: 1

- name: Upload Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.milestone.title }} ${{ env.ASSET_FILENAME }}
run: gh release upload ${{ steps.release-version.outputs.release_version }} ${{ env.ASSET_FILENAME }}

update-helm-repo:
runs-on: ubuntu-latest
if: github.event_name == 'milestone'
needs:
- upload-release-artifacts

Expand All @@ -207,7 +173,7 @@ jobs:
with:
ref: gh-pages
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
Expand All @@ -221,7 +187,7 @@ jobs:
- name: Update repo
run: |
mv artifacts/*/*.tgz .
helm repo index . --url "https://github.com/gchq/gaffer-docker/releases/download/${{ github.event.milestone.title }}" --merge index.yaml
helm repo index . --url "https://github.com/gchq/gaffer-docker/releases/download/${{ steps.release-version.outputs.release_version }}" --merge index.yaml
sed -i'' -e 's|file://.*|https://gchq.github.io/gaffer-docker|g' index.yaml
rm *.tgz
rm -r artifacts
Expand Down
8 changes: 8 additions & 0 deletions cd/update_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ source ./docker/accumulo2.env
# JHUB_OPTIONS_SERVER_VERSION
source ./docker/gaffer-jhub-options-server/get-version.sh

# Update docker versions
find . -type f -exec sed -i "s/GAFFER_VERSION=[0-9]\.[0-9]\.[0-9]/GAFFER_VERSION=${APP_VERSION}/g" {} +
find . -type f -exec sed -E -i "s/GAFFERPY_VERSION=(gafferpy-)?[0-9]\.[0-9]\.[0-9]/GAFFERPY_VERSION=\1${APP_VERSION}/g" {} +
find . -type f -exec sed -i "s/GAFFER_TESTER_VERSION=[0-9]\.[0-9]\.[0-9]/GAFFER_TESTER_VERSION=${APP_VERSION}/g" {} +
sed -i'' -e "s/<gaffer.version>[0-9]\.[0-9]\.[0-9]/<gaffer.version>${APP_VERSION}/g" docker/gaffer-gremlin/pom.xml
sed -i'' -e "s/BASE_IMAGE_TAG=[0-9]\.[0-9]\.[0-9]/BASE_IMAGE_TAG=${APP_VERSION}/g" docker/gaffer-kerberos/gaffer-krb/Dockerfile
sed -i'' -e "s/BASE_IMAGE_TAG=[0-9]\.[0-9]\.[0-9]/BASE_IMAGE_TAG=${APP_VERSION}/g" docker/gaffer-kerberos/gaffer-rest-krb/Dockerfile

# hdfs
[ ! -z "${APP_VERSION}" ] && yq eval ".version = \"${APP_VERSION}\"" -i ./kubernetes/hdfs/Chart.yaml
yq eval ".appVersion = \"${HADOOP_VERSION}\"" -i ./kubernetes/hdfs/Chart.yaml
Expand Down
6 changes: 3 additions & 3 deletions docker/accumulo1.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ HADOOP_VERSION=3.2.2
ACCUMULO_VERSION=1.9.3
HADOOP_CONF_DIR=/etc/hadoop/conf
ACCUMULO_CONF_DIR=/etc/accumulo/conf
GAFFER_VERSION=2.2.2
GAFFER_TESTER_VERSION=2.2.2
GAFFERPY_VERSION=2.2.2
GAFFER_VERSION=2.3.0
GAFFER_TESTER_VERSION=2.3.0
GAFFERPY_VERSION=2.3.0
SPARK_VERSION=3.1.2
TINKERPOP_VERSION=3.7.1
KUBECTL_VERSION=1.23.0
6 changes: 3 additions & 3 deletions docker/accumulo2.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ HADOOP_VERSION=3.3.3
ACCUMULO_VERSION=2.0.1
HADOOP_CONF_DIR=/etc/hadoop/conf
ACCUMULO_CONF_DIR=/etc/accumulo/conf
GAFFER_VERSION=2.2.2
GAFFER_TESTER_VERSION=2.2.2
GAFFERPY_VERSION=2.2.2
GAFFER_VERSION=2.3.0
GAFFER_TESTER_VERSION=2.3.0
GAFFERPY_VERSION=2.3.0
SPARK_VERSION=3.1.2
TINKERPOP_VERSION=3.7.1
KUBECTL_VERSION=1.23.0
Loading

0 comments on commit b1c6fe9

Please sign in to comment.