https://github.com/stonith404/cd-dc
A simple service to continuously deploy docker containers in a docker compose stack. The tool is especially useful in a GitHub Actions workflow.
https://github.com/stonith404/cd-dc
continuous-deployment go
Last synced: 2 months ago
JSON representation
A simple service to continuously deploy docker containers in a docker compose stack. The tool is especially useful in a GitHub Actions workflow.
- Host: GitHub
- URL: https://github.com/stonith404/cd-dc
- Owner: stonith404
- License: bsd-2-clause
- Created: 2023-08-29T07:28:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-06T14:40:17.000Z (over 1 year ago)
- Last Synced: 2024-12-27T02:41:41.722Z (4 months ago)
- Topics: continuous-deployment, go
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CD-DC
CD-DC (Continuous Deployment Docker Compose) is a simple service to continuously deploy docker containers in a docker compose stack. The tool is especially useful in a GitHub Actions workflow.
## Usage
Send a post request to the `/upgrade/` endpoint:
```bash
curl /upgrade/ -X POST -H --fail-with-body
```## Production Installation
### Install as Systemd service
1. Build the binary
```
go build -o build/cd-dc ./cmd
```
2. Copy the binary to `/opt/cd-dc`
3. Copy the `config.yml` to `/opt/cd-dc` and modify it accordingly
4. Create a systemd service file in `/etc/systemd/system/cd-dc.service````
[Unit]
Description=CD-DC
After=network.target[Service]
ExecStart=/opt/cd-dc/cd-dc
WorkingDirectory=/opt/cd-dc[Install]
WantedBy=default.target
```5. Enable the service
```
sudo systemctl enable cd-dc
```
6. Start the service
```
sudo systemctl start cd-dc
```
7. Check the status
```
sudo systemctl status cd-dc
```
8. Check the logs
```
sudo journalctl -u cd-dc
```#### Update
1. Copy the new binary to `/opt/cd-dc`
2. Reload the systemd daemon
```
sudo systemctl daemon-reload
```
3. Restart the service
```
sudo systemctl restart cd-dc
```## Development
### Run
```bash
go run ./cmd
```### Build for specific OS and architecture
```bash
env GOOS=linux GOARCH=arm64 go build -ldflags "-w" -o build/cd-dc ./cmd
```