Cap-go / CLI

CLI to help you to manage your version in capgo cloud
https://capgo.app
GNU Affero General Public License v3.0
18 stars 36 forks source link

Allow bundle link to be used in CI/CD #132

Closed WcaleNieWolny closed 1 year ago

WcaleNieWolny commented 1 year ago

This PR allows the usage of bundle link in CI/CD or other forms of shell scripting. It is not a very smart solution but it works very well. Here is how to use these changes:


UPLOAD_OUTPUT="$(@npx @capgo/cli bundle upload -b 2.0.13 --bundle-url)"

if [[ $? -ne 0 ]]; then
    echo "$UPLOAD_OUTPUT"
    exit 1
fi

echo $(echo "$UPLOAD_OUTPUT" | grep "●  Bundle url: " | sed -e "s/●  Bundle url: //g")

If you want to further process the link you can use something like

LINK=$(echo "$UPLOAD_OUTPUT" | grep "●  Bundle url: " | sed -e "s/●  Bundle url: //g")

And here is the output: Success: (Tested on selfhosted capgo)

$ bash upload.sh
http://localhost:5173/app/p/com--demo--app/channel/2

Fail:

$ bash upload.sh

┌  Uploading
│
●  Use global apy key /home/wolny/.capgo
│
●  Upload com.demo.app@2.0.13 started from path "dist" to Capgo cloud
│
■  This app bundle already exist or was deleted, you cannot re-upload it

Note: In this bash script, the colors will be removed. It will be white if used in a bash script

/claim #116

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

WcaleNieWolny commented 1 year ago

I have added docs: https://github.com/Cap-go/website/pull/117

riderx commented 1 year ago

Shell example for encryption sessionkey:

ENCRYPT_OUTPUT="$(@npx @capgo/cli@latest bundle encrypt)"

if [[ $? -ne 0 ]]; then
        echo "ENCRYPT_OUTPUT"
        exit 1
fi

echo $(echo "$ENCRYPT_OUTPUT" | grep "●  ivSessionKey: " | sed -e "s/●  ivSessionKey: //g")