Add github action to test a capella connection with given env #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test Couchbase Credential | |
on: [push] | |
jobs: | |
test_credential: | |
runs-on: ubuntu-latest | |
name: Test that given env variable works | |
steps: | |
- run: wget https://github.com/couchbaselabs/couchbase-shell/releases/download/v0.75.1/cbsh-x86_64-unknown-linux-gnu.tar.gz | |
- run: tar -xvzf cbsh-x86_64-unknown-linux-gnu.tar.gz | |
- run: | | |
CONFIG=$(cat << EOF | |
version = 1 | |
[[cluster]] | |
identifier = "local" | |
connstr = "$COUCHBASE_CONNECTION_STRING" | |
username = "$COUCHBASE_USERNAME" | |
password = "$COUCHBASE_PASSWORD" | |
EOF | |
) | |
echo "CONFIG<<EOF" >> $GITHUB_ENV | |
echo "$CONFIG" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- run: echo "$CONFIG" >> config | |
- run: ./cbsh --config-dir . -c cb-env | |
shell: bash | |
env: | |
COUCHBASE_CONNECTION_STRING: ${{ secrets.COUCHBASE_CONNECTION_STRING }} | |
COUCHBASE_USERNAME: ${{ secrets.COUCHBASE_USERNAME }} | |
COUCHBASE_PASSWORD: ${{ secrets.COUCHBASE_PASSWORD }} | |