diff --git a/.gitea/workflows/deploy_prod.yaml b/.gitea/workflows/deploy_prod.yaml new file mode 100644 index 00000000..9c22f329 --- /dev/null +++ b/.gitea/workflows/deploy_prod.yaml @@ -0,0 +1,48 @@ +name: Deploy dev on push +run-name: Deploy dev on push +on: + push: + branches: + - master + +jobs: + on-push-deploy_sh-edraft: + runs-on: [ dobby.sh-edraft.de, ubuntu-latest ] + container: catthehacker/ubuntu:act-latest + steps: + - name: Setup Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10.12" + - run: python -v + + - name: Setup docker + uses: https://github.com/papodaca/install-docker-action@main + - run: docker -v + + - name: Clone Repository + uses: https://github.com/actions/checkout@v3 + + - name: Install cpl cli + run: | + pip install --extra-index-url https://pip.sh-edraft.de cpl-cli + + - name: Install deps + run: cpl i + + - name: Build docker + run: | + docker stack rm service_observer + docker image prune -f + cpl docker-build + + - name: Deploy Stack to sh-edraft.de + uses: https://github.com/kgierke/portainer-stack-deployment@v1 + with: + portainer-url: "https://docker.sh-edraft.de" + portainer-username: "gitea_job" + portainer-password: "$T8bS5;ge_(qVE&}7T" + MYSQL_DATABASE: "kd_kdb" + ports: + - "3307:3306" + volumes: + - kdb_db_prod_1:/var/lib/mysql + deploy: + mode: replicated + replicas: 1 + placement: + constraints: [ node.role == manager ] + resources: + reservations: + cpus: "0.1" + memory: 150M + +networks: + reverse_proxy: + external: true + kdb_prod: + driver: overlay + attachable: true \ No newline at end of file diff --git a/kdb-bot/cpl-workspace.json b/kdb-bot/cpl-workspace.json index 229bc577..29d7ef29 100644 --- a/kdb-bot/cpl-workspace.json +++ b/kdb-bot/cpl-workspace.json @@ -35,7 +35,7 @@ "stage": "export KDB_ENVIRONMENT=staging; export KDB_NAME=KDB-Stage; cpl start;", "pre-dev": "cpl build", "dev": "export KDB_ENVIRONMENT=development; export KDB_NAME=KDB-Dev; cpl start;", - "docker-build": "cpl build $ARGS; docker build -t kdb-bot/kdb-bot:$(cpl gv) .;", + "docker-build": "cpl build $ARGS; docker build -t sh-edraft.de/kdb-bot:$(cpl gv) .;", "dc-up": "docker-compose up -d", "dc-down": "docker-compose down", "docker": "cpl dc-down; cpl docker-build; cpl dc-up;" diff --git a/kdb-web/package.json b/kdb-web/package.json index 59943f80..c640dd53 100644 --- a/kdb-web/package.json +++ b/kdb-web/package.json @@ -11,9 +11,9 @@ "watch": "ng build --watch --configuration development", "test": "ng test", "predocker-build": "npm run update-version", - "docker-build": "export VERSION=$npm_package_version; ng build; docker build -t kdb-web/kdb-web:$VERSION .", - "docker-build-dev": "export VERSION=$npm_package_version; ng build --configuration development; docker build -t kdb-web/kdb-web:$VERSION .", - "docker-build-stage": "export VERSION=$npm_package_version; ng build --configuration staging; docker build -t kdb-web/kdb-web:$VERSION ." + "docker-build": "export VERSION=$npm_package_version; ng build; docker build -t sh-edraft.de/kdb-web:$VERSION .", + "docker-build-dev": "export VERSION=$npm_package_version; ng build --configuration development; docker build -t sh-edraft.de/kdb-web:$VERSION .", + "docker-build-stage": "export VERSION=$npm_package_version; ng build --configuration staging; docker build -t sh-edraft.de/kdb-web:$VERSION ." }, "private": true, "dependencies": { @@ -51,4 +51,4 @@ "tslib": "^2.4.1", "typescript": "~4.9.5" } -} \ No newline at end of file +}