From bd9a6c09ea0eadba3c290fcd425b1a0028c81ea6 Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Wed, 16 Aug 2023 12:00:43 -0700 Subject: [PATCH] Build without docker in docker --- .eslintignore | 1 + .gitignore | 1 + .prettierignore | 1 + .woodpecker.yml | 33 ++++++++++++++++++--------------- docker/Dockerfile | 13 ------------- svelte.config.js | 2 +- template.nomad | 2 +- 7 files changed, 23 insertions(+), 30 deletions(-) delete mode 100644 docker/Dockerfile diff --git a/.eslintignore b/.eslintignore index 3897265..3ff953c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,7 @@ .DS_Store node_modules /build +/app /.svelte-kit /package .env diff --git a/.gitignore b/.gitignore index 6635cf5..0f2637c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store node_modules /build +/app /.svelte-kit /package .env diff --git a/.prettierignore b/.prettierignore index 3897265..3ff953c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,7 @@ .DS_Store node_modules /build +/app /.svelte-kit /package .env diff --git a/.woodpecker.yml b/.woodpecker.yml index 25c7a9e..d2e4086 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,18 +1,24 @@ platform: linux/amd64 steps: + build: + image: gitea.elara.ws/elara6331/node + environment: + - LURE_WEB_API_URL=https://api.lure.elara.ws + commands: + - npm i + - npm run build + - tar czf app.tar.gz app/ + publish: - image: woodpeckerci/plugin-docker-buildx - secrets: [docker_username, docker_password] - settings: - repo: elara6331/lure-web - dockerfile: docker/Dockerfile - platforms: linux/amd64,linux/arm64 - build_args: api_url=https://api.lure.elara.ws - tag: latest - when: - branch: public - event: push - + image: gcr.io/go-containerregistry/crane + secrets: [ registry_password ] + commands: + - crane auth login gitea.elara.ws -u Elara6331 -p "$${REGISTRY_PASSWORD}" + - crane append -b gitea.elara.ws/elara6331/node -f app.tar.gz -t gitea.elara.ws/elara6331/lure-web:amd64 --platform=linux/amd64 + - crane append -b gitea.elara.ws/elara6331/node -f app.tar.gz -t gitea.elara.ws/elara6331/lure-web:arm64 --platform=linux/arm64 + - crane append -b gitea.elara.ws/elara6331/node -f app.tar.gz -t gitea.elara.ws/elara6331/lure-web:riscv64 --platform=linux/riscv64 + - crane index -m gitea.elara.ws/elara6331/lure-web:amd64 -m gitea.elara.ws/elara6331/lure-web:arm64 -m gitea.elara.ws/elara6331/lure-web:riscv64 -t gitea.elara.ws/elara6331/lure-web:latest + deploy: image: loq9/drone-nomad secrets: [lure_api_github_secret] @@ -22,6 +28,3 @@ steps: environment: - PLUGIN_WATCH_DEPLOYMENT=true - PLUGIN_WATCH_DEPLOYMENT_TIMEOUT=10m - when: - branch: public - event: push diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 2415997..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:19-alpine - -ARG api_url -ENV LURE_WEB_API_URL $api_url - -RUN apk add git -RUN git clone https://gitea.elara.ws/Elara6331/lure-web -RUN cd lure-web && \ - npm i && \ - npm run build - -WORKDIR /lure-web -ENTRYPOINT node build diff --git a/svelte.config.js b/svelte.config.js index 225678b..d979c9a 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -16,7 +16,7 @@ const config = { ], kit: { - adapter: adapter(), + adapter: adapter({out: 'app',}), env: { publicPrefix: "LURE_WEB_" }, diff --git a/template.nomad b/template.nomad index 2f53d1f..55c97ee 100644 --- a/template.nomad +++ b/template.nomad @@ -52,7 +52,7 @@ job "lure-web" { driver = "docker" config { - image = "elara6331/lure-web:latest" + image = "gitea.elara.ws/elara6331/lure-web:latest" ports = ["http"] }