diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 2d0cbcce1d..53f551151a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -43,6 +43,11 @@ jobs: cache: maven - name: build (8) run: mvn -T 8 clean install --no-transfer-progress -B -V + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: target-8 + path: target/* build-11: runs-on: ubuntu-latest @@ -55,4 +60,80 @@ jobs: distribution: 'temurin' cache: maven - name: build (11) - run: mvn -T 8 clean install -P ranger-jdk11,!all,!linux --no-transfer-progress -B -V + run: mvn -T 8 clean install -pl '!knox-agent' --no-transfer-progress -B -V + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: target-11 + path: target/* + + docker-build: + needs: + - build-8 + - build-11 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download build-8 artifacts + uses: actions/download-artifact@v4 + with: + name: target-8 + - name: Copy artifacts for docker build + run: | + cp ranger-*.tar.gz dev-support/ranger-docker/dist + cp version dev-support/ranger-docker/dist + - name: Build all ranger-service images + run: | + cd dev-support/ranger-docker + chmod +x download-archives.sh && ./download-archives.sh + docker-compose -f docker-compose.ranger-base.yml build + export DOCKER_BUILDKIT=1 + export COMPOSE_DOCKER_CLI_BUILD=1 + export RANGER_DB_TYPE=postgres + docker-compose \ + -f docker-compose.ranger-${RANGER_DB_TYPE}.yml \ + -f docker-compose.ranger.yml \ + -f docker-compose.ranger-usersync.yml \ + -f docker-compose.ranger-tagsync.yml \ + -f docker-compose.ranger-kms.yml \ + -f docker-compose.ranger-hadoop.yml \ + -f docker-compose.ranger-hbase.yml \ + -f docker-compose.ranger-kafka.yml \ + -f docker-compose.ranger-hive.yml \ + -f docker-compose.ranger-knox.yml build + - name: Bring up containers + run: | + cd dev-support/ranger-docker + export RANGER_DB_TYPE=postgres + docker-compose \ + -f docker-compose.ranger-${RANGER_DB_TYPE}.yml \ + -f docker-compose.ranger.yml \ + -f docker-compose.ranger-usersync.yml \ + -f docker-compose.ranger-tagsync.yml \ + -f docker-compose.ranger-kms.yml \ + -f docker-compose.ranger-hadoop.yml \ + -f docker-compose.ranger-hbase.yml \ + -f docker-compose.ranger-kafka.yml \ + -f docker-compose.ranger-hive.yml \ + -f docker-compose.ranger-knox.yml up -d + - name: Check status of containers and remove them + run: | + sleep 60 + containers=(ranger ranger-zk ranger-solr ranger-postgres ranger-usersync ranger-tagsync ranger-kms ranger-hadoop ranger-hbase ranger-kafka ranger-hive ranger-knox); + flag=true; + for container in "${containers[@]}"; do + if [[ $(docker inspect -f '{{.State.Running}}' $container 2>/dev/null) == "true" ]]; then + echo "Container $container is running!"; + else + flag=false; + echo "Container $container is NOT running!"; + fi + done + + if [[ $flag == true ]]; then + echo "All required containers are up and running"; + docker stop $(docker ps -q) && docker rm $(docker ps -aq); + else + docker stop $(docker ps -q) && docker rm $(docker ps -aq); + exit 1; + fi