For deploying a site via Bitbucket pipelines I am looking for a Docker image that has:
Life is short, so before I go and read up on how to spec and host your own dockerfile, I tried to find a hosted one over at dockerhub. Turns out, I'm not very good at searching that thing. I get so many results and I'm not sure how to check if they have what I require. Does someone know of an image with at least these three elements? Or, how is a good way to search for one?
Thanks!
My bitbucket-pipelines.yml file:
image: andthensome/docker-node-rsync
pipelines:
branches:
staging:
- step:
name: Build and deploy to staging
caches:
- node
script:
- mkdir -p ~/.ssh
# fails here:
- envsubst < .env.staging
- cat .env.staging
- npm install
- npm run production
- rsync -avz --delete public/compiled-assets/ [email protected]:/home/public/compiled-assets
- ssh [email protected] 'bash -s' < devops/deploy_staging.sh
Four months later and no answer, so I bit the bullet and built the docker image I needed: janniet/build-pipe
Now I can replace this hard-to-maintain deploy script:
script:
...
- sed -i "s|_AWS_SECRET_ACCESS_KEY_|$AWS_SECRET_ACCESS_KEY|g" .env.staging
- sed -i "s|_AWS_ACCESS_KEY_ID_|$AWS_ACCESS_KEY_ID|g" .env.staging
- sed -i "s|_DB_PASSWORD_|$DB_STAGING_PASSWORD|g" .env.staging
- sed -i "s|_APP_KEY_|$APP_KEY|g" .env.staging
...
with this one:
script:
...
- envsubst < .env.staging > .env
...