From bc3da14d507bd49ac6ca7264274e686d3295cb07 Mon Sep 17 00:00:00 2001 From: Dane Moss Date: Fri, 12 Dec 2025 13:52:27 -0700 Subject: [PATCH] Add prosper config --- .gitlab-ci.yml | 72 +++++++++-------------------------------------- CHANGELOG.md | 14 +++++++++ Dockerfile | 5 +++- container-test.sh | 7 +++++ tasks.py | 2 ++ 5 files changed, 40 insertions(+), 60 deletions(-) create mode 100644 CHANGELOG.md create mode 100755 container-test.sh create mode 100644 tasks.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9b0d86f..85a2e0a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,26 +1,21 @@ -stages: - - test - - build - - publish - # - deploy +include: + - project: 'esv/bsf/pypi/prosper' + ref: v0.64.1 + file: '/prosper/templates/projects/docker.yml' variables: - # Container registry settings - REGISTRY: ${CI_REGISTRY} - IMAGE_NAME: ${CI_REGISTRY_IMAGE} - # Buildah settings - STORAGE_DRIVER: vfs - BUILDAH_FORMAT: docker - BUILDAH_ISOLATION: chroot +# renovate: datasource=gitlab-tags depName=esv/bsf/pypi/prosper versioning=semver registryUrl=https://gitlab.global.bsf.tools + PROSPER_VERSION: v0.64.1 + +kics: + allow_failure: true + +hadolint: + allow_failure: true -.buildah-base: - image: deps.global.bsf.tools/quay.io/buildah/stable:latest - before_script: - - buildah version - - buildah login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} # Run Python tests -test: +python_tests: stage: test image: deps.global.bsf.tools/docker/python:3.12-slim before_script: @@ -29,47 +24,6 @@ test: script: - cd backend - python -m pytest -v || echo "No tests yet" - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - -# Build container image for merge requests (no push) -build: - stage: build - extends: .buildah-base - script: - - | - buildah build \ - --build-arg NPM_REGISTRY=https://deps.global.bsf.tools/artifactory/api/npm/registry.npmjs.org/ \ - --tag ${IMAGE_NAME}:${CI_COMMIT_SHORT_SHA} \ - --label org.opencontainers.image.source=${CI_PROJECT_URL} \ - --label org.opencontainers.image.revision=${CI_COMMIT_SHA} \ - --label org.opencontainers.image.created=$(date -u +%Y-%m-%dT%H:%M:%SZ) \ - . - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - -# Build and push on main branch -publish: - stage: publish - extends: .buildah-base - script: - - | - buildah build \ - --build-arg NPM_REGISTRY=https://deps.global.bsf.tools/artifactory/api/npm/registry.npmjs.org/ \ - --tag ${IMAGE_NAME}:${CI_COMMIT_SHORT_SHA} \ - --tag ${IMAGE_NAME}:${CI_COMMIT_REF_SLUG} \ - --tag ${IMAGE_NAME}:latest \ - --label org.opencontainers.image.source=${CI_PROJECT_URL} \ - --label org.opencontainers.image.revision=${CI_COMMIT_SHA} \ - --label org.opencontainers.image.created=$(date -u +%Y-%m-%dT%H:%M:%SZ) \ - . - - buildah push ${IMAGE_NAME}:${CI_COMMIT_SHORT_SHA} - - buildah push ${IMAGE_NAME}:${CI_COMMIT_REF_SLUG} - - buildah push ${IMAGE_NAME}:latest - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - # deploy_helm_charts: # stage: deploy diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..698e43b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.0] - 2025-12-12 +### Changed +- Changed the Dockerfile npm build arg to use the deps.global.bsf.tools URL as the default registry (#45) +### Added +- Added Prosper docker template config (#45) diff --git a/Dockerfile b/Dockerfile index 45af76f..cee748d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Frontend build stage FROM node:20-alpine AS frontend-builder -ARG NPM_REGISTRY +ARG NPM_REGISTRY=https://deps.global.bsf.tools/artifactory/api/npm/registry.npmjs.org/ WORKDIR /app/frontend @@ -21,6 +21,9 @@ RUN npm run build # Runtime stage FROM python:3.12-slim +# Disable proxy cache +RUN echo 'Acquire::http::Pipeline-Depth 0;\nAcquire::http::No-Cache true;\nAcquire::BrokenProxy true;\n' > /etc/apt/apt.conf.d/99fixbadproxy + # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ diff --git a/container-test.sh b/container-test.sh new file mode 100755 index 0000000..788a629 --- /dev/null +++ b/container-test.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "testing container" + +# Without a sleep, local testing shows no output because attaching to the logs happens after the container is done executing +# this script. +sleep 1 diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..f11635f --- /dev/null +++ b/tasks.py @@ -0,0 +1,2 @@ +# Import docker project template tasks +from prosper.projects.docker import *