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

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-task.git

commit 842d981736c446758c1c10e2f56b06e9180cd6d2
Author: Michele Sciabarra <[email protected]>
AuthorDate: Tue Jul 30 16:54:33 2024 +0200

    fresh start
---
 .github/workflows/event-generator.yaml |  89 -------------------
 nuvfile.yml                            |  26 ++++++
 nuvroot.json                           |   6 ++
 prereq.yml                             | 155 +++++++++++++++++++++++++++++++++
 4 files changed, 187 insertions(+), 89 deletions(-)

diff --git a/.github/workflows/event-generator.yaml 
b/.github/workflows/event-generator.yaml
deleted file mode 100644
index c7f7441..0000000
--- a/.github/workflows/event-generator.yaml
+++ /dev/null
@@ -1,89 +0,0 @@
-# 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.
-#
-# It does not use matrix loop on purpose as it will require too many runners
-name: OnOlarisPush
-
-on:
-  workflow_dispatch:
-
-jobs:
-    dispatch:        
-      runs-on: ubuntu-latest
-      steps:        
-      - name: Checkout
-        uses: actions/checkout@v3
-      - name: Get current Date
-        id: date
-        run: echo "date=$(date +%y%m%d%H%M)" >> $GITHUB_OUTPUT          
-      - name: Calculate Tag
-        id: itag
-        run: echo "tag=${{ format('{0}-{1}', github.ref_name, 
steps.date.outputs.date) }}" >> $GITHUB_OUTPUT      
-      - name: Tag        
-        run: git tag ${{ steps.itag.outputs.tag }}
-      - name: Push Tag
-        run: git push origin --tags       
-      - name: Dispatch Kind
-        uses: peter-evans/repository-dispatch@v2
-        with:
-            event-type: olaris-testing-update
-            repository: nuvolaris/nuvolaris-testing
-            token: ${{ secrets.PAT }}
-            client-payload: '{"platform": "kind","tag":"${{ 
steps.itag.outputs.tag }}"}'
-      - name: Dispatch K3s
-        uses: peter-evans/repository-dispatch@v2
-        with:
-            event-type: olaris-testing-update
-            repository: nuvolaris/nuvolaris-testing
-            token: ${{ secrets.PAT }}
-            client-payload: '{"platform": "k3s","tag":"${{ 
steps.itag.outputs.tag }}"}'            
-      - name: Dispatch Mk8s
-        uses: peter-evans/repository-dispatch@v2
-        with:
-            event-type: olaris-testing-update
-            repository: nuvolaris/nuvolaris-testing
-            token: ${{ secrets.PAT }}
-            client-payload: '{"platform": "mk8s","tag":"${{ 
steps.itag.outputs.tag }}"}' 
-      - name: Dispatch EKS
-        uses: peter-evans/repository-dispatch@v2
-        with:
-            event-type: olaris-testing-update
-            repository: nuvolaris/nuvolaris-testing
-            token: ${{ secrets.PAT }}
-            client-payload: '{"platform": "eks","tag":"${{ 
steps.itag.outputs.tag }}"}'  
-      - name: Dispatch AKS
-        uses: peter-evans/repository-dispatch@v2
-        with:
-            event-type: olaris-testing-update
-            repository: nuvolaris/nuvolaris-testing
-            token: ${{ secrets.PAT }}
-            client-payload: '{"platform": "aks","tag":"${{ 
steps.itag.outputs.tag }}"}'  
-      - name: Dispatch GKE
-        uses: peter-evans/repository-dispatch@v2
-        with:
-            event-type: olaris-testing-update
-            repository: nuvolaris/nuvolaris-testing
-            token: ${{ secrets.PAT }}
-            client-payload: '{"platform": "gke","tag":"${{ 
steps.itag.outputs.tag }}"}'
-      - name: Dispatch OSH
-        uses: peter-evans/repository-dispatch@v2
-        with:
-            event-type: olaris-testing-update
-            repository: nuvolaris/nuvolaris-testing
-            token: ${{ secrets.PAT }}
-            client-payload: '{"platform": "osh","tag":"${{ 
steps.itag.outputs.tag }}"}'                                         
-            
\ No newline at end of file
diff --git a/nuvfile.yml b/nuvfile.yml
new file mode 100644
index 0000000..dbe7828
--- /dev/null
+++ b/nuvfile.yml
@@ -0,0 +1,26 @@
+# 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.
+#
+
+version: "3"
+tasks:
+
+  info:
+    desc: info
+    cmds:
+    - 7zz | grep 7-Zip
+
diff --git a/nuvroot.json b/nuvroot.json
new file mode 100644
index 0000000..417f7fe
--- /dev/null
+++ b/nuvroot.json
@@ -0,0 +1,6 @@
+{
+    "version": "0.1.0-testing",
+    "config": {
+        "key": "value"
+    }
+}
\ No newline at end of file
diff --git a/prereq.yml b/prereq.yml
new file mode 100644
index 0000000..f56def5
--- /dev/null
+++ b/prereq.yml
@@ -0,0 +1,155 @@
+version: 3
+
+vars:
+  OS: "{{or .__OS OS}}"
+  ARCH: "{{or .__ARCH ARCH}}"
+  ARC: '{{if eq .OS "windows"}}.zip{{else}}.tgz{{end}}'
+  ARC2: '{{if eq .OS "windows"}}.zip{{else}}.tar.gz{{end}}'
+  EXE: '{{if eq .OS "windows"}}.exe{{else}}{{end}}'
+
+tasks:
+  test:
+   vars:
+     FILE:  file.tar.gz
+   cmds:
+    - echo "{{.FILE}}"
+    - echo '{{trimSuffix ".gz" .FILE }}'
+
+  download-and-extract:
+     requires:
+       vars: 
+       - FILE
+       - URL
+       - OUT
+     vars:
+       FILETAR: '{{trimSuffix ".gz" .FILE}}'
+     cmds:
+     - echo "{{.OUT}} {{.FILE}} {{.URL}} {{.FILETAR}}" 
+     - curl -sL "{{.URL}}" -o {{.FILE}}
+     - |
+       {{if eq .OS "windows"}}
+       7zz e -r -aoa -o. "{{.FILE}}" "{{.OUT}}.exe"
+       rm "{{.FILE}}"
+       {{else}}
+       7zz e "{{.FILE}}" -o.
+       rm "{{.FILE}}"
+       7zz e -r -aoa -o. "{{.FILETAR}}" "{{.OUT}}"
+       rm "{{.FILETAR}}"
+       {{end}}
+
+  download:
+    requires:
+      vars:
+        - URL
+        - OUT
+    cmds:
+      - curl -sL -ccookie.txt -o"{{.OUT}}" "{{.URL}}"
+      - '{{if eq .OS "windows"}}mv {{.OUT}} {{.OUT}}.exe{{else}}chmod +x 
{{.OUT}}{{end}}'
+      - rm cookie.txt
+
+  7zz:
+    desc: 7zr
+    vars:
+      VERSION: "2407"
+      SUFFIX:
+         sh: |
+             case "{{.OS}}-{{.ARCH}}" in
+              linux-amd64) echo "7z{{.VERSION}}-linux-x64.tar.xz" ;;
+              linux-arm64) echo "7z{{.VERSION}}-linux-arm64.tar.xz" ;;
+              darwin-*) echo "7z{{.VERSION}}-mac.tar.xz" ;;
+              windows-*) echo "7zr.exe" ;;
+              *) echo "unknown" ;;
+             esac
+      URL: "https://7-zip.org/a/{{.SUFFIX}}";
+      FILE: "{{base .URL}}"
+    cmds:
+    - curl -sL "{{.URL}}"  -o "{{.FILE}}"
+    - |
+      if test "{{.OS}}" == "windows" 
+      then mv 7zr.exe 7zz.exe
+      else tar xJvf "{{.FILE}}" 7zz
+           rm "{{.FILE}}"
+      fi
+ 
+  coreutils:
+    desc: coreutils
+    vars:
+      VERSION: "0.0.27"
+      SUFFIX:
+        sh: |
+            case "{{.OS}}-{{.ARCH}}" in
+            linux-amd64) echo "x86_64-unknown-linux-gnu" ;;
+            linux-arm64) echo "aarch64-unknown-linux-gnu" ;;
+            darwin-amd64) echo "x86_64-apple-darwin" ;;
+            darwin-arm64) echo "aarch64-apple-darwin" ;; 
+            windows-*) echo "x86_64-pc-windows-gnu" ;;
+            *) echo "unknown" ;;
+            esac
+      URL: 
"https://github.com/uutils/coreutils/releases/download/{{.VERSION}}/coreutils-{{.VERSION}}-{{.SUFFIX}}{{.ARC2}}";
 
+      FILE: "{{base .URL}}"
+      OUT: coreutils
+    cmds:
+    - task: download-and-extract
+      vars:
+        URL: "{{.URL}}"
+        FILE: "{{.FILE}}"
+        OUT: coreutils
+
+  bun:
+    description: bun
+    vars:
+      VERSION: "v1.1.21"
+      ARCH2: '{{if eq .ARCH "amd64"}}x64{{else}}aarch64{{end}}'
+      URL: 
'https://github.com/oven-sh/bun/releases/download/bun-{{.VERSION}}/bun-{{.OS}}-{{.ARCH2}}.zip'
+      FILE: '{{base .URL}}'
+    cmds:
+    - echo "{{.URL}}"
+    - curl -sL "{{.URL}}" -o "{{.FILE}}"
+    - 7zz e -r -aoa -o. {{.FILE}} bun{{.EXE}}
+    - rm "{{.FILE}}"
+
+  kubectl:
+    vars:
+      VERSION: v1.30.3
+    cmds:
+      - task: download
+        vars:
+          URL: 
"https://dl.k8s.io/release/{{.VERSION}}/bin/{{.OS}}/{{.ARCH}}/kubectl{{.EXE}}";
+          OUT: kubectl
+
+  kind:
+    vars:
+      VERSION: v0.17.0
+    cmds:
+      - task: download
+        vars:
+          URL: 
"https://kind.sigs.k8s.io/dl/{{.VERSION}}/kind-{{.OS}}-{{.ARCH}}";
+          OUT: kind
+
+  k3sup:
+    vars:
+      VERSION: 0.13.6
+      BASE: "https://github.com/alexellis/k3sup/releases/download/{{.VERSION}}";
+      FILE: 
+        sh: |
+            case {{.OS}}-{{.ARCH}} in
+            (linux-amd64)   echo k3sup ;;
+            (linux-arm64)   echo k3sup-arm64 ;;
+            (darwin-amd64)  echo k3sup-darwin ;;
+            (darwin-arm64)  echo k3sup-darwin-arm64 ;;
+            (windows-amd64) echo k3sup.exe ;;
+            esac
+    cmds:
+      - task: download
+        vars:
+          URL: "{{.BASE}}/{{.FILE}}"
+          OUT: k3sup
+
+  all:
+    - task: 7zz
+    - task: coreutils    
+    - task: bun
+    - task: kind
+    - task: k3sup
+    # skipping this as it is slow to download
+    #- task: kubectl

Reply via email to