Consider these instructions temporary or as a template for creating a Travis or other CI script. Ultimately, when the repo is tagged for a release steps like these should execute the CI steps to deploy a new version of the app.
Specifically, for the https://www.fivefifthsvoter.com/ site
the steps below are automatically executed in Travis when new
code is delivered to the main
branch.
- Create an api key IN THE ACCOUNT THAT IS HOSTING THE APP, not your personal account UNLESS you are the owner and save it somewhere as json
{ "name": "some-name", "description": "some description", "createdAt": "2020-07-10T22:54+0000", "apikey": "-LYxYYxxYYxxYxxx9xxY9x9xY9xxYYY9xxYY_xYxYxxL" }
- Install ibmcloud cli https://cloud.ibm.com/docs/cli?topic=cli-getting-started
- Install code engine
ibmcloud plugin install -f code-engine
- Install container registry
ibmcloud plugin install -f container-registry
- Login to ibmcloud
ibmcloud login --apikey @~/projects/ibmcloud-apikey.json
- Target the right region and group
ibmcloud target -r us-south -g cfc-team-fivefifths
- Build docker image
docker build -t us.icr.io/ffv .
- Push to a registry
docker push us.icr.io/ffv
- Push to code engine
ibmcloud ce project select --name ffv ibmcloud ce app update --image us.icr.io/ffv:latest
See deploy.sh for an example of a deployment script.