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 kind: pipeline
type: kubernetes type: kubernetes
name: default name: staging
trigger: trigger:
event: event:
- push - push
# STAGING!!!!!!!!!!!!! # STAGING!!!!
steps: 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 image: plugins/docker
privileged: true
volumes:
- name: build
path: /drone/src/build
settings: settings:
username: cache_from:
- "dutchellie/proper-website-2:dev"
username:
from_secret: docker_username from_secret: docker_username
password: password:
from_secret: docker_password from_secret: docker_password
dockerfile: Dockerfile
repo: dutchellie/proper-website-2 repo: dutchellie/proper-website-2
tags: tags:
- dev - dev
- ${DRONE_COMMIT_SHA:0:8} - ${DRONE_COMMIT_SHA:0:8}
depends_on:
- build-wasm
- build-server
- name: deploy-staging - name: deploy-staging
image: pelotech/drone-helm3 image: pelotech/drone-helm3
settings: settings:
@ -28,7 +57,6 @@ steps:
release: newsite-staging release: newsite-staging
skip_tls_verify: true skip_tls_verify: true
values_files: values_files:
# - .drone/helm/values.yaml
- .drone/helm/staging-val.yaml - .drone/helm/staging-val.yaml
values: values:
- "image=dutchellie/proper-website-2:${DRONE_COMMIT_SHA:0:8}" - "image=dutchellie/proper-website-2:${DRONE_COMMIT_SHA:0:8}"

View File

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