mirror of
				https://github.com/casjaysdevdocker/enclosed
				synced 2025-11-04 01:02:42 -05:00 
			
		
		
		
	🗃️ Committing everything that changed 🗃️
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				release-tag / release-image (push) Has been cancelled
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	release-tag / release-image (push) Has been cancelled
				
			Jenkinsfile rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/functions/
This commit is contained in:
		
							
								
								
									
										71
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,71 @@
 | 
				
			|||||||
 | 
					pipeline {
 | 
				
			||||||
 | 
					    agent {
 | 
				
			||||||
 | 
					        label 'arm64 || amd64'
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    options {
 | 
				
			||||||
 | 
					        buildDiscarder(logRotator(numToKeepStr: '10'))
 | 
				
			||||||
 | 
					        timeout(time: 60, unit: 'MINUTES')
 | 
				
			||||||
 | 
					        timestamps()
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    environment {
 | 
				
			||||||
 | 
					        DOCKER_REGISTRY = 'docker.io'
 | 
				
			||||||
 | 
					        IMAGE_NAME = 'casjaysdevdocker/enclosed'
 | 
				
			||||||
 | 
					        DOCKER_BUILDKIT = '1'
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    stages {
 | 
				
			||||||
 | 
					        stage('Checkout') {
 | 
				
			||||||
 | 
					            steps {
 | 
				
			||||||
 | 
					                checkout scm
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        stage('Build Multi-Arch Image') {
 | 
				
			||||||
 | 
					            steps {
 | 
				
			||||||
 | 
					                script {
 | 
				
			||||||
 | 
					                    def buildArgs = ""
 | 
				
			||||||
 | 
					                    if (fileExists('.env.scripts')) {
 | 
				
			||||||
 | 
					                        buildArgs = "--build-arg-file .env.scripts"
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    
 | 
				
			||||||
 | 
					                    sh """
 | 
				
			||||||
 | 
					                        docker buildx create --use --name mybuilder || true
 | 
				
			||||||
 | 
					                        docker buildx build \\
 | 
				
			||||||
 | 
					                            --platform linux/amd64,linux/arm64 \\
 | 
				
			||||||
 | 
					                            --tag ${DOCKER_REGISTRY}/${IMAGE_NAME}:latest \\
 | 
				
			||||||
 | 
					                            --tag ${DOCKER_REGISTRY}/${IMAGE_NAME}:\${BUILD_NUMBER} \\
 | 
				
			||||||
 | 
					                            ${buildArgs} \\
 | 
				
			||||||
 | 
					                            --push .
 | 
				
			||||||
 | 
					                    """
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        stage('Test') {
 | 
				
			||||||
 | 
					            steps {
 | 
				
			||||||
 | 
					                script {
 | 
				
			||||||
 | 
					                    sh """
 | 
				
			||||||
 | 
					                        docker run --rm --platform linux/\$(uname -m) \\
 | 
				
			||||||
 | 
					                            ${DOCKER_REGISTRY}/${IMAGE_NAME}:latest \\
 | 
				
			||||||
 | 
					                            /bin/sh -c 'echo "Container test passed"'
 | 
				
			||||||
 | 
					                    """
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    post {
 | 
				
			||||||
 | 
					        always {
 | 
				
			||||||
 | 
					            sh 'docker buildx rm mybuilder || true'
 | 
				
			||||||
 | 
					            cleanWs()
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        success {
 | 
				
			||||||
 | 
					            echo 'Build completed successfully!'
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        failure {
 | 
				
			||||||
 | 
					            echo 'Build failed!'
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -93,7 +93,7 @@ SERVER_PORTS="" # specifiy other ports
 | 
				
			|||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
					# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
				
			||||||
# Healthcheck variables
 | 
					# Healthcheck variables
 | 
				
			||||||
HEALTH_ENABLED="yes" # enable healthcheck [yes/no]
 | 
					HEALTH_ENABLED="yes" # enable healthcheck [yes/no]
 | 
				
			||||||
SERVICES_LIST="tini" # comma seperated list of processes for the healthcheck
 | 
					SERVICES_LIST="tini,enclosed,nginx"
 | 
				
			||||||
HEALTH_ENDPOINTS=""  # url endpoints: [http://localhost/health,http://localhost/test]
 | 
					HEALTH_ENDPOINTS=""  # url endpoints: [http://localhost/health,http://localhost/test]
 | 
				
			||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
					# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
				
			||||||
# Update path var
 | 
					# Update path var
 | 
				
			||||||
@@ -354,8 +354,14 @@ if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then
 | 
				
			|||||||
  __setup_mta
 | 
					  __setup_mta
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
					# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
				
			||||||
# if no pid assume container restart
 | 
					# if no pid assume container restart - clean stale files on restart
 | 
				
			||||||
[ -f "$ENTRYPOINT_PID_FILE" ] && [ -f "/run/__start_init_scripts.pid" ] || START_SERVICES="yes"
 | 
					if [ ! -f "$ENTRYPOINT_PID_FILE" ]; then 
 | 
				
			||||||
 | 
					  START_SERVICES="yes"
 | 
				
			||||||
 | 
					  # Clean stale pid files from previous container runs
 | 
				
			||||||
 | 
					  rm -f /run/__start_init_scripts.pid /run/init.d/*.pid /run/*.pid
 | 
				
			||||||
 | 
					elif [ ! -f "/run/__start_init_scripts.pid" ]; then
 | 
				
			||||||
 | 
					  START_SERVICES="yes" 
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
					# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
				
			||||||
[ "$ENTRYPOINT_MESSAGE" = "yes" ] && __printf_space "40" "Container ip address is:" "$CONTAINER_IP4_ADDRESS"
 | 
					[ "$ENTRYPOINT_MESSAGE" = "yes" ] && __printf_space "40" "Container ip address is:" "$CONTAINER_IP4_ADDRESS"
 | 
				
			||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
					# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1173
									
								
								rootfs/usr/local/etc/docker/functions/entrypoint.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1173
									
								
								rootfs/usr/local/etc/docker/functions/entrypoint.sh
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user