Compare commits

..

5 commits

Author SHA1 Message Date
862216082b Update build pipeline
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2023-07-10 17:29:26 +02:00
7fdb4d9c88 Add new build pipeline 2023-07-10 17:17:18 +02:00
e6ba387dc1 Update build and prod compose 2023-07-10 17:15:00 +02:00
1d3d8f5a35 Add origin to env example 2023-07-10 17:14:36 +02:00
aa17227c5e Update package json 2023-07-10 17:14:29 +02:00
5 changed files with 37 additions and 23 deletions

View file

@ -1 +1,2 @@
TAG=0.0.1 TAG=0.0.1
ORIGIN=https://pianello.webdeploy.it

View file

@ -1,18 +1,27 @@
pipeline: pipeline:
build: build_and_deploy:
image: alpine:3.14 image: alpine:3.14
secrets: [docker_password, docker_username] secrets: [docker_password, docker_username]
commands: commands:
# Install deps - apk add --no-cache openssh docker docker-compose jq
- apk add docker docker-compose jq ################### Provisioning
# Log into docker registry - echo "$${DOCKER_PASSWORD}" | docker login --password-stdin --username "$${DOCKER_USERNAME}" git.webdeploy.it
- echo "$${DOCKER_PASSWORD}" | docker login --password-stdin --username "$${DOCKER_USERNAME}" git.webdeploy.it
- echo "TAG=$(jq -r .version ./package.json)" >> .env - echo "TAG=$(jq -r .version ./package.json)" >> .env
# Build image - echo "ORIGIN=https://pianello.webdeploy.it" >> .env
- docker-compose -f docker-compose.build.yml build - docker-compose -f docker-compose.build.yml build
- docker push git.webdeploy.it/pianello/pianello-web-app:latest - docker push git.webdeploy.it/pianello/frontend:latest
- docker push git.webdeploy.it/pianello/pianello-web-app:$(jq -r .version ./package.json) - docker push git.webdeploy.it/pianello/frontend:$(jq -r .version ./package.json)
# DEPLOY STUFF
# - eval $(ssh-agent -s)
# - mkdir -p ~/.ssh
# - printf "%s" "$${RUNNER_PRIVATE_KEY}" > ~/.ssh/id_ed25519
# - chmod 600 ~/.ssh/id_ed25519
# - ssh-add ~/.ssh/id_ed25519
# - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
# - cat .env | ssh theater@prev.theater.webdeploy.it -p 11122 "cat - > .env" # copy env
# - cat docker-compose.prod.yml | ssh theater@prev.theater.webdeploy.it -p 11122 "cat - > docker-compose.yml && docker compose pull && docker compose stop && docker compose up -d --remove-orphans" # start docker compose
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
branches: main branches: main

View file

@ -1,13 +1,14 @@
version: '3' version: '3'
services: services:
pianello-web-app: frontend:
image: git.webdeploy.it/pianello/pianello-web-app image: git.webdeploy.it/pianello/frontend
restart: always restart: always
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
version_tag: version_tag:
extends: pianello-web-app extends: frontend
image: git.webdeploy.it/pianello/pianello-web-app:${TAG} image: git.webdeploy.it/pianello/frontend:${TAG}

View file

@ -1,9 +1,12 @@
version: '3' version: '3.7'
services: services:
web-app: frontend:
image: git.webdeploy.it/pianello/pianello-web-app:latest image: git.webdeploy.it/pianello/frontend:latest
restart: always restart: always
container_name: pianello-web-app environment:
ORIGIN: "${ORIGIN}"
PORT: 8000
BODY_SIZE_LIMIT: 0
ports: ports:
- 127.0.0.1:8080:80 - 127.0.0.1:8000:8000

View file

@ -1,11 +1,11 @@
{ {
"name": "pianello-web-app", "name": "frontend",
"private": true, "private": true,
"version": "0.0.1", "version": "0.5.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --host 0.0.0.0", "dev": "vite --host 0.0.0.0",
"build": "vite build && ./build-sw.js" "build": "vite build"
}, },
"devDependencies": { "devDependencies": {
"vite": "^4.4.2", "vite": "^4.4.2",