Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/devel' into feature/cloud-nac
Browse files Browse the repository at this point in the history
  • Loading branch information
julsemaan committed Dec 13, 2022
2 parents 6f8afc7 + 13ba0e1 commit 8700e75
Show file tree
Hide file tree
Showing 152 changed files with 2,214 additions and 795 deletions.
128 changes: 93 additions & 35 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ stages:
################################################################################
variables:
# synced with Pipeline timeout in GitLab UI
PIPELINE_TIMEOUT: 170m
PIPELINE_TIMEOUT_SCRIPT: 160m
PIPELINE_TIMEOUT_AFTER_SCRIPT: 10m
BUILD_PFAPPSERVER_VUE: "yes"
PFBUILD_CENTOS_8_IMG: ghcr.io/inverse-inc/packetfence/pfbuild-centos-8
PFBUILD_DEB_BULLSEYE_IMG: ghcr.io/inverse-inc/packetfence/pfbuild-debian-bullseye
KANIKO_DEBUG_IMG: gcr.io/kaniko-project/executor:debug
KANIKOBUILD_IMG: ghcr.io/inverse-inc/packetfence/kaniko-build
KNK_REGISTRY: ghcr.io
KNK_REGISTRY_URL: ${KNK_REGISTRY}/inverse-inc/packetfence
KNK_CACHE: "true"
PFBUILD_DEFAULT_DEV_TAG: latest
CIDIR: ci
CILIBDIR: ci/lib
Expand Down Expand Up @@ -274,11 +275,38 @@ variables:
.build_img_docker_job:
stage: build_img
script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${PACKERDIR} build_img_docker_pfbuild
- timeout ${PIPELINE_TIMEOUT_SCRIPT} make -e -C ${PACKERDIR} build_img_docker_pfbuild
tags:
- shell

.build_img_container_job:
.build_img_container_job_dev:
stage: build_img_container
dependencies: []
image: ${KANIKOBUILD_IMG}:${CI_COMMIT_REF_SLUG}
script:
- /bin/kanikobuild
tags:
- docker

.build_img_container_job_br_maint:
stage: build_img_container
dependencies: []
image: ${KANIKOBUILD_IMG}:${CI_COMMIT_REF_SLUG}
script:
- /bin/kanikobuild
tags:
- docker

.build_img_container_job_rel:
stage: build_img_container
dependencies: []
image: ${KANIKOBUILD_IMG}:${CI_COMMIT_TAG}
script:
- /bin/kanikobuild
tags:
- docker

.build_img_container_kanikobuild_job:
stage: build_img_container
dependencies: []
image:
Expand All @@ -295,9 +323,9 @@ variables:
RESULT_DIR: /var/local/gitlab-runner/vagrant_img
BOX_DESC: ${CI_PIPELINE_URL}
script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${VAGRANT_IMG_DIR} ${BOX_NAME}
- timeout ${PIPELINE_TIMEOUT_SCRIPT} make -e -C ${VAGRANT_IMG_DIR} ${BOX_NAME}
after_script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${VAGRANT_IMG_DIR} clean
- timeout ${PIPELINE_TIMEOUT_AFTER_SCRIPT} make -e -C ${VAGRANT_IMG_DIR} clean
tags:
- shell
- inverse.ca
Expand Down Expand Up @@ -443,6 +471,7 @@ variables:
script:
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-release
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-export
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-ci-lib
tags:
- shell

Expand All @@ -465,8 +494,7 @@ variables:
name: sourceforge
url: ${SF_ZEN_REPO_URL}/${CI_COMMIT_REF_NAME}
after_script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${ZENDIR} clean
- timeout ${PIPELINE_TIMEOUT} make -e -C ${ZENDIR} clean_cache
- timeout ${PIPELINE_TIMEOUT_AFTER_SCRIPT} make -e -C ${ZENDIR} clean_all
dependencies: []
tags:
- shell
Expand All @@ -476,7 +504,7 @@ variables:
environment:
name: sourceforge
after_script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${ISODIR} clean
- timeout ${PIPELINE_TIMEOUT_AFTER_SCRIPT} make -e -C ${ISODIR} clean
dependencies: []
tags:
- shell
Expand All @@ -487,9 +515,9 @@ variables:
RESULT_DIR: /var/local/gitlab-runner/vagrant_img
BOX_DESC: ${CI_PIPELINE_URL}
script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${VAGRANT_IMG_DIR} ${BOX_NAME}
- timeout ${PIPELINE_TIMEOUT_SCRIPT} make -e -C ${VAGRANT_IMG_DIR} ${BOX_NAME}
after_script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${VAGRANT_IMG_DIR} clean
- timeout ${PIPELINE_TIMEOUT_AFTER_SCRIPT} make -e -C ${VAGRANT_IMG_DIR} clean
dependencies: []
tags:
- inverse.ca
Expand All @@ -507,9 +535,9 @@ variables:
variables:
VAGRANT_COMMON_DOTFILE_PATH: /var/local/gitlab-runner/vagrant/vagrant-common-${CI_COMMIT_REF_SLUG}
script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${TESTDIR} MAKE_TARGET=run ${CI_JOB_NAME}
- timeout ${PIPELINE_TIMEOUT_SCRIPT} make -e -C ${TESTDIR} MAKE_TARGET=run ${CI_JOB_NAME}
after_script:
- timeout ${PIPELINE_TIMEOUT} ${TESTCIDIR}/clean-test-environment.sh
- timeout ${PIPELINE_TIMEOUT_AFTER_SCRIPT} ${TESTCIDIR}/clean-test-environment.sh

################################################################################
# JOBS
Expand All @@ -528,17 +556,26 @@ run_pipeline_if_necessary:
# BUILD_IMG_CONTAINER JOBS
########################################
# devel
kaniko_dev:
extends:
- .build_img_container_kanikobuild_job
- .build_img_container_devel_rules
variables:
IMAGE_NAME: "kaniko-build"
IMAGE_TAGS: "${CI_COMMIT_REF_SLUG},latest"

pfdeb_dev:
extends:
- .build_img_container_job
- .build_img_container_job_dev
- .build_img_container_devel_rules
needs: ["kaniko_dev"]
variables:
IMAGE_NAME: "pfdebian"
IMAGE_TAGS: "${CI_COMMIT_REF_SLUG},latest"

pfdeb_based_dev:
extends:
- .build_img_container_job
- .build_img_container_job_dev
- .build_img_container_devel_rules
needs: ["pfdeb_dev"]
variables:
Expand Down Expand Up @@ -568,8 +605,9 @@ pfdeb_based_dev:

img_dev:
extends:
- .build_img_container_job
- .build_img_container_job_dev
- .build_img_container_devel_rules
needs: ["kaniko_dev"]
variables:
IMAGE_TAGS: "${CI_COMMIT_REF_SLUG},latest"
parallel:
Expand All @@ -579,7 +617,7 @@ img_dev:

rad_based_dev:
extends:
- .build_img_container_job
- .build_img_container_job_dev
- .build_img_container_devel_rules
needs: ["pfdeb_based_dev"]
variables:
Expand All @@ -594,17 +632,26 @@ rad_based_dev:
- "radiusd-eduroam"

# branches and maintenance
kaniko_br_maint:
extends:
- .build_img_container_kanikobuild_job
- .build_img_container_branches_and_maintenance_rules
variables:
IMAGE_NAME: "kaniko-build"
IMAGE_TAGS: ${CI_COMMIT_REF_SLUG}

pfdeb_br_maint:
extends:
- .build_img_container_job
- .build_img_container_job_br_maint
- .build_img_container_branches_and_maintenance_rules
needs: ["kaniko_br_maint"]
variables:
IMAGE_NAME: "pfdebian"
IMAGE_TAGS: ${CI_COMMIT_REF_SLUG}

pfdeb_based_br_maint:
extends:
- .build_img_container_job
- .build_img_container_job_br_maint
- .build_img_container_branches_and_maintenance_rules
needs: ["pfdeb_br_maint"]
variables:
Expand Down Expand Up @@ -634,8 +681,9 @@ pfdeb_based_br_maint:

img_br_maint:
extends:
- .build_img_container_job
- .build_img_container_job_br_maint
- .build_img_container_branches_and_maintenance_rules
needs: ["kaniko_br_maint"]
variables:
IMAGE_TAGS: ${CI_COMMIT_REF_SLUG}
parallel:
Expand All @@ -645,7 +693,7 @@ img_br_maint:

rad_based_br_maint:
extends:
- .build_img_container_job
- .build_img_container_job_br_maint
- .build_img_container_branches_and_maintenance_rules
needs: ["pfdeb_based_br_maint"]
variables:
Expand All @@ -660,17 +708,26 @@ rad_based_br_maint:
- "radiusd-eduroam"

# release
kaniko_rel:
extends:
- .build_img_container_kanikobuild_job
- .release_only_rules
variables:
IMAGE_NAME: "kaniko-build"
IMAGE_TAGS: ${CI_COMMIT_TAG}

pfdeb_rel:
extends:
- .build_img_container_job
- .build_img_container_job_rel
- .release_only_rules
needs: ["kaniko_rel"]
variables:
IMAGE_NAME: "pfdebian"
IMAGE_TAGS: ${CI_COMMIT_TAG}

pfdeb_based_rel:
extends:
- .build_img_container_job
- .build_img_container_job_rel
- .release_only_rules
needs: ["pfdeb_rel"]
variables:
Expand Down Expand Up @@ -698,19 +755,20 @@ pfdeb_based_rel:
- "proxysql"

img_rel:
extends:
- .build_img_container_job
- .release_only_rules
variables:
extends:
- .build_img_container_job_rel
- .release_only_rules
needs: ["kaniko_rel"]
variables:
IMAGE_TAGS: ${CI_COMMIT_TAG}
parallel:
matrix:
- IMAGE_NAME:
parallel:
matrix:
- IMAGE_NAME:
- "fingerbank-db"

rad_based_rel:
extends:
- .build_img_container_job
- .build_img_container_job_rel
- .release_only_rules
needs: ["pfdeb_based_rel"]
variables:
Expand Down Expand Up @@ -1419,13 +1477,13 @@ build_pf_img_zen_devel_branches_and_maintenance:
- .build_pf_img_zen_job
- .build_pf_img_zen_devel_branches_and_maintenance_rules
script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${ZENDIR} zen-deb11
- timeout ${PIPELINE_TIMEOUT_SCRIPT} make -e -C ${ZENDIR} zen-deb11

build_pf_img_zen_release:
extends:
- .build_pf_img_zen_job
script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${ZENDIR} zen-deb11
- timeout ${PIPELINE_TIMEOUT_SCRIPT} make -e -C ${ZENDIR} zen-deb11
# workaround for https://forum.gitlab.com/t/specify-when-at-job-level-with-a-job-that-has-rules/4769
rules:
- if: '$CI_COMMIT_TAG'
Expand All @@ -1440,7 +1498,7 @@ build_pf_img_iso_devel_branches_and_maintenance:
environment:
url: ${SF_ISO_REPO_URL}/${CI_COMMIT_REF_SLUG}
script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${ISODIR} iso
- timeout ${PIPELINE_TIMEOUT_SCRIPT} make -e -C ${ISODIR} iso

build_pf_img_iso_release:
extends:
Expand All @@ -1450,7 +1508,7 @@ build_pf_img_iso_release:
environment:
url: ${SF_ISO_REPO_URL}/${CI_COMMIT_TAG}
script:
- timeout ${PIPELINE_TIMEOUT} make -e -C ${ISODIR} iso
- timeout ${PIPELINE_TIMEOUT_SCRIPT} make -e -C ${ISODIR} iso
# workaround for https://forum.gitlab.com/t/specify-when-at-job-level-with-a-job-that-has-rules/4769
rules:
- if: '$CI_COMMIT_TAG'
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,20 @@ pfconnector_remote_install:
make -C $(SRC_GODIR) pfconnector
install -v -m 0755 $(SRC_GODIR)/pfconnector $(DESTDIR)$(PFCONNECTOR_BINDIR)/pfconnector

# install -D will automatically create target directories
# SRC_RELATIVE_CILIBDIR is used to only get relative paths from PF source tree
# $$file in destination of install command contain relative path
.PHONY: ci_lib_install
ci_lib_install:
@echo "create directories under $(DESTDIR)$(CIDIR)"
install -d -m0755 $(DESTDIR)$(CIDIR)
install -d -m0755 $(DESTDIR)$(CILIBDIR)

@echo "install $(SRC_RELATIVE_CILIBDIR) files"
for file in $(shell find $(SRC_RELATIVE_CILIBDIR) -type f); do \
install -v -m 0644 $$file -D $(DESTDIR)$(PF_PREFIX)/$$file ; \
done

# packetfence-export package
.PHONY: distclean-packetfence-export
distclean-packetfence-export:
Expand Down Expand Up @@ -358,3 +372,8 @@ material: DESTDIR=result
material:
mkdir -p $(CURDIR)/$(DESTDIR)
perl $(SRC_ADDONSDIR)/dev-helpers/bin/switch_options_table.pl > $(CURDIR)/$(DESTDIR)/material.html

html/captive-portal/profile-templates/default/logo.png:
mkdir -p html/captive-portal/profile-templates/default
cp html/common/packetfence-cp.png /usr/local/pf/html/captive-portal/profile-templates/default/logo.png

6 changes: 6 additions & 0 deletions NEWS.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ For a list of compatibility related changes see the <<PacketFence_Upgrade_Guide.
=== Enhancements
* Allow proxysql to be configure to connect to a single external database.
* Allow image files to be uploaded in a connection profile.
=== Bug Fixes
* Force the destination IP for UDP packets going through the pfconnector (#7323)
* Clear the active dynamic reverses that exist when a pfconnector reconnects
== Version 12.1.0 released on 2022-11-22
=== New Features
Expand Down
4 changes: 2 additions & 2 deletions addons/vagrant/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# versions in roles should be equals to tags
roles:
- src: inverse_inc.gitlab_buildpkg_tools
version: v1.3.2
version: v1.3.5

# For roles, to test locally with Vagrant (due to --force option)
# Ansible will create an export, not a symlink to git repository
Expand All @@ -21,7 +21,7 @@ collections:
- name: inverse_inc.cumulus
version: 1.1.1
- name: inverse_inc.utils
version: 1.1.1
version: 1.1.2
- name: inverse_inc.wireless
version: 0.2.2

Expand Down
Loading

0 comments on commit 8700e75

Please sign in to comment.