master
NY 1 month ago
parent 37db092719
commit f7fb556309

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

Loading…
Cancel
Save