You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I'm getting a strange error when I get to the deploy step of firebase.
The config (/bitbucket-pipeline.yaml) steps look like this...
image: node:16
pipelines:
branches:
dev:
- step:
name: Setup
caches:
- node
script:
- npm install
- step:
name: Build
caches:
- node
script:
- npm run build:dev
artifacts:
- build/**
- step:
name: Deploy
caches:
- node
deployment: staging
script:
- pipe: atlassian/firebase-deploy:1.3.0
variables:
PROJECT_ID: $FIREBASE_PROJECT_ID
KEY_FILE: $FIREBASE_PRIVATE_KEY
DEBUG: "true"
The (/package.json) file looks something like this (hopefully this is all the relevant parts)...
{
...
"engines": {
"node": 16
},
...
"dependencies": {
...
"firebase": "^9.6.1",
...
"react-scripts": "5.0.0",
...
},
"scripts": {
...
"build:dev": "env-cmd -f .env.development react-scripts build",
...
}
}
The deployment error looks like this...
Status: Downloaded newer image for bitbucketpipelines/firebase-deploy:1.3.0
DEBUG: Starting new HTTPS connection (1): bitbucket.org
DEBUG: https://bitbucket.org:443 "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/1.1" 200 None
INFO: Executing the pipe...
INFO: Current NodeJS version:
installing : node-v12.22.12
mkdir : /usr/local/n/versions/node/12.22.12
fetch : https://nodejs.org/dist/v12.22.12/node-v12.22.12-linux-x64.tar.gz
installed : v12.22.12 (with npm 6.14.16)
Traceback (most recent call last):
File "/main.py", line 170, in <module>
pipe.run()
File "/main.py", line 108, in run
key_content = base64.b64decode(key_file)
File "/usr/local/lib/python3.7/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
I can't see anything out of the ordinary. Could anyone please point me at what might be wrong?
Hi @RobT
Looks like the KEY_FILE encoding error.
The KEY_FILE should be base64 encoded content of Key file for a Google service account. To encode this content, follow encode private key docs.
Linux
$ base64 -w 0 < my_gcp_key
Mac OS X
$ base64 < my_gcp_key
More details about firebase-deploy pipe you could find in the Readme.
Best regards,
Oleksandr Kyrdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.