feat(dependencies): add requirementsFile validation and caching for pip installations; update timeout to 120 minutes; set image tags to 0.0.0; configure payment ingress
Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
parent
7b00ee94ee
commit
e53b6b03b5
@ -52,7 +52,24 @@ class DependenciesResolver {
|
|||||||
|
|
||||||
switch (mgr) {
|
switch (mgr) {
|
||||||
case DependenciesManager.PIP:
|
case DependenciesManager.PIP:
|
||||||
steps.log.warn("Dependencies Resolver","Python project no need to resolving dependencies, skipping...")
|
if (configurations.requirementsFile == null || configurations.requirementsFile.isEmpty()) {
|
||||||
|
steps.error("requirementsFile is required when using PIP as dependencies manager")
|
||||||
|
}
|
||||||
|
|
||||||
|
def requirementsFile = configurations.requirementsFile
|
||||||
|
|
||||||
|
if (cachingEnabled) {
|
||||||
|
steps.dir(this.workspace) {
|
||||||
|
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', cacheName: "${component.name}-pip-cache", includes: '**/*', path: '.pip-cache', cacheValidityDecidingFile: 'requirements.txt']]) {
|
||||||
|
steps.sh "pip install --cache-dir .pip-cache -r ${requirementsFile}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
steps.dir(this.workspace) {
|
||||||
|
steps.sh "pip install -r ${requirementsFile}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
case DependenciesManager.NPM:
|
case DependenciesManager.NPM:
|
||||||
if (configurations.npmPackageJsonFile == null || configurations.npmPackageJsonFile.isEmpty()) {
|
if (configurations.npmPackageJsonFile == null || configurations.npmPackageJsonFile.isEmpty()) {
|
||||||
@ -65,7 +82,7 @@ class DependenciesResolver {
|
|||||||
|
|
||||||
if (cachingEnabled) {
|
if (cachingEnabled) {
|
||||||
steps.dir(this.workspace) {
|
steps.dir(this.workspace) {
|
||||||
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: '.npm-cache', cacheValidityDecidingFile: 'package-lock.json']]) {
|
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', cacheName: "${component.name}-npm-cache", includes: '**/*', path: '.npm-cache', cacheValidityDecidingFile: 'package-lock.json']]) {
|
||||||
steps.sh "npm install --cache .npm-cache --prefer-offline --no-audit"
|
steps.sh "npm install --cache .npm-cache --prefer-offline --no-audit"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,7 +104,7 @@ class DependenciesResolver {
|
|||||||
|
|
||||||
if (cachingEnabled) {
|
if (cachingEnabled) {
|
||||||
steps.dir(this.workspace) {
|
steps.dir(this.workspace) {
|
||||||
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: '.yarn-cache', cacheValidityDecidingFile: 'yarn.lock']]) {
|
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', cacheName: "${component.name}-pnpm-cache", path: '.yarn-cache', cacheValidityDecidingFile: 'yarn.lock']]) {
|
||||||
steps.sh "yarn install --cache-folder .yarn-cache --prefer-offline"
|
steps.sh "yarn install --cache-folder .yarn-cache --prefer-offline"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -633,7 +633,7 @@ def call(Closure closure) {
|
|||||||
agent any
|
agent any
|
||||||
options {
|
options {
|
||||||
buildDiscarder(logRotator(numToKeepStr: '25'))
|
buildDiscarder(logRotator(numToKeepStr: '25'))
|
||||||
timeout(time: 30, unit: 'MINUTES')
|
timeout(time: 120, unit: 'MINUTES')
|
||||||
parallelsAlwaysFailFast()
|
parallelsAlwaysFailFast()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ executeFreeleapsPipeline {
|
|||||||
root: 'apps/authentication',
|
root: 'apps/authentication',
|
||||||
language: 'python',
|
language: 'python',
|
||||||
dependenciesManager: 'pip',
|
dependenciesManager: 'pip',
|
||||||
|
requirementsFile: 'requirements.txt',
|
||||||
buildCacheEnabled: true,
|
buildCacheEnabled: true,
|
||||||
buildAgentImage: 'python:3.10-slim-buster',
|
buildAgentImage: 'python:3.10-slim-buster',
|
||||||
buildArtifacts: ['.'],
|
buildArtifacts: ['.'],
|
||||||
@ -35,6 +36,7 @@ executeFreeleapsPipeline {
|
|||||||
root: 'apps/central_storage',
|
root: 'apps/central_storage',
|
||||||
language: 'python',
|
language: 'python',
|
||||||
dependenciesManager: 'pip',
|
dependenciesManager: 'pip',
|
||||||
|
requirementsFile: 'requirements.txt',
|
||||||
buildAgentImage: 'python:3.10-slim-buster',
|
buildAgentImage: 'python:3.10-slim-buster',
|
||||||
buildArtifacts: ['.'],
|
buildArtifacts: ['.'],
|
||||||
buildCacheEnabled: true,
|
buildCacheEnabled: true,
|
||||||
@ -55,6 +57,7 @@ executeFreeleapsPipeline {
|
|||||||
root: 'apps/content',
|
root: 'apps/content',
|
||||||
language: 'python',
|
language: 'python',
|
||||||
dependenciesManager: 'pip',
|
dependenciesManager: 'pip',
|
||||||
|
requirementsFile: 'requirements.txt',
|
||||||
buildAgentImage: 'python:3.10-slim-buster',
|
buildAgentImage: 'python:3.10-slim-buster',
|
||||||
buildArtifacts: ['.'],
|
buildArtifacts: ['.'],
|
||||||
buildCacheEnabled: true,
|
buildCacheEnabled: true,
|
||||||
@ -75,6 +78,7 @@ executeFreeleapsPipeline {
|
|||||||
root: 'apps/notification',
|
root: 'apps/notification',
|
||||||
language: 'python',
|
language: 'python',
|
||||||
dependenciesManager: 'pip',
|
dependenciesManager: 'pip',
|
||||||
|
requirementsFile: 'requirements.txt',
|
||||||
buildAgentImage: 'python:3.10-slim-buster',
|
buildAgentImage: 'python:3.10-slim-buster',
|
||||||
buildArtifacts: ['.'],
|
buildArtifacts: ['.'],
|
||||||
buildCacheEnabled: true,
|
buildCacheEnabled: true,
|
||||||
@ -95,6 +99,7 @@ executeFreeleapsPipeline {
|
|||||||
root: 'apps/payment',
|
root: 'apps/payment',
|
||||||
language: 'python',
|
language: 'python',
|
||||||
dependenciesManager: 'pip',
|
dependenciesManager: 'pip',
|
||||||
|
requirementsFile: 'requirements.txt',
|
||||||
buildAgentImage: 'python:3.10-slim-buster',
|
buildAgentImage: 'python:3.10-slim-buster',
|
||||||
buildArtifacts: ['.'],
|
buildArtifacts: ['.'],
|
||||||
buildCacheEnabled: true,
|
buildCacheEnabled: true,
|
||||||
|
|||||||
@ -8,7 +8,7 @@ central-storage:
|
|||||||
registry: docker.io
|
registry: docker.io
|
||||||
repository: null
|
repository: null
|
||||||
name: central_storage
|
name: central_storage
|
||||||
tag: snapshot-da584b8
|
tag: 0.0.0
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@ -8,7 +8,7 @@ content:
|
|||||||
registry: docker.io
|
registry: docker.io
|
||||||
repository: null
|
repository: null
|
||||||
name: content
|
name: content
|
||||||
tag: snapshot-da584b8
|
tag: 0.0.0
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@ -8,7 +8,7 @@ notification:
|
|||||||
registry: docker.io
|
registry: docker.io
|
||||||
repository: null
|
repository: null
|
||||||
name: notification
|
name: notification
|
||||||
tag: snapshot-da584b8
|
tag: 0.0.0
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@ -27,7 +27,24 @@ payment:
|
|||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
port: 8006
|
port: 8006
|
||||||
targetPort: 8006
|
targetPort: 8006
|
||||||
ingresses: {}
|
ingresses:
|
||||||
|
- name: payment-ingress
|
||||||
|
host: alpha.payment.freeleaps.mathmast.com
|
||||||
|
class: nginx
|
||||||
|
rules:
|
||||||
|
- path: /*
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: payment-service
|
||||||
|
port:
|
||||||
|
number: 8006
|
||||||
|
tls:
|
||||||
|
exists: false
|
||||||
|
issuerRef:
|
||||||
|
name: mathmast-dot-com
|
||||||
|
kind: ClusterIssuer
|
||||||
|
name: alpha.payment.freeleaps.mathmast.com-cert
|
||||||
configs:
|
configs:
|
||||||
tz: America/Settle
|
tz: America/Settle
|
||||||
appName: payment
|
appName: payment
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user