Skip to content

Conversation

WcaleNieWolny
Copy link
Contributor

@WcaleNieWolny WcaleNieWolny commented Aug 28, 2023

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

@sonarqubecloud
Copy link

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
Copy link
Contributor Author

I have added docs: Cap-go/website#117

@riderx riderx merged commit 783eda0 into Cap-go:main Aug 30, 2023
@riderx
Copy link
Collaborator

riderx commented Sep 19, 2023

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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants