Skip to content

Commit

Permalink
Updated the manual build file to trigger the addons
Browse files Browse the repository at this point in the history
  • Loading branch information
ManoharKrishnaBoppe committed Jun 28, 2023
1 parent b231983 commit facfe32
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 13 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,37 +102,37 @@ jobs:
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
curl --location --request PUT '${{ env.VIKING_ADDON_URL }}/api/v1/plugins' \
curl --location --request PUT '${{ env.VIKING_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.VIKING_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
curl --location --request PUT '${{ env.DEMONS_ADDON_URL }}/api/v1/plugins' \
curl --location --request PUT '${{ env.DEMONS_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.DEMONS_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
curl --location --request PUT '${{ env.DEVELOPMENT_ADDON_URL }}/api/v1/plugins' \
curl --location --request PUT '${{ env.DEVELOPMENT_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.DEVELOPMENT_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
curl --location --request PUT '${{ env.DEVTESTING_ADDON_URL }}/api/v1/plugins' \
curl --location --request PUT '${{ env.DEVTESTING_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.DEVTESTING_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
curl --location --request PUT '${{ env.PRESTAGING_ADDON_URL }}/api/v1/plugins' \
curl --location --request PUT '${{ env.PRESTAGING_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.PRESTAGING_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
curl --location --request PUT '${{ env.STAGING_ADDON_URL }}/api/v1/plugins' \
curl --location --request PUT '${{ env.STAGING_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.STAGING_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
curl --location --request PUT '${{ env.PROD_ADDON_URL }}/api/v1/plugins' \
curl --location --request PUT '${{ env.PROD_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.PROD_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
Expand Down
81 changes: 75 additions & 6 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ on:
workflow_dispatch:
inputs:
environment:
description: 'Environment'
description: 'Environment To Deploy Addons'
required: true
type: choice
options:
- main
- dev
- fix/dev-action-main
- none
- production
- staging
- prestaging
- devtesting
- blackpearl
- vikings
- demons
- development

jobs:
build:
Expand All @@ -21,6 +27,18 @@ jobs:
with:
fetch-depth: "0"

- name: Set environment variables
run: |
echo "BLACKPEARL_ADDON_URL=https://blackpearl-kibbutz.testsigma.com" >> $GITHUB_ENV
echo "VIKING_ADDON_URL=https://vikings-kibbutz.testsigma.com" >> $GITHUB_ENV
echo "DEMONS_ADDON_URL=https://demons-kibbutz.testsigma.com" >> $GITHUB_ENV
echo "DEVELOPMENT_ADDON_URL=https://development-kibbutz.testsigma.com" >> $GITHUB_ENV
echo "DEVTESTING_ADDON_URL=https://devtesting-kibbutz.testsigma.com" >> $GITHUB_ENV
echo "PRESTAGING_ADDON_URL=https://prestaging-kibbutz.testsigma.com" >> $GITHUB_ENV
echo "STAGING_ADDON_URL=https://staging-kibbutz.testsigma.com" >> $GITHUB_ENV
echo "PROD_ADDON_URL=https://kibbutz.testsigma.com" >> $GITHUB_ENV
echo "GIT_BRANCH=dev" >> $GITHUB_ENV
- name: SSH repo access
uses: webfactory/ssh-agent@v0.5.4
with:
Expand Down Expand Up @@ -63,10 +81,61 @@ jobs:
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git branch -a
git checkout ${{ github.event.inputs.environment }}
git checkout $GIT_BRANCH
git add .
git commit -m "build files added to the path $version_dir"
git push origin ${{ github.event.inputs.environment }}
git push origin $GIT_BRANCH
ENVIRONMENT=${{ github.event.inputs.Environment }}
if [[ "$ENVIRONMENT" == "production"* ]]; then
curl --location --request PUT '${{ env.PROD_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.PROD_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
elif [[ "$ENVIRONMENT" == "staging"* ]]; then
curl --location --request PUT '${{ env.STAGING_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.STAGING_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
elif [[ "$ENVIRONMENT" == "prestaging"* ]]; then
curl --location --request PUT '${{ env.PRESTAGING_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.PRESTAGING_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
elif [[ "$ENVIRONMENT" == "devtesting"* ]]; then
curl --location --request PUT '${{ env.DEVTESTING_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.DEVTESTING_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
elif [[ "$ENVIRONMENT" == "blackpearl"* ]]; then
curl --location --request PUT '${{ env.BLACKPEARL_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.BLACKPEARL_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
elif [[ "$ENVIRONMENT" == "vikings"* ]]; then
curl --location --request PUT '${{ env.VIKING_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.VIKING_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
elif [[ "$ENVIRONMENT" == "demons"* ]]; then
curl --location --request PUT '${{ env.DEMONS_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.DEMONS_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
elif [[ "$ENVIRONMENT" == "development"* ]]; then
curl --location --request PUT '${{ env.DEVELOPMENT_ADDON_URL }}/api/v1/plugins' \
--header 'Authorization: Bearer ${{ secrets.DEVELOPMENT_V1_TOKEN }}' \
--form "sourceCode=@\"$archival\"" \
--form 'buildTool="MAVEN"' \
--form 'isDefault="true"'
fi
done

0 comments on commit facfe32

Please sign in to comment.