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

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

commit 1e2f1c78f2859515512eb1cec1f518e524caaf42
Author: francescotimperi <[email protected]>
AuthorDate: Fri Jul 12 21:32:01 2024 +0000

    chore: added basic setup for kaniko
---
 .envrc       | 20 ++++++++++++++++++++
 Taskfile.yml | 16 +++++++++++++++-
 kaniko.yaml  | 26 ++++++++++++++++++++++++++
 shell.nix    | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 94 insertions(+), 1 deletion(-)

diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..bc6295d
--- /dev/null
+++ b/.envrc
@@ -0,0 +1,20 @@
+# 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.
+#
+
+use nix
+
diff --git a/Taskfile.yml b/Taskfile.yml
index a88e0cd..f138fbf 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -22,11 +22,13 @@ vars:
   N: ""
   T: ""
   P: ""
-  BASETAG: 1.3.0-mastrogpt
+  BASETAG: 0.1-dev
   KUBE:
     sh: ./detect.sh
   NS: "nuvolaris"
   PREFIX: ""
+  TAG:
+    sh: git describe --tags --abbrev=0 2>/dev/null || echo latest
 
 dotenv:
   - .env
@@ -326,6 +328,18 @@ tasks:
   docker-login:
     - task: b:docker-login
 
+  install-registry:
+    - helm repo add twuni https://helm.twun.io
+    - helm install docker-registry twuni/docker-registry --namespace default
+
+  build:
+    env:
+      TAG: "{{.TAG}}"
+    cmds:
+    - test -n "$GITHUB_USER" || true "did you configure your .env?"
+    - envsubst  <kaniko.yaml >_kaniko.yaml
+    - cat _kaniko.yaml
+
   shell:
     - kubectl -n nuvolaris exec --stdin --tty {{.POD}} -- /bin/bash
       
diff --git a/kaniko.yaml b/kaniko.yaml
new file mode 100644
index 0000000..eeac3f4
--- /dev/null
+++ b/kaniko.yaml
@@ -0,0 +1,26 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: kaniko
+  namespace: default
+spec:
+  containers:
+  - name: kaniko
+    #image: busybox
+    #command:
+    #- sleep
+    #- inf
+    image: gcr.io/kaniko-project/executor:latest
+    args: 
+      - --context=git://github.com/${GITHUB_USER}/openserverless-operator
+      - --destination=docker-registry:5000/openserverless/operator:${TAG}
+      - --insecure
+      - --insecure-registry=docker-registry
+    volumeMounts:
+    - name: config-volume
+      mountPath: /context
+  restartPolicy: Never
+  volumes:
+  - name: config-volume
+    configMap:
+      name: dockerfile-configmap
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..537facb
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,33 @@
+# 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.
+#
+
+let
+  nixpkgs = fetchTarball 
"https://github.com/NixOS/nixpkgs/tarball/nixos-23.11";;
+  pkgs = import nixpkgs { config = {}; overlays = []; };
+in
+
+pkgs.mkShellNoCC {
+  packages = with pkgs; [
+   python3
+   kubernetes-helm
+   poetry
+   zip
+   unzip
+  ];
+
+}

Reply via email to