From 91e95a69e35de826d1039dd6d27a7b26d4a3ee1d Mon Sep 17 00:00:00 2001 From: DutchEllie Date: Wed, 11 May 2022 14:28:02 +0200 Subject: [PATCH] Oops --- .dockerignore | 4 +++ .drone.yml | 94 +++++++++++++++++++++++++++++++++++++++++++++++++-- Dockerfile | 14 ++++---- 3 files changed, 103 insertions(+), 9 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1c2fe1d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.drone.yml +docker-ignore.yml +LICENCE +README.md diff --git a/.drone.yml b/.drone.yml index cc9aee9..6a787ae 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,8 +6,21 @@ platform: arch: amd64 steps: -- name: build-main +- name: build-pepebot + image: golang:1.16.4-alpine + volumes: + - name: build + path: /build + environment: + CGO_ENABLED: 0 + GOOS: linux + commands: + - go build -a -installsuffix cgo -o /build/app ./discord +- name: build-publish-image image: plugins/docker + volumes: + - name: build + path: /build settings: cache_from: - "dutchellie/pepebot:latest" @@ -19,8 +32,36 @@ steps: repo: dutchellie/pepebot tags: - latest-amd64 + +volumes: + - name: build + temp: {} + +--- +kind: pipeline +type: kubernetes +name: pepebot_service_build_x86 +platform: + os: linux + arch: amd64 + +steps: +- name: build-pepebot_service + image: golang:1.17-alpine + volumes: + - name: build + path: /build + environment: + CGO_ENABLED: 0 + GOOS: linux + commands: + - cd ./pepeservice + - go build -a -installsuffix cgo -o /build/app . - name: build-service image: plugins/docker + volumes: + - name: build + path: /build settings: cache_from: - "dutchellie/pepebot_service:latest" @@ -33,6 +74,10 @@ steps: tags: - latest-amd64 +volumes: + - name: build + temp: {} + --- kind: pipeline @@ -43,8 +88,21 @@ platform: arch: arm64 steps: -- name: build-main +- name: build-pepebot + image: golang:1.16.4-alpine + volumes: + - name: build + path: /build + environment: + CGO_ENABLED: 0 + GOOS: linux + commands: + - go build -a -installsuffix cgo -o /build/app ./discord +- name: build-publish-image image: plugins/docker + volumes: + - name: build + path: /build settings: cache_from: - "dutchellie/pepebot:latest" @@ -56,8 +114,36 @@ steps: repo: dutchellie/pepebot tags: - latest-arm64 + +volumes: + - name: build + temp: {} + +--- +kind: pipeline +type: docker +name: pepebot_service_build_arm64 +platform: + os: linux + arch: arm64 + +steps: +- name: build-pepebot_service + image: golang:1.17-alpine + volumes: + - name: build + path: /build + environment: + CGO_ENABLED: 0 + GOOS: linux + commands: + - cd ./pepeservice + - go build -a -installsuffix cgo -o /build/app . - name: build-service image: plugins/docker + volumes: + - name: build + path: /build settings: cache_from: - "dutchellie/pepebot_service:latest" @@ -70,6 +156,10 @@ steps: tags: - latest-arm64 +volumes: + - name: build + temp: {} + --- kind: pipeline diff --git a/Dockerfile b/Dockerfile index bec2a1f..e84350f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ # syntax=docker/dockerfile:1 -FROM golang:1.16.4-alpine AS builder -WORKDIR /go/src/quenten.nl/pepebot/ - -COPY . ./ -RUN go mod download -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app ./discord +#FROM golang:1.16.4-alpine AS builder +#WORKDIR /go/src/quenten.nl/pepebot/ +# +#COPY . ./ +#RUN go mod download +#RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app ./discord FROM alpine:latest RUN apk --no-cache add ca-certificates WORKDIR /root/ -COPY --from=builder /go/src/quenten.nl/pepebot/app . +COPY /build/app . CMD ["./app"] \ No newline at end of file