Skip to content

Commit

Permalink
Merge pull request #191 from syntasso/branching
Browse files Browse the repository at this point in the history
feat: remove versioning in OS Kratix
  • Loading branch information
richcooper95 authored Jul 11, 2024
2 parents 9c50158 + 1267dfc commit a67953d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
9 changes: 3 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ executors:
filter-for-tags: &filter-for-tags
filters:
tags:
only: /^v.*/
only: latest
branches:
ignore: /.*/

Expand Down Expand Up @@ -369,7 +369,7 @@ jobs:
- run:
name: bump minor version and push tag
command: |
./scripts/tag-new-version
./scripts/tag-latest-version
gh-release:
docker:
Expand All @@ -383,13 +383,12 @@ jobs:
name: Release
command: |
gh config set prompt disabled
gh release delete <<pipeline.git.tag>> || true
gh release create <<pipeline.git.tag>> --title <<pipeline.git.tag>> ./distribution/**/*.yaml ./distribution/*.yaml
helm-release:
docker:
- image: cimg/base:current
environment:
VERSION: << pipeline.git.tag >>
resource_class: large
steps:
- attach_workspace:
Expand All @@ -402,8 +401,6 @@ jobs:
git add kratix/
git diff --cached --quiet && exit 0 || true
./scripts/bump-minor kratix/
git add kratix/
git commit -m"update kratix package"
git push origin main
Expand Down
4 changes: 4 additions & 0 deletions scripts/make-distribution
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ cd $ROOT
source "$ROOT/scripts/utils.sh"

export VERSION="${VERSION:-$(commit_sha)}"
export PIPELINE_ADAPTER_VERSION_MANIFEST_DIGEST=$(docker manifest inspect syntasso/kratix-platform-pipeline-adapter | jq -r '.manifests[] | select(.platform.architecture=="amd64").digest')
export KRATIX_PLATFORM_MANIFEST_DIGEST=$(docker manifest inspect syntasso/kratix-platform | jq -r '.manifests[] | select(.platform.architecture=="amd64").digest')
export WC_IMG=docker.io/syntasso/kratix-platform-pipeline-adapter@${PIPELINE_ADAPTER_VERSION_MANIFEST_DIGEST}
export IMG_TAG=docker.io/syntasso/kratix-platform@${KRATIX_PLATFORM_MANIFEST_DIGEST}

make distribution

Expand Down
8 changes: 3 additions & 5 deletions scripts/tag-new-version → scripts/tag-latest-version
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ set -eux
# ensure we are on the latest main
git pull origin main

latest_tag=$(git describe --tags --abbrev=0)
latest_tag="latest"
current_commit=${CIRCLE_SHA1:-$(git rev-parse HEAD)}

commit_list=$(git rev-list "$latest_tag".."$current_commit")

# Check if the commit list is not empty
if [ -n "$commit_list" ]; then
echo "Current commit is ahead of the previous tag; pushing a new tag"
minor=$(echo "${latest_tag}" | cut -d '.' -f 2)
new_tag="v0.$(($minor+1)).0"
git tag -a $new_tag -m"${new_tag}"
git push origin $new_tag
git tag -a $latest_tag -m "${latest_tag}" --force
git push origin $latest_tag --force
else
echo "Current commit is not ahead of the previous tag; not pushing a new tag"
fi

0 comments on commit a67953d

Please sign in to comment.