Skip to content

Commit

Permalink
Merge branch 'dev' into fix/dev-action-main
Browse files Browse the repository at this point in the history
  • Loading branch information
ManoharKrishnaBoppe authored Sep 28, 2023
2 parents d375976 + 20b4bf2 commit cb27a99
Show file tree
Hide file tree
Showing 161 changed files with 2,910 additions and 237 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name : Build Addon - Automation

on:
pull_request:
types: [ closed ]
types: [closed]

jobs:
build:
if: github.event.pull_request.merged == true
Expand All @@ -25,8 +26,8 @@ jobs:
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
- name: SSH repo access
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY}}

Expand Down Expand Up @@ -74,8 +75,9 @@ jobs:
echo "Setting Variables $dir"
cd $dir
version=$(xmlstarlet sel -t -v "/*[local-name()='project']/*[local-name()='version']" -n pom.xml)
artifactId=$(xmlstarlet sel -t -v "/*[local-name()='project']/*[local-name()='artifactId']" -n pom.xml)
version_dir=build/$version
archival="$dir"_source.zip
archival="$artifactId"_source.zip
echo "Building $dir With latest version : $version"
mvn clean install
echo "Archiving the build files to $archival"
Expand All @@ -84,9 +86,9 @@ jobs:
sudo mkdir -p $version_dir
echo "Copy build files to the location : $version_dir "
sudo mv $archival $version_dir/
sudo cp target/$dir.jar target/original-$dir.jar $version_dir/
sudo cp target/$artifactId.jar target/original-$artifactId.jar $version_dir/
echo "Committing the file changes"
ls $version_dir
echo "Committing the changes"
echo "Github Actor : ${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
Expand Down Expand Up @@ -137,9 +139,4 @@ jobs:
# --form "sourceCode=@\"$archival\"" \
# --form 'buildTool="MAVEN"' \
# --form 'isDefault="true"'
done





done
158 changes: 82 additions & 76 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,83 +58,89 @@ jobs:
- name: Build and commit changes
run: |
echo "Environment value: ${{ github.event.inputs.environment }} "
directories=$(find "." -mindepth 1 -type d)
directories=$(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
echo $directories;
for dir in ${{ directories }}; do
echo "Setting Variables $dir"
cd $dir
version=$(xmlstarlet sel -t -v "/*[local-name()='project']/*[local-name()='version']" -n pom.xml)
version_dir=build/$version
archival="$dir"_source.zip
echo "Building $dir With latest version : $version"
mvn clean install
echo "Archiving the build files to $archival"
zip -r $archival . -x "build/*"
echo "Creating an directory for version : $version_dir"
sudo mkdir -p $version_dir
echo "Copy build files to the location : $version_dir "
sudo mv $archival $version_dir/
sudo cp target/$dir.jar target/original-$dir.jar $version_dir/
ls $version_dir
echo "Committing the changes"
echo "Github Actor : ${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git branch -a
git checkout $GIT_BRANCH
git add .
git commit -m "build files added to the path $version_dir"
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"'
for dir in $directories; do
if [[ $dir != *"."* ]]; then
echo "Setting Variables $dir"
cd $dir
version=$(xmlstarlet sel -t -v "/*[local-name()='project']/*[local-name()='version']" -n pom.xml)
artifactId=$(xmlstarlet sel -t -v "/*[local-name()='project']/*[local-name()='artifactId']" -n pom.xml)
version_dir=build/$version
archival="$artifactId"_source.zip
echo "Building $dir With latest version : $version"
mvn clean install
echo "Archiving the build files to $archival"
zip -r $archival . -x "build/*"
echo "Creating an directory for version : $version_dir"
sudo mkdir -p $version_dir
echo "Copy build files to the location : $version_dir "
sudo mv $archival $version_dir/
sudo cp target/$artifactId.jar target/original-$artifactId.jar $version_dir/
echo "Committing the file changes"
ls $version_dir
echo "Github Actor : ${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git branch -a
git checkout $GIT_BRANCH
git add .
git commit -m "build files added to the path $version_dir"
git push origin $GIT_BRANCH
cd $version_dir
ENVIRONMENT=${{ github.event.inputs.Environment }}
echo "Updating the $dir addon in stack $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
cd ../../../
fi
done
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
67 changes: 67 additions & 0 deletions automate_checkbox_using_attributes/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.testsigma.addons</groupId>
<artifactId>automate_checkbox_using_attributes</artifactId>
<version>1.0.0</version>
<build>
<finalName>automate_checkbox_using_attributes</finalName>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>${maven.source.plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.8.0-M1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
<exclusion>
<artifactId>opentest4j</artifactId>
<groupId>org.opentest4j</groupId>
</exclusion>
<exclusion>
<artifactId>junit-platform-commons</artifactId>
<groupId>org.junit.platform</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
<testsigma.sdk.version>1.0.0.rc1</testsigma.sdk.version>
<lombok.version>1.18.20</lombok.version>
<maven.source.plugin.version>3.2.1</maven.source.plugin.version>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.jupiter.version>5.8.0-M1</junit.jupiter.version>
</properties>
</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
67 changes: 67 additions & 0 deletions automate_email_textbox_using_attributes/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.testsigma.addons</groupId>
<artifactId>automate_email_textbox_using_attributes</artifactId>
<version>1.0.0</version>
<build>
<finalName>automate_email_textbox_using_attributes</finalName>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>${maven.source.plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.8.0-M1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
<exclusion>
<artifactId>opentest4j</artifactId>
<groupId>org.opentest4j</groupId>
</exclusion>
<exclusion>
<artifactId>junit-platform-commons</artifactId>
<groupId>org.junit.platform</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
<testsigma.sdk.version>1.0.0.rc1</testsigma.sdk.version>
<lombok.version>1.18.20</lombok.version>
<maven.source.plugin.version>3.2.1</maven.source.plugin.version>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.jupiter.version>5.8.0-M1</junit.jupiter.version>
</properties>
</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit cb27a99

Please sign in to comment.