Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cdb4186a6d | |||
| 2b926f0b3b |
@@ -1,46 +0,0 @@
|
||||
name: Docker build and push
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
push:
|
||||
branches: [master]
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: jcabillot/ip
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
pull: true
|
||||
Vendored
+11
-3
@@ -2,10 +2,16 @@ pipeline {
|
||||
environment {
|
||||
registry = 'https://registry.hub.docker.com'
|
||||
registryCredential = 'dockerhub_jcabillot'
|
||||
dockerImage = 'jcabillot/ip'
|
||||
dockerImage = 'jcabillot/ip:arm64'
|
||||
}
|
||||
|
||||
agent any
|
||||
//agent any
|
||||
agent {
|
||||
kubernetes {
|
||||
defaultContainer 'docker' // All `steps` instructions will be executed by this container
|
||||
yamlFile 'Jenkinsfile-pod-template.yml'
|
||||
}
|
||||
}
|
||||
|
||||
triggers {
|
||||
cron('@midnight')
|
||||
@@ -14,13 +20,15 @@ pipeline {
|
||||
stages {
|
||||
stage('Clone repository') {
|
||||
steps{
|
||||
container('jnlp') {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build image') {
|
||||
steps{
|
||||
sh 'docker build --force-rm=true --no-cache=true --pull -t ${dockerImage} .'
|
||||
sh 'docker build --build-arg VERSION=arm64 --force-rm=true --no-cache=true --pull -t ${dockerImage} .'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
jenkins: 'true'
|
||||
spec:
|
||||
containers:
|
||||
- name: jnlp
|
||||
image: 'jcabillot/docker-inbound-agent-arm64'
|
||||
- name: docker
|
||||
image: docker:20.10-dind
|
||||
securityContext:
|
||||
privileged: true
|
||||
#volumeMounts:
|
||||
#- mountPath: '/var/run/docker.sock'
|
||||
# name: docker-socket
|
||||
#volumes:
|
||||
#- name: docker-socket
|
||||
# hostPath:
|
||||
# path: '/var/run/docker.sock'
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
@@ -1,35 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: "ip"
|
||||
labels:
|
||||
app: "front"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: "front-apache"
|
||||
labels:
|
||||
owner: "jcabillot"
|
||||
app: "front"
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
containers:
|
||||
- name: "front-apache"
|
||||
image: "jcabillot/ip"
|
||||
ports:
|
||||
- name: "http"
|
||||
containerPort: 8080
|
||||
protocol: "TCP"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: "/"
|
||||
port: "http"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: "/"
|
||||
port: "http"
|
||||
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "front"
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
#apiVersion: networking.k8s.io/v1
|
||||
#kind: Ingress
|
||||
#metadata:
|
||||
# name: "ip"
|
||||
# annotations:
|
||||
# kubernetes.io/ingress.class: "traefik"
|
||||
# traefik.ingress.kubernetes.io/router.entrypoints: "web,websecure"
|
||||
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
#spec:
|
||||
# tls:
|
||||
# - hosts:
|
||||
# - "ip.opti.cabillot.eu"
|
||||
# secretName: "ipcabilloteu-tls"
|
||||
# rules:
|
||||
# - host: "ip.opti.cabillot.eu"
|
||||
# http:
|
||||
# paths:
|
||||
# - path: "/"
|
||||
# pathType: "Prefix"
|
||||
# backend:
|
||||
# service:
|
||||
# name: "ip"
|
||||
# port:
|
||||
# name: "http"
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
# TODO: Named port for service
|
||||
# but currently unsupported on my k3s cluster https://github.com/traefik/traefik/pull/7668
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: "ip-websecure"
|
||||
spec:
|
||||
entryPoints:
|
||||
- "websecure"
|
||||
routes:
|
||||
- kind: Rule
|
||||
match: Host(`ip.opti.cabillot.eu`)
|
||||
middlewares: []
|
||||
priority: 10
|
||||
services:
|
||||
- kind: Service
|
||||
name: "ip"
|
||||
port: 80
|
||||
tls:
|
||||
secretName: "ipcabilloteu-tls"
|
||||
---
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: "ip-web"
|
||||
spec:
|
||||
entryPoints:
|
||||
- "web"
|
||||
routes:
|
||||
- match: Host(`ip.opti.cabillot.eu`)
|
||||
kind: Rule
|
||||
priority: 10
|
||||
services:
|
||||
# in this IngressRoute the service will be never called
|
||||
# because of the redirect middleware BUT DO NOT REMOVE !
|
||||
- kind: Service
|
||||
name: "ip"
|
||||
port: 80
|
||||
middlewares:
|
||||
- name: "httpsredirect"
|
||||
---
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: "httpsredirect"
|
||||
spec:
|
||||
redirectScheme:
|
||||
scheme: https
|
||||
permanent: true
|
||||
@@ -1,7 +0,0 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- depl.yml
|
||||
- ingress.yml
|
||||
- ingressroute.yml
|
||||
- svc.yml
|
||||
@@ -1,13 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: 'ip'
|
||||
spec:
|
||||
type: "ClusterIP"
|
||||
ports:
|
||||
- name: "http"
|
||||
port: 80
|
||||
protocol: "TCP"
|
||||
targetPort: "http"
|
||||
selector:
|
||||
app: "front"
|
||||
Reference in New Issue
Block a user