Example NodeJS with Express webserver configured with cors and a public file directory. Show cases various technologies for automated builds and deployment.
Technologies used:
- GitLab yaml config for CI/CD
- Shell scripting for building TypeScript projects
- Go script for reading config files, building docker images, publishing to a docker registry, deploying to docker swarm
- Docker to build images, and push to container registry
- Docker Swarm to host the NodeJS app
The .gitlab-ci.yml file is a configuration file used by GitLab CI/CD pipelines. Here are the build steps:
- GitLab runner will pull down the source
- install the node packages
- build the TypeScript app
- execute the build.go file
- buildconfig-prod.json will be parsed
- build Docker image
- publish Docker image to a private docker registry
- deploy Docker image to Docker Swarm, with mapped ports and volumes
- verify the application is running
- check the running app version