Compare commits
	
		
			15 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| a3c5145677 | |||
| 1f5d342837 | |||
| 123fceb65a | |||
| e0d7ed3745 | |||
| cc73700a83 | |||
| 9d025a3ce2 | |||
| c27889a241 | |||
| 3b26f29387 | |||
| 9b89a4832c | |||
| 41c4ce138d | |||
| ca599002cd | |||
| ea16ec601b | |||
| b673aab830 | |||
| fb912fd9ea | |||
| ba2007c8fe | 
@@ -1,54 +1,32 @@
 | 
			
		||||
# Template
 | 
			
		||||
name: Deployment Verification
 | 
			
		||||
 | 
			
		||||
run-name: ${{ gitea.actor }} is runs ci pipeline
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - develop
 | 
			
		||||
      - main
 | 
			
		||||
    tags: 
 | 
			
		||||
      - "v[0-9]+.[0-9]+.[0-9]"
 | 
			
		||||
  pull_request:
 | 
			
		||||
    branches:
 | 
			
		||||
      - develop
 | 
			
		||||
      - main
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  test:
 | 
			
		||||
  deploy-and-test:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Checkout repository
 | 
			
		||||
    - name: Checkout
 | 
			
		||||
      uses: actions/checkout@v4
 | 
			
		||||
 | 
			
		||||
    # https://github.com/docker/setup-qemu-action#usage
 | 
			
		||||
    - name: Set up QEMU
 | 
			
		||||
      uses: docker/setup-qemu-action@v3.2.0
 | 
			
		||||
 | 
			
		||||
    # https://github.com/marketplace/actions/docker-setup-buildx
 | 
			
		||||
    - name: Set up Docker Buildx
 | 
			
		||||
      uses: docker/setup-buildx-action@v3
 | 
			
		||||
 | 
			
		||||
    - name: Start up services using Docker Compose
 | 
			
		||||
      run: docker compose -f docker-compose.yml up -d
 | 
			
		||||
 | 
			
		||||
    - name: Print Docker Compose services status
 | 
			
		||||
      run: docker ps
 | 
			
		||||
 | 
			
		||||
    - name: Shutdown Docker Compose services
 | 
			
		||||
      if: always()
 | 
			
		||||
      run: docker compose -f docker-compose.yml down
 | 
			
		||||
 | 
			
		||||
    - name: Cleanup
 | 
			
		||||
      if: always()
 | 
			
		||||
      run: |
 | 
			
		||||
        docker compose --profile setup down
 | 
			
		||||
        rm -rf /workspace/tips-of-mine/metabase/*
 | 
			
		||||
 | 
			
		||||
  deploy:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Checkout repository
 | 
			
		||||
      uses: actions/checkout@v4
 | 
			
		||||
 | 
			
		||||
    - name: Set up Docker Buildx
 | 
			
		||||
      uses: docker/setup-buildx-action@v3
 | 
			
		||||
      id: buildx
 | 
			
		||||
      uses: docker/setup-buildx-action@v3.6.1
 | 
			
		||||
 | 
			
		||||
    - name: Create necessary Docker networks
 | 
			
		||||
      run: |
 | 
			
		||||
@@ -60,7 +38,8 @@ jobs:
 | 
			
		||||
 | 
			
		||||
#    - name: Modify /etc/hosts for internal routing
 | 
			
		||||
#      run: |
 | 
			
		||||
#        echo "127.0.0.1     metabase     metabase.tips-of-mine.local" | sudo tee -a /etc/hosts
 | 
			
		||||
#        echo "127.0.0.1 gitea.tips-of-mine.com" | sudo tee -a /etc/hosts
 | 
			
		||||
#        echo "127.0.0.1 dashboard.tips-of-mine.com" | sudo tee -a /etc/hosts
 | 
			
		||||
 | 
			
		||||
    - name: Print Docker Compose services status
 | 
			
		||||
      run: docker ps
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										58
									
								
								.gitea/workflows/ci-main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								.gitea/workflows/ci-main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
			
		||||
# Template
 | 
			
		||||
name: Deployment Verification
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - main
 | 
			
		||||
    tags: 
 | 
			
		||||
      - "v[0-9]+.[0-9]+.[0-9]"s
 | 
			
		||||
  pull_request:
 | 
			
		||||
    branches:
 | 
			
		||||
      - main
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  deploy-and-test:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Checkout
 | 
			
		||||
      uses: actions/checkout@v4
 | 
			
		||||
 | 
			
		||||
    # https://github.com/docker/setup-qemu-action#usage
 | 
			
		||||
    - name: Set up QEMU
 | 
			
		||||
      uses: docker/setup-qemu-action@v3.2.0
 | 
			
		||||
 | 
			
		||||
    # https://github.com/marketplace/actions/docker-setup-buildx
 | 
			
		||||
    - name: Set up Docker Buildx
 | 
			
		||||
      id: buildx
 | 
			
		||||
      uses: docker/setup-buildx-action@v3.6.1
 | 
			
		||||
 | 
			
		||||
    - name: Create necessary Docker networks
 | 
			
		||||
      run: |
 | 
			
		||||
        docker network create back_network_${{ vars.APPLICATION_NAME }} || true
 | 
			
		||||
        docker network create traefik_front_network || true
 | 
			
		||||
 | 
			
		||||
    - name: Start up services using Docker Compose
 | 
			
		||||
      run: docker compose -f docker-compose.yml up -d
 | 
			
		||||
 | 
			
		||||
#    - name: Modify /etc/hosts for internal routing
 | 
			
		||||
#      run: |
 | 
			
		||||
#        echo "127.0.0.1 ${{ vars.APPLICATION_URL }}" | sudo tee -a /etc/hosts
 | 
			
		||||
 | 
			
		||||
    - name: Print Docker Compose services status
 | 
			
		||||
      run: docker ps
 | 
			
		||||
 | 
			
		||||
    - name: Wait for the application to be ready via Traefik
 | 
			
		||||
      run: |
 | 
			
		||||
        echo "Checking the routing and availability of application via Traefik..."
 | 
			
		||||
        timeout 5m bash -c 'while ! curl -fsSLk "https://${{ vars.APPLICATION_URL }}"; do echo "Waiting for the application to be ready..."; sleep 10; done'
 | 
			
		||||
 | 
			
		||||
    - name: Inspect Network Configuration
 | 
			
		||||
      run: |
 | 
			
		||||
        docker network inspect back_network_${{ vars.APPLICATION_NAME }}
 | 
			
		||||
        docker network inspect traefik_front_network
 | 
			
		||||
 | 
			
		||||
    - name: Shutdown Docker Compose services
 | 
			
		||||
      if: always()
 | 
			
		||||
      run: docker compose -f docker-compose.yml down
 | 
			
		||||
@@ -21,7 +21,7 @@ services:
 | 
			
		||||
      MB_DB_PASS: ${POSTGRE_DB_PASSWORD}
 | 
			
		||||
      MB_DB_HOST: postgres
 | 
			
		||||
      MB_PASSWORD_COMPLEXITY: strong
 | 
			
		||||
      MB_PASSWORD_LENGTH: 14
 | 
			
		||||
      MB_PASSWORD_LENGTH: 10
 | 
			
		||||
      JAVA_TIMEZONE: Europe/Paris
 | 
			
		||||
    restart: always
 | 
			
		||||
    networks:
 | 
			
		||||
@@ -38,6 +38,7 @@ services:
 | 
			
		||||
      timeout: 5s
 | 
			
		||||
      retries: 5
 | 
			
		||||
    labels:
 | 
			
		||||
      - "com.centurylinklabs.watchtower.enable=true"
 | 
			
		||||
      - "traefik.enable=true"
 | 
			
		||||
      - "traefik.docker.network=traefik_front_network"
 | 
			
		||||
# HTTP
 | 
			
		||||
@@ -76,3 +77,35 @@ services:
 | 
			
		||||
      timeout: 5s
 | 
			
		||||
      retries: 3
 | 
			
		||||
      start_period: 60s
 | 
			
		||||
    labels:
 | 
			
		||||
      - "com.centurylinklabs.watchtower.enable=true"
 | 
			
		||||
 | 
			
		||||
###
 | 
			
		||||
  msmtpd:
 | 
			
		||||
    container_name: metabase-msmtpd
 | 
			
		||||
    hostname: metabase-msmtpd
 | 
			
		||||
    image: crazymax/msmtpd:latest
 | 
			
		||||
    networks:
 | 
			
		||||
    - back_network_metabase
 | 
			
		||||
    environment:
 | 
			
		||||
      - "TZ=Europe/Paris"
 | 
			
		||||
      - "PUID=1500"
 | 
			
		||||
      - "PGID=1500"
 | 
			
		||||
      - "SMTP_HOST=10.0.4.52"
 | 
			
		||||
      - "SMTP_PORT=587"
 | 
			
		||||
      - "SMTP_TLS=on"
 | 
			
		||||
      - "SMTP_STARTTLS=on"
 | 
			
		||||
      - "SMTP_TLS_CHECKCERT=off"
 | 
			
		||||
      - "SMTP_AUTH=on"
 | 
			
		||||
      - "SMTP_USER=hostinfo@tips-of-mine.fr"
 | 
			
		||||
      - "SMTP_PASSWORD=P@ssword!Here!123456"
 | 
			
		||||
      - "SMTP_DOMAIN=localhost"
 | 
			
		||||
      - "SMTP_FROM=hostinfo@tips-of-mine.fr"
 | 
			
		||||
    restart: always
 | 
			
		||||
    healthcheck:
 | 
			
		||||
      test: ["CMD-SHELL", "echo EHLO localhost"]
 | 
			
		||||
      interval: 5s
 | 
			
		||||
      timeout: 5s
 | 
			
		||||
      retries: 5
 | 
			
		||||
    labels:
 | 
			
		||||
      - "com.centurylinklabs.watchtower.enable=true"
 | 
			
		||||
		Reference in New Issue
	
	Block a user