3 Commits

6 changed files with 17 additions and 29 deletions

12
Jenkinsfile vendored
View File

@ -8,25 +8,17 @@ symfonyAppPipeline('ubuntu:22.04', [
'hooks': [
// Run docker image build, verification and publication stages
'postSymfonyAppPipeline': {
stage('Build and publish hydra-dispatcher image') {
stage('Build and publish docker images') {
// Retrieve current tag
String currentTag = sh(script: 'git tag --points-at HEAD | head -n 1', returnStdout: true).trim()
// Retrieve default tag
String defaultTag = sh(returnStdout: true, script: 'git describe --always').trim()
container.buildAndPublishImage([
kubecontainer.buildAndPublishImage([
'imageName': 'reg.cadoles.com/pcaseiro/myapplication-standalone',
// Use current tag or default tag if not defined
'imageTag': defaultTag,
'dockerfile': './misc/images/myapplication-standalone/Dockerfile',
'dryRun': false
])
container.buildAndPublishImage([
'imageName': 'reg.cadoles.com/pcaseiro/myapplication-kube',
// Use current tag or default tag if not defined
'imageTag': defaultTag,
'dockerfile': './misc/images/myapplication-kube/Dockerfile',
'dryRun': false
])
}
}
]

View File

@ -1,12 +1,12 @@
################################
# Makefile for Cadoles SP
################################
IMAGE_REPO ?= reg.cadoles.com/cadoles
IMAGE_VERSION ?= 0.0.1
DAY_SUFFIX_TAG ?= $(shell date +%Y%m%d)
##################################################
# Makefile for Cadoles Kubernetes Skeletor project
##################################################
COMMIT_ID ?= $(shell git rev-parse --short --verify HEAD)
CURRENT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD | tr -c '[:alnum:]\n\r' '_'| tr '[:upper:]' '[:lower:]')
IMAGE_REPO ?= reg.cadoles.com/cadoles
IMAGE_VERSION ?= 0.0.1-$(CURRENT_BRANCH)
include main.mk

View File

@ -30,8 +30,8 @@ endef
define release_image
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(COMMIT_ID) ; \
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION); \
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:latest ; \
docker push $(IMAGE_REPO)/$1:latest ; \
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-latest; \
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-latest ; \
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION) ; \
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(COMMIT_ID)
endef

View File

@ -40,15 +40,15 @@ spec:
name: myapplication-nginx
args: ["/usr/sbin/nginx"]
env:
- name: NGINX_myapplication_UPSTREAM_BACKEND_SERVER
- name: NGINX_APP_UPSTREAM_BACKEND_SERVER
value: 127.0.0.1:9000
- name: NGINX_myapplication_ROOT
- name: NGINX_APP_ROOT
value: "/public"
- name: NGINX_myapplication_PHP_INDEX
- name: NGINX_APP_PHP_INDEX
value: "/index.php"
- name: NGINX_ERROR_LOG_LEVEL
value: "warn"
- name: NGINX_myapplication_PHP_NON_FILE_PATTERN
- name: NGINX_APP_PHP_NON_FILE_PATTERN
value: "^/index\\.php(/|$)"
ports:
- containerPort: 8080

View File

@ -1,4 +0,0 @@
- op: add
path: "/spec/template/spec/imagePullSecrets"
value:
- name: regcred-dev

View File

@ -18,4 +18,4 @@ spec:
service:
name: myapplication
port:
number: 8080
number: 80