Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Jan 9, 2025
2 parents b55134d + 540d425 commit 8c7dbf5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
publish-bundle:
name: Build and push bundle image
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
contents: 'read'
id-token: 'write'
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
username: mjgpluralsh
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: "."
file: "./bundle.Dockerfile"
Expand All @@ -59,7 +59,7 @@ jobs:
GIT_COMMIT=${{ github.sha }}
publish-cli:
name: Build and push CLI image
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
contents: 'read'
id-token: 'write'
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
username: mjgpluralsh
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: "."
file: "./cli.Dockerfile"
Expand Down
2 changes: 2 additions & 0 deletions cli.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ ARG TARGETARCH

COPY --from=build --chmod=755 /plural .
COPY --from=build --chmod=755 /linux-${TARGETARCH}/helm .

ENTRYPOINT [ "/plural" ]
5 changes: 4 additions & 1 deletion osbuilder/plural.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
stringData:
userdata: |
#cloud-config
hostname: metal-{{ trunc 4 .MachineID }}
hostname: plural-edge-{{ trunc 10 .MachineID }}
users:
- name: "kairos"
passwd: "kairos"
Expand All @@ -20,6 +20,9 @@ stringData:
- name: "Init"
commands:
- chmod 755 /etc/rancher/k3s/k3s.yaml
bundles:
- targets:
- run://ghcr.io/pluralsh/kairos-plural-bundle:latest
plural:
token: ""
url: console.plrl-dev-aws.onplural.sh
Expand Down
14 changes: 7 additions & 7 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

set -ex

Expand All @@ -9,7 +9,7 @@ K3S_MANIFEST_DIR=${K3S_MANIFEST_DIR:-/var/lib/rancher/k3s/server/manifests/}
BASE_IMAGE="ghcr.io/pluralsh/plural-cli-cloud:0.11.1"
TOKEN=""
URL=""
CLUSTER_NAME="plural-edge"
CLUSTER_NAME_PREFIX="plural-edge"
PROJECT="default"
TAG="plural=edge"

Expand All @@ -26,7 +26,7 @@ templ() {
local file="$3"
local value="$2"
local sentinel="$1"
sed -i "s/@${sentinel}@/$(sed -e 's/[&\\/]/\\&/g; s/$/\\/' -e '$s/\\$//' <<<"${value}")/g" "${file}"
sed -i "s/@${sentinel}@/$(echo "${value}" | sed -e 's/[&\\/]/\\&/g; s/$/\\/' -e '$s/\\$//')/g" "${file}"
}

readConfig() {
Expand All @@ -45,9 +45,9 @@ readConfig() {
URL=$_url
fi

_clusterName=$(getConfig plural.clusterName)
if [ "$_clusterName" != "" ]; then
CLUSTER_NAME=$_clusterName
_clusterNamePrefix=$(getConfig plural.clusterNamePrefix)
if [ "$_clusterNamePrefix" != "" ]; then
CLUSTER_NAME_PREFIX=$_clusterNamePrefix
fi

_project=$(getConfig plural.project)
Expand All @@ -70,7 +70,7 @@ for FILE in assets/*; do
templ "BASE_IMAGE" "${BASE_IMAGE}" "${FILE}"
templ "TOKEN" "${TOKEN}" "${FILE}"
templ "URL" "${URL}" "${FILE}"
templ "CLUSTER_NAME" "${CLUSTER_NAME}" "${FILE}"
templ "CLUSTER_NAME" "${CLUSTER_NAME_PREFIX}-$(cut -c1-10 < /etc/machine-id)" "${FILE}"
templ "PROJECT" "${PROJECT}" "${FILE}"
templ "TAG" "${TAG}" "${FILE}"
done;
Expand Down

0 comments on commit 8c7dbf5

Please sign in to comment.