Skip to content

Commit

Permalink
Diploi Next changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusAhlfors committed Oct 16, 2023
1 parent 2b37d40 commit d2b2106
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 35 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/DiploiTemplateBuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -42,6 +45,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/arm64
pull: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN apt-get update && apt-get install -y nano supervisor openssh-server git bash
# Install PostgreSQL client
#RUN apt-get install -y postgresql-client

RUN mkdir /run/sshd /root/.ssh \
RUN mkdir -p /run/sshd /root/.ssh \
&& chmod 0700 /root/.ssh \
&& ssh-keygen -A \
&& sed -i s/^#PasswordAuthentication\ yes/PasswordAuthentication\ no/ /etc/ssh/sshd_config \
Expand Down
8 changes: 4 additions & 4 deletions diploi-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,21 @@ storage:
- production
- staging
- development
sizeMb: 8000
sizeMiB: 2048
- identifier: odoohome
stages:
- development
sizeMb: 8000
sizeMiB: 2048
- identifier: odooaddons
stages:
- development
sizeMb: 8000
sizeMiB: 2048
- identifier: postgres
stages:
- production
- staging
- development
sizeMb: 10000
sizeMiB: 4096

status:
url: http://odoo:3000/status
4 changes: 4 additions & 0 deletions initialProject/.github/workflows/DiploiBuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
with:
images: ${{ secrets.DIPLOI_REGISTRY_HOSTNAME }}/${{ env.IMAGE_NAME }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -37,6 +40,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/arm64
pull: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
14 changes: 10 additions & 4 deletions runonce-odoo.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#!/bin/sh

progress() {
current_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
local action="$1"
echo "🟩 $current_date $action"
}

# Perform tasks ths should run as odoo user at pod startup
echo "Runonce odoo started";
progress "Runonce started";

cd /mnt/extra-addons;

# Seems that this is first run in devel instance
# Intialize persistant storage
if [ ! "$(ls -A /mnt/extra-addons)" ]; then

echo "Initializing git repository"
progress "Pulling code";

git init;
git config credential.helper '!diploi-credential-helper';
Expand Down Expand Up @@ -40,9 +46,9 @@ EOL
fi

# Wait for database and initialize odoo and set admin password on first run
echo "Initializing odoo";
progress "Initializing Odoo";
python3 /odoo-init.py;

echo "Runonce odoo done";
progress "Runonce done";

exit 0;
23 changes: 0 additions & 23 deletions templates/disabled-stateful-set.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions templates/odoo-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ metadata:
name: ingress
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/router.middlewares: diploi-redirect-https@kubernetescrd
cert-manager.io/cluster-issuer: 'letsencrypt-prod'
spec:
tls:
- hosts:
Expand Down
2 changes: 1 addition & 1 deletion templates/odoo-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ spec:
- port: 3000
name: status
selector:
app: {{ ternary "odoo" "disabled" .Values.enabled }}
app: odoo

0 comments on commit d2b2106

Please sign in to comment.