@ossy/deployment-tools
v0.0.94
Published
Collection of scripts and tools to aid deployment of containers and static files to Amazon Web Services through GitHub Actions
Readme
@ossy/deployment-tools
Collection of scripts and tools to aid deployment of containers and static files to Amazon Web Services through GitHub Actions
Server
start
Starts a node server in the background that polls an deployment queue for container deployment requests. Make sure NodeJs and npm is installed and Docker and Caddy is up and running.
npx @ossy/deployment-tools server startstop
Stops the deployment-tools systemd service
npx @ossy/deployment-tools server stopstatus
Prints the status of the deployment-tools systemd service
npx @ossy/deployment-tools server statusDeployment
deploy
Sends a deployment request to the aws sqs deployment queue.
npx --yes @ossy/deployment-tools deploy \
--username ${{ github.actor }} \
--authentication ${{ secrets.GITHUB_TOKEN }} \
--target-env ${{ github.event.inputs.environmentName }} \
--platforms packages/infrastructure/bin/deployment-platforms.json \
--ossyfile packages/${{ github.event.inputs.packageName }}/ossy.json \The cdk.json file tells the CDK Toolkit how to execute your app.
cdk deploydeploy this stack to your default AWS account/regioncdk diffcompare deployed stack with current statecdk synthemits the synthesized CloudFormation template
Useful commands
SSH into instance
ssh -i path/to/keys ubuntu@<ip>View running containers
docker psView logs from docker container
docker logs <id|alias>View logs from deployment-tools service
// With last 200 lines and follow new logs
journalctl -u deployment-tools.service -n 200 -fView logs from caddy service
// With last 200 lines and follow new logs
journalctl -u caddy-route53.service -n 200 -fView logs from docker service
// With last 200 lines and follow new logs
journalctl -u docker.service -n 200 -fUpgrade deployment-tools server version
- 1 release new version of the npm package with
npm publish - 2 ssh into the instance with
ssh -i path/to/keys ubuntu@<ip> - 3 stop the deployment-tools services with
sudo systemctl stop deployment-tools.service - 4 remove the old version of the tool woth
rm -rf ~/.npm/_npx - 5 start the deployment-tools services again with
sudo systemctl start deployment-tools.service
That's it, the service will download the latest version of the package.
Update Nodejs on the server
# Remove old NodeSource repository if it exists
sudo rm -f /etc/apt/sources.list.d/nodesource.list
# Download and run the Node.js 24.x setup script
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
# Install Node.js 24
sudo apt-get install -y nodejs
# Verify the installation
node --version
npm --version