Skip to content
Commits on Source (2)
...@@ -8,21 +8,21 @@ stages: ...@@ -8,21 +8,21 @@ stages:
test: test:
stage: build stage: build
image: image:
name: gcr.io/kaniko-project/executor:debug name: registry.gitlab.com/pages/hugo:latest
entrypoint: [""]
script: script:
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --no-push - hugo
except: except:
- master - master
build: build:
stage: build stage: build
image: image:
name: gcr.io/kaniko-project/executor:debug name: registry.gitlab.com/pages/hugo:latest
entrypoint: [""]
script: script:
- cp $DOCKER_SECRET_CONFIG /kaniko/.docker/config.json - hugo
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination indiepaas/website:$CI_COMMIT_SHORT_SHA artifacts:
paths:
- public
only: only:
- master - master
...@@ -31,9 +31,11 @@ deploy: ...@@ -31,9 +31,11 @@ deploy:
tags: tags:
- deploy - deploy
image: image:
name: lachlanevenson/k8s-kubectl name: minio/mc:RELEASE.2020-01-13T22-49-03Z
entrypoint: [""] entrypoint: [""]
script: script:
- cat $CI_PROJECT_DIR/k8s.yml | sed "s/latest/$CI_COMMIT_SHORT_SHA/" | kubectl apply -f - - cd public/
- export MC_HOST_minio=https://${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}@minio.k7.indie.host
- mc mirror --remove --overwrite . minio/k8s-libre-sh
only: only:
- master - master
\ No newline at end of file
FROM unteem/nginx:1.16
ENV HUGO_VERSION 0.58.3
RUN apt-get update && apt-get install -y wget \
&& wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz \
&& tar xzf hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz \
&& rm -r hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz \
&& mv hugo /usr/bin/hugo \
&& rm -rf /var/lib/apt/lists/*
COPY . /usr/src/site
RUN cd /usr/src/site \
&& hugo -d /var/www
CMD 'nginx'
apiVersion: apps/v1
kind: Deployment
metadata:
name: libresh
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- env:
image: indiepaas/website:latest
imagePullPolicy: Always
name: libresh
ports:
- containerPort: 80
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/tls-acme: "true"
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
name: libre-sh
namespace: libre-sh
spec:
rules:
- host: k8s.libre.sh
http:
paths:
- backend:
serviceName: libresh-web
servicePort: http
path: /
tls:
- hosts:
- k8s.libre.sh
secretName: k8s-libresh-tls
---
apiVersion: v1
kind: Service
metadata:
name: libresh-web
namespace: libre-sh
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
\ No newline at end of file