You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
677 B

1 month ago
kind: pipeline
name: default
steps:
- name: Build
image: golang:1.23.2
environment:
GO111MODULE: on
commands:
- echo "Building the Go project with run_mode=test"
- go build -o myapp -ldflags "-X main.RunMode=test"
- ls -lh
- ./myapp
- name: Deploy to Docker Container
image: docker
commands:
- echo "Stopping and removing the old container if it exists"
- docker stop myapp_container || true
- docker rm myapp_container || true
- echo "Deploying the application to a new Docker container"
- docker build -t myapp:test .
- docker run -d -p 11000:11000 --name myapp_container myapp:test