diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a38cf0..7d7ada7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test scripts and Docker image build +name: Test scripts and build Docker images on: push: @@ -20,20 +20,8 @@ jobs: - name: Set TERM environment variable run: echo "TERM=xterm" >> $GITHUB_ENV - - name: Test submodule patches script - run: ./scripts/setup-submodule-patches.sh - - - name: Test environment setup script - run: ./scripts/setup-environment.sh 1.1.1.1 2.2.2.2 3.3.3.3 - - - name: Upload environment files - uses: actions/upload-artifact@v4 - with: - name: environment - path: ./environment/ - - - name: Validate Docker Compose file - run: docker compose config + - name: Run the setup script + run: ./setup.sh - name: Build Docker images uses: docker/bake-action@v4 diff --git a/setup.sh b/setup.sh index b335fd1..e741c53 100755 --- a/setup.sh +++ b/setup.sh @@ -57,6 +57,15 @@ check_prerequisites() { } +ci_setup() { + warning "It looks like the script is running in CI. Only setup tasks required for building the Docker images will be performed." + stage "Setting up submodules and applying patches." + ./scripts/setup-submodule-patches.sh + stage "Setting up environment variables." + ./scripts/setup-environment.sh "1.1.1.1" "2.2.2.2" "3.3.3.3" + success "CI setup completed." +} + setup_environment_variables() { echo "Enter the IP address of your Pretendo Network server. It must be accessible to your console." read -r server_ip @@ -92,6 +101,12 @@ cd "$git_base" title "Unofficial Pretendo Network setup script" header "Pretendo setup script started at $(date)." + +if [ -n "${CI+x}" ]; then + ci_setup + exit 0 +fi + stage "Checking prerequisites." check_prerequisites