initial commit #2
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
services:
|
||||
yogastic:
|
||||
image: docker.rschneider.hu/infra/yogastic:202412282019.ae4bba3
|
||||
ports:
|
||||
- "84:80"
|
||||
54
environment/dev/docker/yogastic/readme.md
Normal file
54
environment/dev/docker/yogastic/readme.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Building the docker image
|
||||
|
||||
## Dockerfile
|
||||
|
||||
The Dockerfile can be found in the root folder of the project.
|
||||
|
||||
## Available Environment Variables
|
||||
|
||||
|
||||
| property name | description | values |
|
||||
|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
|
||||
| DB_TYPE | type of the db enginge. | mysql, h2 |
|
||||
| DB_URL | jdbc url of the db | "jdbc:mysql://ucs-intranet-db-author:3306/magnolia" |
|
||||
| DB_USER | username for the db | root |
|
||||
| DB_PASSWORD | password for the db | root |
|
||||
| CATALINA_OPTS_APPEND | Java options form tomcat | "-Xms512M -Xmx2048M " |
|
||||
| JAVA_OPTS | addition java options for application | "-agentlib:jdwp=transport=dt_socket,address=*:54455,server=y,suspend=n" |
|
||||
| MAGNOLIA_UPDATE_AUTO | set the property 'magnolia.update.auto' in magnolia.properties | ${MAGNOLIA_UPDATE_AUTO} |
|
||||
| MAGNOLIA_AUTHORINSTANCE_URL | public accessible url of the author instance | http://author.ucsintranet.at |
|
||||
| MAGNOLIA_UCSWEBSITE_AUTHORINSTANCE_URL | public accessible url of the author instance of the UCS website | http://author.ucsintranet.at |
|
||||
| MAGNOLIA_PUBLICINSTANCE_URL | public accessible url of the public instance | http://public.ucsintranet.at |
|
||||
| MAGNOLIA_PROFILE | the magnolia profile to use (see: https://docs.magnolia-cms.com/product-docs/6.2/releases/release-notes-for-magnolia-cms-6.2.2/#_profile_based_configuration_of_property_files) | magnoliaAuthor, magnoliaPublic |
|
||||
| KEYCLOAK_REALM | the keycloak realm to use | magnolia |
|
||||
| KEYCLOAK_CLIENT_ID_AUTHOR | the author keycloak client id | author.ucsintranet |
|
||||
| KEYCLOAK_CLIENT_ID_PUBLIC | the author keycloak client id | author.ucsintranet |
|
||||
| KEYCLOAK_AUTH_URL | <TBD> | ${KEYCLOAK_AUTH_URL} |
|
||||
| KEYCLOAK_SSL_REQUIRED | <TBD> | external |
|
||||
| KEYCLOAK_CREDENTIALS_SECRET_AUTHOR | author keycloak secret | |
|
||||
| KEYCLOAK_CREDENTIALS_SECRET_PUBLIC | public keycloak secret | |
|
||||
|
||||
## About the image
|
||||
|
||||
The image is based on the cli provided by magnolia ( a.k.a mgnl).
|
||||
To get more information about the mgnl cli tool, please visit the [mgnl documentation](https://docs.magnolia-cms.com/magnolia-cli/4.x/)
|
||||
|
||||
The project generated by the mgnl tool, already includes the author and public instances!
|
||||
Be sure, that in production you restrict the access to the author instance, and to the admin components
|
||||
|
||||
The image is set up so, that it uses the folder "/magnolia/light-modules" as resources dir.
|
||||
While build the image, the <PROJECT_ROOT>/magnolia/modules will be copied in to the image as "/magnolia/light-modules".
|
||||
For development, the <PROJECT_ROOT>/magnolia/modules can be mounted, so the changes in the lightmodules are "live/instant"
|
||||
|
||||
## Building & pushing the image
|
||||
|
||||
The easiest way to build and pusht the image is, to run the next commands
|
||||
```bash
|
||||
npm run docker:build
|
||||
```
|
||||
|
||||
```bash
|
||||
npm run docker:push
|
||||
```
|
||||
|
||||
For more details, pls examine the package.json file, and the scripts in docker/magnolia/scripts folder
|
||||
5
environment/dev/docker/yogastic/scripts/build.docker.build.sh
Executable file
5
environment/dev/docker/yogastic/scripts/build.docker.build.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
source "${CURRENT_DIR}/build.docker.build.step.inc.version.sh"
|
||||
source "${CURRENT_DIR}/build.docker.build.step.build.sh"
|
||||
12
environment/dev/docker/yogastic/scripts/build.docker.build.step.build.sh
Executable file
12
environment/dev/docker/yogastic/scripts/build.docker.build.step.build.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
# build docker image
|
||||
source "${CURRENT_DIR}/build.docker.env.sh"
|
||||
PROJECT_ROOT=$(readlink -f "${CURRENT_DIR}/../../../../..")
|
||||
|
||||
echo "build image ${TAG} from folder ${PROJECT_ROOT}"
|
||||
|
||||
cd $PROJECT_ROOT
|
||||
|
||||
docker build -t $TAG .
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# set the actual commit date and commit hash in version.txt
|
||||
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
GIT_BRANCH_SHORT=$(echo $GIT_BRANCH | cut -d "/" -f 1)
|
||||
GIT_COMMIT_DATE=$(git log -1 --format=%cd --date=format:%Y%m%d%H%M)
|
||||
GIT_COMMIT_ID_SHORT=$(git rev-parse --short HEAD)
|
||||
|
||||
VERSION=$GIT_COMMIT_DATE.$GIT_COMMIT_ID_SHORT
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
VERSION_FILE="${CURRENT_DIR}/version.txt"
|
||||
|
||||
echo "Saving version ${VERSION} to file ${VERSION_FILE}"
|
||||
|
||||
echo $VERSION
|
||||
echo $VERSION > $VERSION_FILE
|
||||
|
||||
9
environment/dev/docker/yogastic/scripts/build.docker.env.sh
Executable file
9
environment/dev/docker/yogastic/scripts/build.docker.env.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
VERSION_FILE="${CURRENT_DIR}/version.txt"
|
||||
echo "Reading version file: ${VERSION_FILE}"
|
||||
|
||||
export VERSION=$(cat "${VERSION_FILE}")
|
||||
|
||||
export TAG=docker.rschneider.hu/infra/yogastic:$VERSION
|
||||
7
environment/dev/docker/yogastic/scripts/build.docker.push.sh
Executable file
7
environment/dev/docker/yogastic/scripts/build.docker.push.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
# push docker image
|
||||
source "${CURRENT_DIR}/build.docker.env.sh"
|
||||
echo "push image ${TAG}"
|
||||
docker push $TAG
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
source "${CURRENT_DIR}/build.docker.env.sh"
|
||||
source "${CURRENT_DIR}/start.docker.env.sh"
|
||||
|
||||
cd ${ENV_DEV_DIR}
|
||||
docker-compose down
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ENV_DEV_DIR=$(readlink -f "${CURRENT_DIR}/../../../environments/dev/docker-compose")
|
||||
COMPOSE_FILE=$(readlink -f "/docker-compose.yml")
|
||||
8
environment/dev/docker/yogastic/scripts/start.docker.compose.start.sh
Executable file
8
environment/dev/docker/yogastic/scripts/start.docker.compose.start.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
source "${CURRENT_DIR}/start.docker.compose.env.sh"
|
||||
|
||||
cd "${ENV_DEV_DIR}"
|
||||
echo "starting compose file in ${ENV_DEV_DIR}"
|
||||
docker compose up -d
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
source "${CURRENT_DIR}/build.docker.env.sh"
|
||||
source "${CURRENT_DIR}/start.docker.compose.env.sh"
|
||||
echo "updating image version to ${VERSION} in compose file ${COMPOSE_FILE}"
|
||||
#export TAG=docker.rschneider.hu/infra/yogastic:$VERSION
|
||||
|
||||
case $(uname) in
|
||||
"Darwin")
|
||||
echo "Detected macOS"
|
||||
sed -i'' -e "s/docker.rschneider.hu\\/infra\\/yogastic:.*/docker.rschneider.hu\\/infra\\/yogastic:$VERSION/g" $COMPOSE_FILE
|
||||
;;
|
||||
*)
|
||||
sed -i "s/docker.rschneider.hu\\/infra\\/yogastic:.*/docker.rschneider.hu\\/infra\\/yogastic:$VERSION/g" $COMPOSE_FILE
|
||||
#sed -i "s/docker.rschneider.hu\\/infra\\/yogastic:.*/docker.rschneider.hu\\/infra\\/yogastic:$VERSION/g" $COMPOSE_FILE
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
source "${CURRENT_DIR}/build.docker.env.sh"
|
||||
source "${CURRENT_DIR}/start.docker.compose.env.sh"
|
||||
|
||||
cd ${ENV_DEV_DIR}
|
||||
echo "Destroy compose in ${ENV_DEV_DIR}"
|
||||
docker compose down -v
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
source "${CURRENT_DIR}/build.docker.env.sh"
|
||||
source "${CURRENT_DIR}/start.docker.compose.env.sh"
|
||||
|
||||
cd ${ENV_DEV_DIR}
|
||||
echo "Stopping compose in ${ENV_DEV_DIR}"
|
||||
docker compose down
|
||||
1
environment/dev/docker/yogastic/scripts/version.txt
Normal file
1
environment/dev/docker/yogastic/scripts/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
202412282019.ae4bba3
|
||||
29
environment/infra/docker-compose/docker-compose.yaml
Normal file
29
environment/infra/docker-compose/docker-compose.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
services:
|
||||
vaultwarden:
|
||||
labels:
|
||||
- traefik.http.routers.vaultwarden.rule=Host(`vaultwarden.rschneider.net`)
|
||||
- traefik.http.routers.vaultwarden.tls=true
|
||||
- traefik.http.routers.vaultwarden.service=vaultwarden
|
||||
- traefik.http.services.vaultwarden.loadbalancer.server.port=80
|
||||
- traefik.http.routers.vaultwarden-public.rule=Host(`password.rschneider.hu`)
|
||||
- traefik.http.routers.vaultwarden-public.tls=true
|
||||
- traefik.http.routers.vaultwarden-public.service=vaultwarden-public
|
||||
- traefik.http.services.vaultwarden-public.loadbalancer.server.port=80
|
||||
# - traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https
|
||||
# - traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent=true
|
||||
image: vaultwarden/server:latest
|
||||
container_name: vaultwarden
|
||||
restart: always
|
||||
environment:
|
||||
# DOMAIN: "https://vaultwarden.example.com" # required when using a reverse proxy; your domain; vaultwarden needs to know it's https to work properly with attachments
|
||||
SIGNUPS_ALLOWED: "true" # Deactivate this with "false" after you have created your account so that no strangers can register
|
||||
volumes:
|
||||
- ./vw-data:/data # the path before the : can be changed
|
||||
ports:
|
||||
- 4111:80 # you can replace the 11001 with your preferred port
|
||||
networks:
|
||||
traefik_traefik:
|
||||
|
||||
networks:
|
||||
traefik_traefik:
|
||||
external: true
|
||||
26
environment/infra/jenkins/Jenkinsfile
vendored
Normal file
26
environment/infra/jenkins/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Git pull && docker compose restart') {
|
||||
steps {
|
||||
sshPublisher(publishers: [sshPublisherDesc(configName: 'infra.1', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '''cd /home/rschneider/infra
|
||||
git pull
|
||||
cd /home/rschneider/infra/grafana/docker-compose/grafana
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
''', execTimeout: 120000,
|
||||
flatten: false,
|
||||
makeEmptyDirs: false,
|
||||
noDefaultExcludes: false,
|
||||
patternSeparator: '[, ]+',
|
||||
remoteDirectory: '',
|
||||
remoteDirectorySDF: false,
|
||||
removePrefix: '', sourceFiles: '')],
|
||||
usePromotionTimestamp: false,
|
||||
useWorkspaceInPromotion: false,
|
||||
verbose: true)])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user