Had an odd issue with sed and wanted to share it.
image: node:14.15.4
pipelines:
branches:
dev:
- step:
script:
- npm -g config set user root
- npm i
- npm i -g @cloudflare/wrangler
- echo $CLOUDFLARE_API_TOKEN | wrangler config
- mv wrangler-sample.toml wrangler.toml
- sed -i "s/account_id = \"\"/account_id = \"${CLOUDFLARE_ACCOUNT_ID}\"/" wrangler.toml
- sed -i "s/zone_id = \"\"/zone_id = \"${CLOUDFLARE_ZONE_ID}\"/" wrangler.toml
- sed -i "s/RAPID_API_SECRET = \"\"/RAPID_API_SECRET = \"${RAPID_API_SECRET}\"/" wrangler.toml
- sed -i "s/API_KEYS\", id = \"\"/API_KEYS\", id = \"${API_KEYS_NAMESPACE_ID}\"/" wrangler.toml
- cat wrangler.toml
- wrangler publish
This line:
sed -i "s/RAPID_API_SECRET = \"\"/RAPID_API_SECRET = \"${RAPID_API_SECRET}\"/" wrangler.tomlShould replace RAPID_API_SECRET = "" with RAPID_API_SECRET = "${RAPID_API_SECRET}"
But instead it does this:
sed -i "s/$$$$RAPID_API_KEY = \"\"/$$$$RAPID_API_SECRET = \"${$$$$RAPID_API_SECRET}\"/" wrangler.toml Notice the $$$$ it adds
If i change it to RAPID_API_KEY it works no problem.
Ive tried a few things and its not the full word RAPID_API_SECRET, looks like its the word SECRET.