change build system golang
This commit is contained in:
parent
1f6a42a581
commit
32928239f4
@ -1,22 +1,33 @@
|
|||||||
|
# when:
|
||||||
|
# - event: push
|
||||||
|
# branch: main
|
||||||
|
|
||||||
|
# steps:
|
||||||
|
# - name: build
|
||||||
|
# image: golang:1.24
|
||||||
|
# commands:
|
||||||
|
# - mkdir -p ./tmp
|
||||||
|
# - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./tmp/learndrone ./main.go
|
||||||
|
# - name: docker-build
|
||||||
|
# image: docker:23
|
||||||
|
# commands:
|
||||||
|
# - docker build -t learndrone:latest ./tmp
|
||||||
|
# # - name: deploy
|
||||||
|
# # image: docker:26.0.0
|
||||||
|
# # commands:
|
||||||
|
# # - docker-compose up -d
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: push
|
- event: push
|
||||||
branch: main
|
branch: main
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: tmp
|
|
||||||
temp: {}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
build:
|
||||||
image: golang:1.24
|
image: golang:1.24
|
||||||
commands:
|
environment:
|
||||||
- mkdir -p ./tmp
|
CGO_ENABLED=0
|
||||||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./tmp/learndrone ./main.go
|
GOOS=linux
|
||||||
- name: docker-build
|
GOARCH=amd64
|
||||||
image: docker:26.0.0
|
commands:
|
||||||
commands:
|
- go get
|
||||||
- docker build -t learndrone:latest ./tmp
|
- go build
|
||||||
# - name: deploy
|
|
||||||
# image: docker:26.0.0
|
|
||||||
# commands:
|
|
||||||
# - docker-compose up -d
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user