Skip to content

Commit

Permalink
Merge pull request #26 from erickvneri/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
erickvneri authored Sep 13, 2023
2 parents 0e80c1f + 0075202 commit b24e277
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/deploy-development-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,26 @@ jobs:
TARGET_CHANNEL=${{ secrets.ST_CHANNEL_DEVELOP }};
TOKEN=${{ secrets.ST_PAT }};
./deploy.sh $DRIVERS_PATH $TARGET_CHANNEL $TOKEN;
deploy () {
DRIVER_FOLDER=$1;
pushd "$DRIVERS_PATH/$DRIVER_FOLDER";
DRIVER_UUID=$(
smartthings edge:drivers:package --json --token $TOKEN | \
jq .driverId | \
tr -d '"'
);
echo "driver $DRIVER_FOLDER:$DRIVER_UUID packaged correctly";
smartthings edge:channels:assign "$DRIVER_UUID" \
--channel $TARGET_CHANNEL \
--token $TOKEN \
&& echo "driver $DRIVER_FOLDER$DRIVER_UUID released correctly";
popd;
}
cd $DRIVERS_PATH;
for DRIVER_DIR in $(ls -d */); do
deploy $DRIVER_DIR
done
24 changes: 23 additions & 1 deletion .github/workflows/deploy-production-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,26 @@ jobs:
TARGET_CHANNEL=${{ secrets.ST_CHANNEL_PRODUCTION }};
TOKEN=${{ secrets.ST_PAT }};
./deploy.sh $DRIVERS_PATH $TARGET_CHANNEL $TOKEN;
deploy () {
DRIVER_FOLDER=$1;
pushd "$DRIVERS_PATH/$DRIVER_FOLDER";
DRIVER_UUID=$(
smartthings edge:drivers:package --json --token $TOKEN | \
jq .driverId | \
tr -d '"'
);
echo "driver $DRIVER_FOLDER$DRIVER_UUID packaged correctly";
smartthings edge:channels:assign "$DRIVER_UUID" \
--channel $TARGET_CHANNEL \
--token $TOKEN \
&& echo "driver $DRIVER_FOLDER$DRIVER_UUID released correctly";
popd;
}
cd $DRIVERS_PATH;
for DRIVER_DIR in $(ls -d */); do
deploy $DRIVER_DIR
done

0 comments on commit b24e277

Please sign in to comment.