[camel-k] branch master updated (3a45fe1 -> 8201aac)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel-k] branch master updated (3a45fe1 -> 8201aac)

nferraro
This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git.


    from 3a45fe1  Merge pull request #1278 from lburgazzoli/github-1037
     new 809354b  chore(ci): test openshift on GH actions
     new ce88230  chore(ci): test openshift on GH actions - fix url
     new e875192  chore(ci): test openshift on GH actions - fix docker tag
     new 8201aac  chore(ci): test openshift on GH actions - enable secrets

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/openshift.yml | 143 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 143 insertions(+)
 create mode 100644 .github/workflows/openshift.yml

Reply | Threaded
Open this post in threaded view
|

[camel-k] 01/04: chore(ci): test openshift on GH actions

nferraro
This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 809354b5d76eaed915ed071a44c0a49c17b8a578
Author: Nicola Ferraro <[hidden email]>
AuthorDate: Sat Feb 15 09:59:27 2020 +0100

    chore(ci): test openshift on GH actions
---
 .github/workflows/openshift.yml | 143 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 143 insertions(+)

diff --git a/.github/workflows/openshift.yml b/.github/workflows/openshift.yml
new file mode 100644
index 0000000..2b6b9b6
--- /dev/null
+++ b/.github/workflows/openshift.yml
@@ -0,0 +1,143 @@
+# ---------------------------------------------------------------------------
+# 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: openshift
+
+on:
+  pull_request:
+    branches:
+      - master
+  push:
+    branches:
+      - master
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout code
+      uses: actions/checkout@v1
+    - name: Info
+      run: |
+        ls -lart
+    - name: Set Up Java
+      uses: actions/setup-java@v1
+      with:
+        java-version: 1.8
+    - name: Set Go
+      uses: actions/setup-go@v1
+      with:
+        go-version: 1.13.x
+    - name: Get OpenShift Client (oc)
+      run: |
+        export OPENSHIFT_VERSION=v3.11.0
+        export OPENSHIFT_COMMIT=0cbc58b
+        export MAVEN_OPTS=-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
+
+        # set docker0 to promiscuous mode
+        sudo ip link set docker0 promisc on
+
+        # Download and install the oc binary
+        sudo mount --make-shared /
+
+        sudo apt-get install resolvconf
+        echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/head > /dev/null
+        echo "nameserver 8.8.4.4" | sudo tee /etc/resolvconf/resolv.conf.d/head > /dev/null
+        sudo service resolvconf restart
+
+        sudo service docker stop
+        sudo echo '{"insecure-registries": ["172.30.0.0/16"]}' | sudo tee /etc/docker/daemon.json > /dev/null
+        sudo service docker start
+
+        DOWNLOAD_URL=https://github.com/openshift/origin/releases/download/v$OPENSHIFT_VERSION/openshift-origin-client-tools-v$OPENSHIFT_VERSION-$OPENSHIFT_COMMIT-linux-64bit.tar.gz
+        wget -O client.tar.gz ${DOWNLOAD_URL}
+        tar xvzOf client.tar.gz > oc.bin
+        sudo mv oc.bin /usr/local/bin/oc
+        sudo chmod 755 /usr/local/bin/oc
+
+    - name: Start OpenShift Cluster
+      run: |
+        # Figure out this host's IP address
+        IP_ADDR="$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)"
+
+        # Setup cluster dir
+        sudo mkdir -p /home/runner/lib/oc
+        sudo chmod 777 /home/runner/lib/oc
+        cd /home/runner/lib/oc
+
+        # Start OpenShift
+        oc cluster up --public-hostname=$IP_ADDR
+        oc login -u system:admin
+
+        # Wait until we have a ready node in openshift
+        TIMEOUT=0
+        TIMEOUT_COUNT=60
+        until [ $TIMEOUT -eq $TIMEOUT_COUNT ]; do
+          if [ -n "$(oc get nodes | grep Ready)" ]; then
+            break
+          fi
+          echo "openshift is not up yet"
+          TIMEOUT=$((TIMEOUT+1))
+          sleep 5
+        done
+
+        if [ $TIMEOUT -eq $TIMEOUT_COUNT ]; then
+          echo "Failed to start openshift"
+          exit 1
+        fi
+
+        echo "openshift is deployed and reachable"
+
+    - name: Info
+      run: |
+        oc describe nodes
+    - name: Run IT
+      # Disable registry tests as not compatible with KinD
+      #env:
+      #  TEST_DOCKER_HUB_USERNAME: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
+      #  TEST_DOCKER_HUB_PASSWORD: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
+      #  TEST_GITHUB_PACKAGES_REPO: ${{ secrets.TEST_GITHUB_PACKAGES_REPO }}
+      #  TEST_GITHUB_PACKAGES_USERNAME: ${{ secrets.TEST_GITHUB_PACKAGES_USERNAME }}
+      #  TEST_GITHUB_PACKAGES_PASSWORD: ${{ secrets.TEST_GITHUB_PACKAGES_PASSWORD }}
+      run: |
+        # Compute registry parameters
+        echo "Build project"
+        make build-kamel
+
+        echo "Adding maven artifacts to the image context"
+        make PACKAGE_ARTIFACTS_STRATEGY=download package-artifacts
+
+        echo "Copying binary file to docker dir"
+        mkdir -p ./build/_output/bin
+        cp ./kamel ./build/_output/bin/
+
+        echo "Building the images"
+        docker build -t "${LOCAL_IMAGE}" -f build/Dockerfile .
+
+        # Make the Apache Snapshots repository enabled by efault
+        export KAMEL_INSTALL_MAVEN_REPOSITORIES=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots
+
+        echo "installing camel k cluster resources"
+        ./kamel install --cluster-setup
+
+        # Login as normal user
+        oc login -u developer
+
+        # Then run integration tests
+        make test-integration

Reply | Threaded
Open this post in threaded view
|

[camel-k] 02/04: chore(ci): test openshift on GH actions - fix url

nferraro
In reply to this post by nferraro
This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit ce88230e0ff2de2bfbc95a314e45dc4784f227bc
Author: Nicola Ferraro <[hidden email]>
AuthorDate: Sat Feb 15 10:03:34 2020 +0100

    chore(ci): test openshift on GH actions - fix url
---
 .github/workflows/openshift.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/openshift.yml b/.github/workflows/openshift.yml
index 2b6b9b6..d570cc2 100644
--- a/.github/workflows/openshift.yml
+++ b/.github/workflows/openshift.yml
@@ -65,7 +65,7 @@ jobs:
         sudo echo '{"insecure-registries": ["172.30.0.0/16"]}' | sudo tee /etc/docker/daemon.json > /dev/null
         sudo service docker start
 
-        DOWNLOAD_URL=https://github.com/openshift/origin/releases/download/v$OPENSHIFT_VERSION/openshift-origin-client-tools-v$OPENSHIFT_VERSION-$OPENSHIFT_COMMIT-linux-64bit.tar.gz
+        DOWNLOAD_URL=https://github.com/openshift/origin/releases/download/$OPENSHIFT_VERSION/openshift-origin-client-tools-$OPENSHIFT_VERSION-$OPENSHIFT_COMMIT-linux-64bit.tar.gz
         wget -O client.tar.gz ${DOWNLOAD_URL}
         tar xvzOf client.tar.gz > oc.bin
         sudo mv oc.bin /usr/local/bin/oc

Reply | Threaded
Open this post in threaded view
|

[camel-k] 03/04: chore(ci): test openshift on GH actions - fix docker tag

nferraro
In reply to this post by nferraro
This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit e875192e23d1c2a11978420f117f56f544b97beb
Author: Nicola Ferraro <[hidden email]>
AuthorDate: Sat Feb 15 10:15:14 2020 +0100

    chore(ci): test openshift on GH actions - fix docker tag
---
 .github/workflows/openshift.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/openshift.yml b/.github/workflows/openshift.yml
index d570cc2..b358a34 100644
--- a/.github/workflows/openshift.yml
+++ b/.github/workflows/openshift.yml
@@ -128,7 +128,8 @@ jobs:
         cp ./kamel ./build/_output/bin/
 
         echo "Building the images"
-        docker build -t "${LOCAL_IMAGE}" -f build/Dockerfile .
+        export IMAGE=docker.io/apache/camel-k:$(make version)
+        docker build -t "${IMAGE}" -f build/Dockerfile .
 
         # Make the Apache Snapshots repository enabled by efault
         export KAMEL_INSTALL_MAVEN_REPOSITORIES=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots

Reply | Threaded
Open this post in threaded view
|

[camel-k] 04/04: chore(ci): test openshift on GH actions - enable secrets

nferraro
In reply to this post by nferraro
This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 8201aac4273941aaf77f3ab581fbf7213fe49fec
Author: Nicola Ferraro <[hidden email]>
AuthorDate: Sun Feb 16 09:34:48 2020 +0100

    chore(ci): test openshift on GH actions - enable secrets
---
 .github/workflows/openshift.yml | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/openshift.yml b/.github/workflows/openshift.yml
index b358a34..1f44ed7 100644
--- a/.github/workflows/openshift.yml
+++ b/.github/workflows/openshift.yml
@@ -108,13 +108,12 @@ jobs:
       run: |
         oc describe nodes
     - name: Run IT
-      # Disable registry tests as not compatible with KinD
-      #env:
-      #  TEST_DOCKER_HUB_USERNAME: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
-      #  TEST_DOCKER_HUB_PASSWORD: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
-      #  TEST_GITHUB_PACKAGES_REPO: ${{ secrets.TEST_GITHUB_PACKAGES_REPO }}
-      #  TEST_GITHUB_PACKAGES_USERNAME: ${{ secrets.TEST_GITHUB_PACKAGES_USERNAME }}
-      #  TEST_GITHUB_PACKAGES_PASSWORD: ${{ secrets.TEST_GITHUB_PACKAGES_PASSWORD }}
+      env:
+        TEST_DOCKER_HUB_USERNAME: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
+        TEST_DOCKER_HUB_PASSWORD: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
+        TEST_GITHUB_PACKAGES_REPO: ${{ secrets.TEST_GITHUB_PACKAGES_REPO }}
+        TEST_GITHUB_PACKAGES_USERNAME: ${{ secrets.TEST_GITHUB_PACKAGES_USERNAME }}
+        TEST_GITHUB_PACKAGES_PASSWORD: ${{ secrets.TEST_GITHUB_PACKAGES_PASSWORD }}
       run: |
         # Compute registry parameters
         echo "Build project"