CI update
continuous-integration/drone/push Build was killed Details

This commit is contained in:
DutchEllie 2022-05-14 21:09:48 +02:00
parent a88651e4b7
commit caf15aadcb
Signed by: DutchEllie
SSH Key Fingerprint: SHA256:dKq6ZSgN5E3Viqrw/+xAdf2VdR6hdRGNyrYqXXwfjTY
2 changed files with 47 additions and 18 deletions

View File

@ -1,24 +1,53 @@
kind: pipeline
type: kubernetes
name: default
name: staging
trigger:
event:
- push
# STAGING!!!!!!!!!!!!!
# STAGING!!!!
steps:
- name: docker
- name: build-wasm
image: golang:1.17.8-alpine
volumes:
- name: build
path: /drone/src/build
environment:
APIURL: https://api.quenten.nl/api/testing
commands:
- mkdir ./build/web
- GOARCH=wasm GOOS=js go build -o ./build/web/app.wasm -ldflags="-X 'main.ApiURL=$APIURL'" ./src
- name: build-server
image: golang:1.17.8-alpine
volumes:
- name: build
path: /drone/src/build
environment:
APIURL: https://api.quenten.nl/api/testing
commands:
- go build -o ./build/app -ldflags="-X 'main.ApiURL=$APIURL'" ./src
- name: build-publish-image
image: plugins/docker
privileged: true
volumes:
- name: build
path: /drone/src/build
settings:
cache_from:
- "dutchellie/proper-website-2:dev"
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: Dockerfile
repo: dutchellie/proper-website-2
tags:
- dev
- ${DRONE_COMMIT_SHA:0:8}
depends_on:
- build-wasm
- build-server
- name: deploy-staging
image: pelotech/drone-helm3
settings:
@ -28,7 +57,6 @@ steps:
release: newsite-staging
skip_tls_verify: true
values_files:
# - .drone/helm/values.yaml
- .drone/helm/staging-val.yaml
values:
- "image=dutchellie/proper-website-2:${DRONE_COMMIT_SHA:0:8}"

View File

@ -1,16 +1,17 @@
FROM golang:1.17.8-alpine AS builder
ARG APIURL
WORKDIR /project
ADD . /project/
RUN go mod tidy
RUN GOARCH=wasm GOOS=js go build -o web/app.wasm -ldflags="-X 'main.ApiURL=$APIURL'" ./src
RUN go build -o app -ldflags="-X 'main.ApiURL=$APIURL'" ./src
#FROM golang:1.17.8-alpine AS builder
#ARG APIURL
#WORKDIR /project
#ADD . /project/
#RUN go mod tidy
#RUN GOARCH=wasm GOOS=js go build -o web/app.wasm -ldflags="-X 'main.ApiURL=$APIURL'" ./src
#RUN go build -o app -ldflags="-X 'main.ApiURL=$APIURL'" ./src
FROM alpine:latest AS staging
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /project/web ./web/
COPY --from=builder /project/app ./
WORKDIR /root
RUN mkdir ./web
COPY ./web ./web
COPY ./build/web/app.wasm ./web/
COPY ./build/app ./
EXPOSE 8000
ENV TESTING true
CMD ["./app"]