Compare commits

..

11 Commits

Author SHA1 Message Date
13ac2b6959 fup 2023-06-19 15:55:07 +02:00
f08ffe10d8 fup 2023-06-19 15:15:23 +02:00
0178bdba9b fup-try-009 2023-06-19 14:58:25 +02:00
932ce45164 fup-try-008 2023-06-19 14:48:02 +02:00
1cccf13204 fup-try-007 2023-06-19 14:38:10 +02:00
a9bc31ea83 fup-try-005 2023-06-19 14:36:33 +02:00
04565f87a9 fup 2023-06-19 14:32:31 +02:00
6c0dab4b38 fup 2023-06-19 14:29:43 +02:00
26fd9f2e9f fup 2023-06-19 14:28:01 +02:00
dcb1650d4a fup-try-001 2023-06-19 14:19:17 +02:00
ea3f7f63d0 feat(jenkins): adding new default jenkins configuration 2023-06-19 13:58:25 +02:00
6 changed files with 25 additions and 18 deletions

12
Jenkinsfile vendored
View File

@ -8,17 +8,25 @@ symfonyAppPipeline('ubuntu:22.04', [
'hooks': [ 'hooks': [
// Run docker image build, verification and publication stages // Run docker image build, verification and publication stages
'postSymfonyAppPipeline': { 'postSymfonyAppPipeline': {
stage('Build and publish docker images') { stage('Build and publish hydra-dispatcher image') {
// Retrieve current tag // Retrieve current tag
String currentTag = sh(script: 'git tag --points-at HEAD | head -n 1', returnStdout: true).trim() String currentTag = sh(script: 'git tag --points-at HEAD | head -n 1', returnStdout: true).trim()
// Retrieve default tag // Retrieve default tag
String defaultTag = sh(returnStdout: true, script: 'git describe --always').trim() String defaultTag = sh(returnStdout: true, script: 'git describe --always').trim()
kubecontainer.buildAndPublishImage([ container.buildAndPublishImage([
'imageName': 'reg.cadoles.com/pcaseiro/myapplication-standalone', 'imageName': 'reg.cadoles.com/pcaseiro/myapplication-standalone',
// Use current tag or default tag if not defined
'imageTag': defaultTag, 'imageTag': defaultTag,
'dockerfile': './misc/images/myapplication-standalone/Dockerfile', 'dockerfile': './misc/images/myapplication-standalone/Dockerfile',
'dryRun': false '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 Kubernetes Skeletor project # Makefile for Cadoles SP
################################################## ################################
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_REPO ?= reg.cadoles.com/cadoles
IMAGE_VERSION ?= 0.0.1-$(CURRENT_BRANCH) IMAGE_VERSION ?= 0.0.1
DAY_SUFFIX_TAG ?= $(shell date +%Y%m%d)
COMMIT_ID ?= $(shell git rev-parse --short --verify HEAD)
include main.mk include main.mk

View File

@ -73,11 +73,10 @@ init_app() {
return 2 return 2
fi fi
git clone ${SKELL_GIT_URL} ${appDest} git clone --branch "feat/automation" ${SKELL_GIT_URL} ${appDest}
cd ${appDest} cd ${appDest}
rm -rf .git rm -rf .git
rm -rf init-app
echo "Setting Dockerfiles" echo "Setting Dockerfiles"
dirs=$(find ${DOCKERFILES_ROOT}/* -type d -name 'myapplication-*') dirs=$(find ${DOCKERFILES_ROOT}/* -type d -name 'myapplication-*')

View File

@ -30,8 +30,8 @@ endef
define release_image 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)-$(COMMIT_ID) ; \
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION); \ docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION); \
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-latest; \ docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:latest ; \
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-latest ; \ docker push $(IMAGE_REPO)/$1:latest ; \
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION) ; \ docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION) ; \
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(COMMIT_ID) docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(COMMIT_ID)
endef endef

View File

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

View File

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