Skip to content

Commit

Permalink
chore(ci): Use Minio Maven repository
Browse files Browse the repository at this point in the history
- Remove unstable Jitpack dependency resolving in favor of using Mino S3 based Maven repository
  • Loading branch information
christophd committed May 6, 2024
1 parent f11d27c commit 89fd920
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 46 deletions.
51 changes: 22 additions & 29 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

name: E2E Tests

on:
Expand Down Expand Up @@ -64,6 +47,10 @@ jobs:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Build Kamelet libraries
run: |
mvn clean install -DskipTests -DskipITs
mvn deploy -DskipTests -DskipITs -DaltDeploymentRepository=snapshot-repo::default::file:target/maven_repo
- name: Kind Cluster
uses: container-tools/kind-action@v2.0.4
with:
Expand All @@ -75,28 +62,34 @@ jobs:
kubectl version
kubectl cluster-info
kubectl describe nodes
- name: Create Minio Storage as Maven Repository
run: |
# Create Minio as Maven repository
docker run -d -p 9000:9000 -p 9001:9001 --name minio quay.io/minio/minio server /data --console-address ":9001"
- name: Upload Kamelet catalog library to Minio
run: |
curl https://dl.min.io/client/mc/release/linux-amd64/mc --create-dirs -o /home/runner/.minio/mc
chmod +x /home/runner/.minio/mc
/home/runner/.minio/mc alias set minio-dev http://127.0.0.1:9000 minioadmin minioadmin
/home/runner/.minio/mc mb minio-dev/camel-k
/home/runner/.minio/mc mirror --overwrite target/maven_repo minio-dev/camel-k/
- name: Create DockerHost service
run: |
# Create Maven settings for the Camel K operator
kubectl create cm minio-maven-repository --from-file .github/workflows/infra/settings.xml
# Create headless service that allows pods running in Kind to access the Minio Docker service
kubectl apply -f .github/workflows/infra/dockerhost-service.yaml
- name: Camel K Tools
uses: container-tools/camel-k-action@v1.0.3
with:
version: v2.3.0
- name: Set JitPack dependency coordinates
env:
HEAD_REF: ${{ github.head_ref }}
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
run: |
echo "Set JitPack dependency coordinates to ${HEAD_REPO/\//.}:camel-kamelets-utils:${HEAD_REF//\//'~'}-SNAPSHOT"
export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
# Overwrite JitPack coordinates in the local Kamelets so the tests can use the utility classes in this branch or PR
find . -maxdepth 1 -name '*.kamelet.yaml' -exec sed -i "s/mvn:org.apache.camel.kamelets:camel-kamelets-utils:${PROJECT_VERSION}/github:${HEAD_REPO/\//.}:camel-kamelets-utils:${HEAD_REF//\//'~'}-SNAPSHOT/g" {} +
- name: Install Camel K
run: |
# Configure install options
export KAMEL_INSTALL_REGISTRY=$KIND_REGISTRY
export KAMEL_INSTALL_REGISTRY_INSECURE=true
kamel install --global --olm=false --operator-env-vars KAMEL_INSTALL_DEFAULT_KAMELETS=false -w
kamel install --global --olm=false --operator-env-vars KAMEL_INSTALL_DEFAULT_KAMELETS=false --maven-settings=configmap:minio-maven-repository/settings.xml --maven-extension=com.gkatzioura.maven.cloud:s3-storage-wagon:2.3 -w
# Install the local kamelets
find . -maxdepth 1 -name '*.kamelet.yaml' -exec kubectl apply -f {} \;
- name: YAKS tools
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/infra/dockerhost-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: v1
kind: Endpoints
metadata:
name: dockerhost
subsets:
- addresses:
- ip: 172.17.0.1 # this is the gateway IP in the "bridge" docker network
---
apiVersion: v1
kind: Service
metadata:
name: dockerhost
spec:
clusterIP: None # headless service
29 changes: 29 additions & 0 deletions .github/workflows/infra/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>minio-maven-repository</id>
<username>minioadmin</username>
<password>minioadmin</password>
<configuration>
<endpoint>http://dockerhost:9000</endpoint>
<pathStyleEnabled>true</pathStyleEnabled>
</configuration>
</server>
</servers>

<profiles>
<profile>
<id>minio</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>minio-maven-repository</id>
<name>Minio Maven Repository</name>
<url>s3://camel-k</url>
</repository>
</repositories>
</profile>
</profiles>
</settings>
17 changes: 0 additions & 17 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

name: Validate

on:
Expand Down

0 comments on commit 89fd920

Please sign in to comment.