Skip to content

Commit

Permalink
add new versions and fix certificates (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabello authored Mar 14, 2024
1 parent 4784373 commit ea0e942
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 2.10.4/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ parts:
# We moved this here because: https://github.com/canonical/rockcraft/issues/343
ca-certs:
plugin: nil
stage-packages: [ca-certificates]
overlay-packages: [ca-certificates]

non-root-user:
plugin: nil
Expand Down
2 changes: 1 addition & 1 deletion 2.10.5/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ parts:
# We moved this here because: https://github.com/canonical/rockcraft/issues/343
ca-certs:
plugin: nil
stage-packages: [ca-certificates]
overlay-packages: [ca-certificates]
non-root-user:
plugin: nil
after: [default-config]
Expand Down
2 changes: 1 addition & 1 deletion 2.10.6/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ parts:
# We moved this here because: https://github.com/canonical/rockcraft/issues/343
ca-certs:
plugin: nil
stage-packages: [ca-certificates]
overlay-packages: [ca-certificates]
non-root-user:
plugin: nil
after: [default-config]
Expand Down
2 changes: 1 addition & 1 deletion 2.10.7/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ parts:
# We moved this here because: https://github.com/canonical/rockcraft/issues/343
ca-certs:
plugin: nil
stage-packages: [ca-certificates]
overlay-packages: [ca-certificates]
non-root-user:
plugin: nil
after: [default-config]
Expand Down
13 changes: 13 additions & 0 deletions 2.11.0/files/traefik.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
log:
level: DEBUG

providers:
file:
directory: /etc/traefik
watch: true

entryPoints:
web:
address: ":8080"
websecure:
address: ":8081"
108 changes: 108 additions & 0 deletions 2.11.0/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: traefik
summary: Traefik in a ROCK.
description: "Traefik is the a cloud-native application networking stack."
version: "2.11.0"
base: [email protected]
license: Apache-2.0
# sources:
# jnsgruk's traefik dockerfile https://github.com/jnsgruk/traefik-oci-image/blob/main/Dockerfile
# upstream traefik makefile https://github.com/traefik/traefik/blob/84a081054688349fa4e2513599e3bf2395331492/Makefile

# /
# ├── bin
# │ └── traefik
# └── etc
# └── traefik.yaml
services:
traefik:
command: /bin/traefik
override: replace
startup: enabled
platforms:
amd64:
parts:
traefik-frontend:
plugin: npm
source-type: git
source-depth: 1
source-tag: "v2.11.0"
source: https://github.com/traefik/traefik
npm-node-version: 14.16
build-packages:
- nodejs
- npm
override-build: |
npm install -g yarn && \
cd ./webui && \
# added --legacy-peer-deps to avoid dependency resolution errors with mocha (testing)
npm install --legacy-peer-deps && \
# Build the bundle as per:
# https://github.com/traefik/traefik/blob/84a081054688349fa4e2513599e3bf2395331492/Makefile#L66
npm run build:nc && \
# cleanup
rm -rf node_modules
default-config:
plugin: dump
source: files
organize:
traefik.yaml: etc/traefik/traefik.yaml
stage:
- etc/traefik/traefik.yaml
traefik:
plugin: go
source-type: git
source-depth: 1
source-tag: "v2.11.0"
source: https://github.com/traefik/traefik
build-snaps:
- yq
- go/1.22/stable
build-environment:
- GO111MODULE: "on"
- CGO_ENABLED: "0"
- GOGC: "off"
- TRAEFIK_VERSION: v2.11.0
override-build: |
CODENAME=$(yq e '.blocks[] | select(.name=="Release").task.env_vars[] | select(.name=="CODENAME").value' ./.semaphore/semaphore.yml) && \
mkdir -p dist && \
# Required to merge non-code components into the final binary such as the web dashboard/UI
go generate && \
# Build Traefik per https://github.com/traefik/traefik/raw/v2.6.1/script/binary
go build -ldflags "-s -w \
-X github.com/traefik/traefik/v2/pkg/version.Version=$TRAEFIK_VERSION \
-X github.com/traefik/traefik/v2/pkg/version.Codename=$CODENAME \
-X github.com/traefik/traefik/v2/pkg/version.BuildDate=$(date -u '+%Y-%m-%d_%I:%M:%S%p')" \
-a -installsuffix nocgo -o $CRAFT_PART_INSTALL/traefik ./cmd/traefik
after:
- traefik-frontend
organize:
traefik: bin/traefik
stage:
- bin/traefik
stage-packages:
- ca-certificates
# We moved this here because: https://github.com/canonical/rockcraft/issues/343
ca-certs:
plugin: nil
overlay-packages: [ca-certificates]
non-root-user:
plugin: nil
after: [default-config]
overlay-script: |
# Create a user in the $CRAFT_OVERLAY chroot
groupadd -R $CRAFT_OVERLAY -g 1000 traefik
useradd -R $CRAFT_OVERLAY -M -r -g traefik -u 1000 traefik
override-prime: |
craftctl default
chown -R 1000:1000 etc/traefik
deb-security-manifest:
plugin: nil
after:
- traefik
- traefik-frontend
- ca-certs
override-prime: |
set -x
mkdir -p $CRAFT_PRIME/usr/share/rocks/
(echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query --admindir=$CRAFT_PRIME/var/lib/dpkg/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > $CRAFT_PRIME/usr/share/rocks/dpkg.query
# TODO verification steps and testing framework

0 comments on commit ea0e942

Please sign in to comment.