Skip to content

Commit

Permalink
test 6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
DarylTodosichuk committed Oct 24, 2024
1 parent 66e7cb1 commit 0924448
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 54 deletions.
34 changes: 7 additions & 27 deletions .github/workflows/docker-build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,46 +60,26 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Get ShortCommitId
- name: Get short commitId
id: get-commit
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get buildArgs
run: |
echo "buildArgs UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{steps.get-commit.outputs.sha_short}}"
- name: Get current date
id: date-selector
run: echo "date=$(date +'%B %e, %Y')" >> $GITHUB_OUTPUT
- name: Generate Next Git Tag
id: tag-selector
- name: List merged hotfix branches
run: |
# Extract the major.minor.patch version parts using grep
MAJOR_VERSION=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '^[0-9]+')
MINOR_VERSION=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '\.[0-9]+\.' | grep -oE '[0-9]+')
VERSION_PATCH=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '[0-9]+$')
# Increment version elements
echo "${{env.UGM_RELEASE_PREFIX}}$MAJOR_VERSION.$MINOR_VERSION.$VERSION_PATCH"
VERSION_PATCH=$((VERSION_PATCH + 1))
echo "${{env.UGM_RELEASE_PREFIX}}$MAJOR_VERSION.$MINOR_VERSION.$VERSION_PATCH"
# Prepare tags
echo "gittag=${{env.UGM_RELEASE_PREFIX}}${MAJOR_VERSION}.${MINOR_VERSION}.${VERSION_PATCH}" >> $GITHUB_OUTPUT
echo "tagmsg=${{env.UGM_RELEASE_MESSAGE}} ${{steps.date-selector.outputs.date}}" >> $GITHUB_OUTPUT
echo "tagversion=$MAJOR_VERSION.$MINOR_VERSION.$VERSION_PATCH" >> $GITHUB_OUTPUT
- name: Create Git Tag
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions@users.noreply.github.com"
git tag -a "${{steps.tag-selector.outputs.gittag}}" -m "${{steps.tag-selector.outputs.tagmsg}}"
git push origin "${{steps.tag-selector.outputs.gittag}}"
git fetch --all
MERGED_BRANCHES=$(git branch -r --merged main | grep 'origin/hotfix/' | sed 's/origin\///')
echo "Merged hotfix branches: $MERGED_BRANCHES"
echo "MERGED_BRANCHES=$MERGED_BRANCHES" >> $GITHUB_ENV
- name: Set repository version variable
id: setversion
run: |
gh variable list --env ${{env.TARGET_ENV}}
gh variable set UGM_BUILD_REVISION --env ${{env.TARGET_ENV}} --body "${{steps.get-commit.outputs.sha_short}}"
gh variable set UGM_BUILD_VERSION --env ${{env.TARGET_ENV}} --body "${{steps.tag-selector.outputs.tagversion}}"
gh variable list --env ${{env.TARGET_ENV}}
echo "buildArgs UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGN_BUILD_REVISION}}"
echo "buildArgs UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGM_BUILD_REVISION}}"
Build:
needs: [Setup,GenerateTag]
runs-on: ubuntu-latest
Expand Down
58 changes: 32 additions & 26 deletions .github/workflows/docker-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ on:
- 'SECURITY.md'

env:
TARGET_ENV: test
TARGET_ENV: main
GH_TOKEN: ${{secrets.GH_API_TOKEN}}
OC_CLUSTER: ${{ vars.OPENSHIFT_CLUSTER }}
OC_REGISTRY: ${{ vars.OPENSHIFT_REGISTRY }}
OC_AUTH_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
Expand All @@ -31,15 +32,15 @@ env:
UGM_BUILD_REVISION: ${{vars.UGM_BUILD_REVISION}}

UGM_RELEASE_PREFIX: API_v
UGM_RELEASE_MESSAGE: Test
UGM_RELEASE_MESSAGE: "Production deployment"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
setup:
Setup:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
environment: test
environment: main
steps:
# Runs commands using the runners shell
- name: Get variables
Expand All @@ -50,53 +51,58 @@ jobs:
echo "Environment: $TARGET_ENV JFROG_REPO_PATH=$JFROG_REPO_PATH"
echo "..."
env | sort
# This workflow contains jobs called "GenerateTag" "PushTag" "Build"
GenerateTag:
needs: [Setup]
runs-on: ubuntu-latest
environment: test
environment: main
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Get short commitId
id: get-commit
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get current date
id: date-selector
run: echo "date=$(date +'%B %e, %Y')" >> $GITHUB_OUTPUT
- name: Generate Next Git Tag
id: tag-selector
run: |
# Extract the major and minor version parts using grep
# Extract the major.minor.patch version parts using grep
MAJOR_VERSION=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '^[0-9]+')
MINOR_VERSION=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '\.[0-9]+' | grep -oE '[0-9]+')
MINOR_VERSION=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '\.[0-9]+\.' | grep -oE '[0-9]+')
VERSION_PATCH=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '[0-9]+$')
VERSION_PATCH=$((VERSION_PATCH + 1))
# Construct the new tag
NEW_TAG="${{env.UGM_RELEASE_PREFIX}}${MAJOR_VERSION}.${MINOR_VERSION}.${VERSION_PATCH}"
echo "${{env.UGM_RELEASE_PREFIX}}${MAJOR_VERSION}.${MINOR_VERSION}.${VERSION_PATCH}"
echo "$(NEW_TAG)"
echo "gittag=${NEW_TAG}" >> $GITHUB_OUTPUT
# Increment version elements
echo "${{env.UGM_RELEASE_PREFIX}}$MAJOR_VERSION.$MINOR_VERSION.$VERSION_PATCH"
MINOR_VERSION=$((MINOR_VERSION + 1))
echo "${{env.UGM_RELEASE_PREFIX}}$MAJOR_VERSION.$MINOR_VERSION.$VERSION_PATCH"
# Prepare tags
echo "gittag=${{env.UGM_RELEASE_PREFIX}}${MAJOR_VERSION}.${MINOR_VERSION}.${VERSION_PATCH}" >> $GITHUB_OUTPUT
echo "tagmsg=${{env.UGM_RELEASE_MESSAGE}} ${{steps.date-selector.outputs.date}}" >> $GITHUB_OUTPUT
echo "tagversion=${MAJOR_VERSION}.${MINOR_VERSION}.${VERSION_PATCH}" >> $GITHUB_OUTPUT
echo "tagversion=$MAJOR_VERSION.$MINOR_VERSION.$VERSION_PATCH" >> $GITHUB_OUTPUT
- name: Create Git Tag
run: |
git config user.name "GitHub Actions 1"
git config user.name "GitHub Actions"
git config user.email "github-actions@users.noreply.github.com"
git tag -a "${{steps.tag-selector.outputs.gittag}}" -m "${{steps.tag-selector.outputs.tagmsg}}"
git push origin "${{steps.tag-selector.outputs.gittag}}"
- name: Set repository version variable
id: setversion
run: |
gh variable list --env test
gh variable set UGM_BUILD_VERSION --env test --body "1.1.1"
outputs:
TAGNAME: ${{steps.tag-selector.outputs.gittag}}
TAGMESSAGE: ${{steps.tag-selector.outputs.tagmsg}}
TAGPATCH: ${{steps.tag-selector.outputs.tagversion}}

build:
gh variable list --env ${{env.TARGET_ENV}}
gh variable set UGM_BUILD_REVISION --env ${{env.TARGET_ENV}} --body "${{steps.get-commit.outputs.sha_short}}"
gh variable set UGM_BUILD_VERSION --env ${{env.TARGET_ENV}} --body "${{steps.tag-selector.outputs.tagversion}}"
gh variable list --env ${{env.TARGET_ENV}}
# Update lower environment version elements
gh variable set UGM_BUILD_VERSION --env dev --body "${{steps.tag-selector.outputs.tagversion}}"
gh variable list --env dev
echo "buildArgs --env ${{env.TARGET_ENV}} UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGM_BUILD_REVISION}}"
Build:
needs: [Setup,GenerateTag]
runs-on: ubuntu-latest
environment: test
environment: main
steps:
- uses: actions/checkout@v4
- name: Build dotnetapp docker images
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docker-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Get short commitId
id: get-commit
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get current date
id: date-selector
run: echo "date=$(date +'%B %e, %Y')" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -88,11 +92,13 @@ jobs:
id: setversion
run: |
gh variable list --env ${{env.TARGET_ENV}}
gh variable set UGM_BUILD_REVISION --env ${{env.TARGET_ENV}} --body "${{steps.get-commit.outputs.sha_short}}"
gh variable set UGM_BUILD_VERSION --env ${{env.TARGET_ENV}} --body "${{steps.tag-selector.outputs.tagversion}}"
gh variable list --env ${{env.TARGET_ENV}}
# Update lower environment version elements
gh variable set UGM_BUILD_VERSION --env dev --body "${{steps.tag-selector.outputs.tagversion}}"
gh variable list --env dev
echo "buildArgs --env ${{env.TARGET_ENV}} UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGM_BUILD_REVISION}}"
Build:
needs: [Setup,GenerateTag]
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion applications/scripts/datafix-ab#006.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test 1
test 2
test 2
test 3

0 comments on commit 0924448

Please sign in to comment.