From dd32a5a0c1838e3e464e8fdbe80a4d1a9c2f8235 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 13 Apr 2022 12:31:36 -0300 Subject: [PATCH 01/26] woodpecker --- .woodpecker.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 00000000..81af8efb --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,26 @@ +pipeline: + publish: + image: plugins/docker + settings: + registry: registry.nulo.in + username: sutty + repo: registry.nulo.in/sutty/panel + tags: + - ${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH} + - latest + build_args: + - RUBY_VERSION=${RUBY_VERSION} + - RUBY_PATCH=${RUBY_PATCH} + - ALPINE_VERSION=${ALPINE_VERSION} + - BASE_IMAGE=registry.nulo.in/sutty/rails + purge: false + secrets: + - docker_password + when: + branch: antifascista + event: push +matrix: + include: + - ALPINE_VERSION: 3.13.10 + RUBY_VERSION: 2.7 + RUBY_PATCH: 6 From d9a5f7ff238b10795022b160dfbabb1716ce4c29 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 13 Apr 2022 12:34:42 -0300 Subject: [PATCH 02/26] actualizar pandoc --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ecf43cbc..68ec6188 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM registry.nulo.in/sutty/rails:3.13.6-2.7.5 -ARG PANDOC_VERSION=2.17.1.1 +ARG PANDOC_VERSION=2.18 ENV RAILS_ENV production # Instalar las dependencias, separamos la librería de base de datos para From 244a8de406b6afaf471da8934e4ce9bec300701c Mon Sep 17 00:00:00 2001 From: f Date: Wed, 13 Apr 2022 12:37:13 -0300 Subject: [PATCH 03/26] ramas que provocan deploys --- .woodpecker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 81af8efb..db2b307d 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -17,7 +17,9 @@ pipeline: secrets: - docker_password when: - branch: antifascista + branch: + - rails + - panel.sutty.nl event: push matrix: include: From d9e2291f264b273b53ecfe579d7b7d610045752a Mon Sep 17 00:00:00 2001 From: f Date: Wed, 13 Apr 2022 16:44:52 -0300 Subject: [PATCH 04/26] usar argumentos --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 68ec6188..ac90a548 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,8 @@ -FROM registry.nulo.in/sutty/rails:3.13.6-2.7.5 +ARG RUBY_VERSION=2.7 +ARG RUBY_PATCH=6 +ARG ALPINE_VERSION=3.13.10 +ARG BASE_IMAGE=registry.nulo.in/sutty/rails +FROM ${BASE_IMAGE}:${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH} ARG PANDOC_VERSION=2.18 ENV RAILS_ENV production From 2dc01cef9c1aedc27a46e4f898fabd216da4e1d1 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 4 Nov 2022 14:13:44 -0300 Subject: [PATCH 05/26] fix: actualizar contenedor a alpine 3.14 #8369 --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index db2b307d..087b2e90 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -23,6 +23,6 @@ pipeline: event: push matrix: include: - - ALPINE_VERSION: 3.13.10 + - ALPINE_VERSION: 3.14.8 RUBY_VERSION: 2.7 RUBY_PATCH: 6 From 3ec546eb82890490ad761014a23c6ea157c9fe1d Mon Sep 17 00:00:00 2001 From: f Date: Thu, 29 Dec 2022 14:55:30 -0300 Subject: [PATCH 06/26] fix: dependencias faltantes --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ac90a548..871e6fb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ENV RAILS_ENV production # principal RUN apk add --no-cache libxslt libxml2 postgresql-libs libssh2 \ rsync git jpegoptim vips tectonic oxipng git-lfs openssh-client \ - yarn daemonize ruby-webrick + yarn daemonize ruby-webrick postgresql-client dateutils file RUN gem install --no-document --no-user-install foreman RUN wget https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz -O - | tar --strip-components 1 -xvzf - pandoc-${PANDOC_VERSION}/bin/pandoc && mv /bin/pandoc /usr/bin/pandoc From bbd19f44aee1686defc5039df36378ff8bc75c89 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 25 Jan 2023 14:27:14 -0300 Subject: [PATCH 07/26] ci: compilar assets cuando cambian las dependencias --- .woodpecker.yml | 17 +++++++++++++++++ package.json | 1 + 2 files changed, 18 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 087b2e90..b3406f39 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,4 +1,21 @@ pipeline: + assets: + image: "registry.nulo.in/sutty/panel:3.14.8-2.7.6" + commands: + - "apk add python2" + - "yarn" + - "RAILS_GROUPS=assets bundle install --path=vendor" + - "RAILS_GROUPS=assets bundle exec rails assets:precompile assets:clean" + - "git add assets && git commit -m \"[skip ci] JS\" || true" + when: + branch: + - "rails" + - "panel.sutty.nl" + path: + include: + - "app/assets/**/*" + - "package.json" + - "yarn.lock" publish: image: plugins/docker settings: diff --git a/package.json b/package.json index d520c8f5..6a5f159f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "sutty", + "author": "Sutty ", "private": true, "dependencies": { "@airbrake/browser": "^1.4.1", From 1b0c3cb0acf7d6aca045b253e2022065e60a152b Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 19:11:18 -0300 Subject: [PATCH 08/26] ci: compilar en cambios de javascript tambien --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index b3406f39..a2289c12 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -14,6 +14,7 @@ pipeline: path: include: - "app/assets/**/*" + - "app/javascript/**/*" - "package.json" - "yarn.lock" publish: From 0b63ebdd278051ba1b3b5c29fec87b67a6cedb60 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 19:15:26 -0300 Subject: [PATCH 09/26] chore: yaml --- .woodpecker.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index a2289c12..de760284 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -18,29 +18,29 @@ pipeline: - "package.json" - "yarn.lock" publish: - image: plugins/docker + image: "plugins/docker" settings: - registry: registry.nulo.in - username: sutty - repo: registry.nulo.in/sutty/panel + registry: "registry.nulo.in" + username: "sutty" + repo: "registry.nulo.in/sutty/panel" tags: - - ${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH} - - latest + - "${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}" + - "latest" build_args: - - RUBY_VERSION=${RUBY_VERSION} - - RUBY_PATCH=${RUBY_PATCH} - - ALPINE_VERSION=${ALPINE_VERSION} - - BASE_IMAGE=registry.nulo.in/sutty/rails + - "RUBY_VERSION=${RUBY_VERSION}" + - "RUBY_PATCH=${RUBY_PATCH}" + - "ALPINE_VERSION=${ALPINE_VERSION}" + - "BASE_IMAGE=registry.nulo.in/sutty/rails" purge: false secrets: - - docker_password + - "docker_password" when: branch: - - rails - - panel.sutty.nl - event: push + - "rails" + - "panel.sutty.nl" + event: "push" matrix: include: - - ALPINE_VERSION: 3.14.8 - RUBY_VERSION: 2.7 - RUBY_PATCH: 6 + - ALPINE_VERSION: "3.14.8" + RUBY_VERSION: "2.7" + RUBY_PATCH: "6" From 6d25d71dd13d2dda59f7b8ae493cac597de383aa Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 19:17:16 -0300 Subject: [PATCH 10/26] fix: solo compilar el container cuando cambia --- .woodpecker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index de760284..aef70024 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -39,6 +39,10 @@ pipeline: - "rails" - "panel.sutty.nl" event: "push" + path: + include: + - "Dockerfile" + - ".dockerignore" matrix: include: - ALPINE_VERSION: "3.14.8" From 25e6cd62dd797be25c38e35124c8bce3ec11b3c1 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 19:20:13 -0300 Subject: [PATCH 11/26] fix: aplicar una master key --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index aef70024..07f18570 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -5,7 +5,7 @@ pipeline: - "apk add python2" - "yarn" - "RAILS_GROUPS=assets bundle install --path=vendor" - - "RAILS_GROUPS=assets bundle exec rails assets:precompile assets:clean" + - "RAILS_GROUPS=assets RAILS_MASTER_KEY=nada bundle exec rails assets:precompile assets:clean" - "git add assets && git commit -m \"[skip ci] JS\" || true" when: branch: From 4b575801c539351f640a9cb36bcbebd902724780 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 19:30:58 -0300 Subject: [PATCH 12/26] fix: usar .env --- .env.example | 3 ++- .woodpecker.yml | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index fb086224..3d134dc2 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,8 @@ +RAILS_MASTER_KEY=CHANGEME RAILS_GROUPS=assets DELEGATE=athshe.sutty.nl HAINISH=../haini.sh/haini.sh -DATABASE= +DATABASE_URL=postgres://suttier@postgresql.sutty.local/sutty RAILS_ENV=development IMAP_SERVER= DEFAULT_FROM= diff --git a/.woodpecker.yml b/.woodpecker.yml index 07f18570..1ad83060 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -2,10 +2,11 @@ pipeline: assets: image: "registry.nulo.in/sutty/panel:3.14.8-2.7.6" commands: - - "apk add python2" + - "apk add python2 dotenv" - "yarn" - - "RAILS_GROUPS=assets bundle install --path=vendor" - - "RAILS_GROUPS=assets RAILS_MASTER_KEY=nada bundle exec rails assets:precompile assets:clean" + - "cp .env.example .env" + - "dotenv bundle install --path=vendor" + - "dotenv RAILS_ENV=production bundle exec rails assets:precompile assets:clean" - "git add assets && git commit -m \"[skip ci] JS\" || true" when: branch: From cacd37348f0022c459fe3a59ddc88b3d40ceabb3 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 19:51:46 -0300 Subject: [PATCH 13/26] fix: credenciales de prueba --- .env.example | 3 ++- .gitignore | 1 - config/credentials.yml.enc | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 config/credentials.yml.enc diff --git a/.env.example b/.env.example index 3d134dc2..f3cf48d9 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ -RAILS_MASTER_KEY=CHANGEME +# pwgen -1 32 +RAILS_MASTER_KEY=11111111111111111111111111111111 RAILS_GROUPS=assets DELEGATE=athshe.sutty.nl HAINISH=../haini.sh/haini.sh diff --git a/.gitignore b/.gitignore index 496b66cb..baf85364 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,6 @@ # Ignore master key for decrypting credentials and more. /config/master.key -/config/credentials.yml.enc /public/packs /public/packs-test diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 00000000..ad215f22 --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +r7drFxABS9885DuIhjg3ErL++9dkHZdO6/kBlBNlML20R2R2hhYkE1C2Q9fO7zGaHQX3y51FKu9nRAI9Bomp5JCF/RR3oEzP24Je9DsN/Q2lg3smTNuXKV5J8NuqZPRVBZIp7FsyR66xThzI6ZSrk0IFXRpTwQkW83v3Z+FqLKCAFBAiJ84occonkLUxppL0W0IYN4FzNAK0KiPixZDTg/oAqG17pY0suyJRCe86OYkdrvblI/EEmoxKzSPzT4fml4wka26z4KYeRYDjaQmlTJ8/zLK82AruxhYvL9abdtjsUYIVVWHdNrlRRZaVhFP79YIa0AFfHK1KviMKAAfb8EfDar1fivtzW9mb46dzZcEu0ynJB+HDdM1JFiVw33INI6BY8I604pu5B5ebd9Djd1nIP2wNZNu7ZBOgvbPnDJUdenVAnWYZAqmPVAryK1MfwvaG0RmVYnhlIZoQ2HTLENHV9AyAfUOUiZUse7GQ85iOqrn3yk2KxEh7i4U5yqZu2tuMBBmQK8jpDWiu6hEtIIDgL2327EUNTw1uDvMfpD64I9pBwHGXhKBr3Qi02rNwOI6wJBTLTaSHv15oAolVmiI3kWtQca+UO7LfMaU+mLb6xZ4jm3/maNmugKKHD4Ud7FO2nJ6m2FPUB7uolQPiiSY4cnkd2uKNn7aQPMDcWlQn1CQuwriGwhJD27YfYzyJRD5PG33bmR3JSSjUe4BI9cBTv3UZ7XS/B7Z7SEzqef09hpMUVzEsEsw5yW6Qm1MV8AhYaxPuWLOElwiATcObehJ7LyjeKQSwoTioEG4GBlvgujcNTxI5O0RkU7hP6I/A3Q==--3br8yafpyHA5Y6YU--Aq+HRsZsGTHm4pOfvQYyoA== \ No newline at end of file From 12a85bc5856424ed5ee87c9715410e4a05a6d694 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 20:05:57 -0300 Subject: [PATCH 14/26] fix: credentials must be strings --- config/credentials.yml.enc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc index ad215f22..4add450d 100644 --- a/config/credentials.yml.enc +++ b/config/credentials.yml.enc @@ -1 +1 @@ -r7drFxABS9885DuIhjg3ErL++9dkHZdO6/kBlBNlML20R2R2hhYkE1C2Q9fO7zGaHQX3y51FKu9nRAI9Bomp5JCF/RR3oEzP24Je9DsN/Q2lg3smTNuXKV5J8NuqZPRVBZIp7FsyR66xThzI6ZSrk0IFXRpTwQkW83v3Z+FqLKCAFBAiJ84occonkLUxppL0W0IYN4FzNAK0KiPixZDTg/oAqG17pY0suyJRCe86OYkdrvblI/EEmoxKzSPzT4fml4wka26z4KYeRYDjaQmlTJ8/zLK82AruxhYvL9abdtjsUYIVVWHdNrlRRZaVhFP79YIa0AFfHK1KviMKAAfb8EfDar1fivtzW9mb46dzZcEu0ynJB+HDdM1JFiVw33INI6BY8I604pu5B5ebd9Djd1nIP2wNZNu7ZBOgvbPnDJUdenVAnWYZAqmPVAryK1MfwvaG0RmVYnhlIZoQ2HTLENHV9AyAfUOUiZUse7GQ85iOqrn3yk2KxEh7i4U5yqZu2tuMBBmQK8jpDWiu6hEtIIDgL2327EUNTw1uDvMfpD64I9pBwHGXhKBr3Qi02rNwOI6wJBTLTaSHv15oAolVmiI3kWtQca+UO7LfMaU+mLb6xZ4jm3/maNmugKKHD4Ud7FO2nJ6m2FPUB7uolQPiiSY4cnkd2uKNn7aQPMDcWlQn1CQuwriGwhJD27YfYzyJRD5PG33bmR3JSSjUe4BI9cBTv3UZ7XS/B7Z7SEzqef09hpMUVzEsEsw5yW6Qm1MV8AhYaxPuWLOElwiATcObehJ7LyjeKQSwoTioEG4GBlvgujcNTxI5O0RkU7hP6I/A3Q==--3br8yafpyHA5Y6YU--Aq+HRsZsGTHm4pOfvQYyoA== \ No newline at end of file +1jEfzfldP9tT4+HWfhP48I9hw31gYCnnxHWpYjPrcTm/pgkFdiG+mDa6y31EOxzs50w6FEw2GO127BnyBSUIPIxuWY0cR96xL5pVrS3vjyzM84QN4lJF9ER0Tz1AQ9S7NJ54CelSkMfFt/rf+O4YM8cLtdSVsVC/HlGbp16p3D1pm4MFo5cQb0hEmlyyYlzEn4oJtsp/MCIwI4+z8oFhxKdMIxdbiw+KS/7PBRfMm1h5rdGORCnD69iVmnXseMvVtZn9A7N7uR6+gFlhxlD5yyEW0pwTj3tbu9NeIOVbtmYOL5ZhLW9REXtGTqR5Op/LN+ukIXbDNEScKltJXUdWfa9Pd/QjVT8IMURZ04POEMDgs1cw363yz4f+WQForhSco9oYLDOd5hTGRXoZ9fnjnfJSTjINM62hkfDY3w3+s844nNbjbj+lPTJHU/QjRhcuNqBDDxWUfwTmRIqm5zrelnHnZnuFmFwCNet6NChC6EFUAFjrals6kTSQllyMt4xImqA+HL7DnjWj6VURSH+nGQTA4tQvDdfbDwTzg/PvRkJcsy2dRd135RQdmRZ+8KXBviLabwdR256vaCqSO1j+jyeUPGLll35ghyLxncyBkkAKt1zaDRPDWgVafg0gJ3v7hVV5TYgToPzlv4w88KPCY7cBhkb1qGoXAhtO6iAuZYK9eyZd1gNQJKyqbcLqA5aTTX/ylfdbptWhaZ8ibB8KBgVyn2RmrOHEhB38rDSMHHNfK3Xs4/hhqMFIGHGTGCUYVmjCzhVFd15yRurU32d3YtP8W4L77H7qkFsF1gnvsZx+R084LcJqknwY94dmjtUE4x2u+Qh3ElFj--lr8JoUq1WH9xXNsB--mE8hxHADL7SbDWabAPY1+Q== \ No newline at end of file From 723b8e7974f5a04d1bd775a40e3c9f2c5944ba4a Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 20:26:07 -0300 Subject: [PATCH 15/26] ci: publicar los assets --- .woodpecker.yml | 51 +++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1ad83060..3f3c510c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,23 +1,4 @@ pipeline: - assets: - image: "registry.nulo.in/sutty/panel:3.14.8-2.7.6" - commands: - - "apk add python2 dotenv" - - "yarn" - - "cp .env.example .env" - - "dotenv bundle install --path=vendor" - - "dotenv RAILS_ENV=production bundle exec rails assets:precompile assets:clean" - - "git add assets && git commit -m \"[skip ci] JS\" || true" - when: - branch: - - "rails" - - "panel.sutty.nl" - path: - include: - - "app/assets/**/*" - - "app/javascript/**/*" - - "package.json" - - "yarn.lock" publish: image: "plugins/docker" settings: @@ -44,6 +25,38 @@ pipeline: include: - "Dockerfile" - ".dockerignore" + assets: + image: "registry.nulo.in/sutty/panel:${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}" + commands: + - "apk add python2 dotenv openssh-client" + - "mkdir ~/.ssh/" + - "echo \"$${KNOW_HOSTS}\" | base64 -d >> ~/.ssh/known_hosts" + - "eval $(ssh-agent -s)" + - "echo \"$${SSH_KEY}\" | base64 -d | ssh-add -" + - "git config user.name Woodpecker" + - "git config user.email ci@sutty.coop.ar" + - "git remote add origin ${ORIGIN}" + - "git checkout -B ${CI_COMMIT_BRANCH}" + - "yarn" + - "cp .env.example .env" + - "dotenv bundle install --path=vendor" + - "dotenv RAILS_ENV=production bundle exec rails assets:precompile assets:clean" + - "git add public && git commit -m \"ci: assets [skip ci]\"" + - "git push origin ${CI_COMMIT_BRANCH}" + secrets: + - "SSH_KEY" + - "KNOWN_HOSTS" + - "ORIGIN" + when: + branch: + - "rails" + - "panel.sutty.nl" + path: + include: + - "app/assets/**/*" + - "app/javascript/**/*" + - "package.json" + - "yarn.lock" matrix: include: - ALPINE_VERSION: "3.14.8" From 08cad58b77f418b983d03317e0a748153f336e07 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 14 Mar 2023 20:29:58 -0300 Subject: [PATCH 16/26] fixup! ci: publicar los assets --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 3f3c510c..198f5a99 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -35,7 +35,7 @@ pipeline: - "echo \"$${SSH_KEY}\" | base64 -d | ssh-add -" - "git config user.name Woodpecker" - "git config user.email ci@sutty.coop.ar" - - "git remote add origin ${ORIGIN}" + - "git remote add origin $${ORIGIN}" - "git checkout -B ${CI_COMMIT_BRANCH}" - "yarn" - "cp .env.example .env" From 9773285e9f4d060473eafb16a1b76edbf171b475 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 15 Mar 2023 11:23:35 -0300 Subject: [PATCH 17/26] fix: no duplicar el remote --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 198f5a99..41dc85a3 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -35,14 +35,14 @@ pipeline: - "echo \"$${SSH_KEY}\" | base64 -d | ssh-add -" - "git config user.name Woodpecker" - "git config user.email ci@sutty.coop.ar" - - "git remote add origin $${ORIGIN}" + - "git remote add upstream $${ORIGIN}" - "git checkout -B ${CI_COMMIT_BRANCH}" - "yarn" - "cp .env.example .env" - "dotenv bundle install --path=vendor" - "dotenv RAILS_ENV=production bundle exec rails assets:precompile assets:clean" - "git add public && git commit -m \"ci: assets [skip ci]\"" - - "git push origin ${CI_COMMIT_BRANCH}" + - "git push upstream ${CI_COMMIT_BRANCH}" secrets: - "SSH_KEY" - "KNOWN_HOSTS" From c9d7ac437bd5e88531dac3d375250a2bb096a5cd Mon Sep 17 00:00:00 2001 From: f Date: Thu, 16 Mar 2023 09:51:28 -0300 Subject: [PATCH 18/26] =?UTF-8?q?ci:=20probar=20conexi=C3=B3n=20a=20ssh=20?= =?UTF-8?q?antes=20de=20perder=20tiempo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 41dc85a3..84101fdf 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -29,10 +29,12 @@ pipeline: image: "registry.nulo.in/sutty/panel:${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}" commands: - "apk add python2 dotenv openssh-client" - - "mkdir ~/.ssh/" - - "echo \"$${KNOW_HOSTS}\" | base64 -d >> ~/.ssh/known_hosts" + - "install -d -m 700 ~/.ssh/" + - "echo \"$${KNOWN_HOSTS}\" | base64 -d >> ~/.ssh/known_hosts" + - "chmod 600 ~/.ssh/known_hosts" - "eval $(ssh-agent -s)" - "echo \"$${SSH_KEY}\" | base64 -d | ssh-add -" + - "ssh $${ORIGIN%:*}" - "git config user.name Woodpecker" - "git config user.email ci@sutty.coop.ar" - "git remote add upstream $${ORIGIN}" From b51748ddcbc903838fb76c4d1c3df1ee490153bf Mon Sep 17 00:00:00 2001 From: f Date: Thu, 16 Mar 2023 10:18:42 -0300 Subject: [PATCH 19/26] ci: limpiar assets por separado --- .woodpecker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 84101fdf..e550afbe 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -42,7 +42,8 @@ pipeline: - "yarn" - "cp .env.example .env" - "dotenv bundle install --path=vendor" - - "dotenv RAILS_ENV=production bundle exec rails assets:precompile assets:clean" + - "dotenv RAILS_ENV=production bundle exec rails assets:precompile" + - "dotenv RAILS_ENV=production bundle exec rails assets:clean" - "git add public && git commit -m \"ci: assets [skip ci]\"" - "git push upstream ${CI_COMMIT_BRANCH}" secrets: From 4de942a7ca5536260a092c0e2aa07e57f4f1d283 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 16 Mar 2023 10:23:11 -0300 Subject: [PATCH 20/26] ci: eliminar packs antes de recompilarlos --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index e550afbe..0492cee2 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -42,6 +42,7 @@ pipeline: - "yarn" - "cp .env.example .env" - "dotenv bundle install --path=vendor" + - "dotenv RAILS_ENV=production bundle exec rails webpacker:clobber" - "dotenv RAILS_ENV=production bundle exec rails assets:precompile" - "dotenv RAILS_ENV=production bundle exec rails assets:clean" - "git add public && git commit -m \"ci: assets [skip ci]\"" From 800386e52ccbe6d40dfe08469d83f1bfa8696040 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 16 Mar 2023 11:24:38 -0300 Subject: [PATCH 21/26] =?UTF-8?q?ci:=20no=20hacer=20conflicto=20con=20las?= =?UTF-8?q?=20credenciales=20de=20producci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 1 + config/{credentials.yml.enc => credentials.yml.enc.ci} | 0 2 files changed, 1 insertion(+) rename config/{credentials.yml.enc => credentials.yml.enc.ci} (100%) diff --git a/.woodpecker.yml b/.woodpecker.yml index 0492cee2..ab4887ac 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -39,6 +39,7 @@ pipeline: - "git config user.email ci@sutty.coop.ar" - "git remote add upstream $${ORIGIN}" - "git checkout -B ${CI_COMMIT_BRANCH}" + - "mv config/credentials.yml.enc.ci config/credentials.yml.enc" - "yarn" - "cp .env.example .env" - "dotenv bundle install --path=vendor" diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc.ci similarity index 100% rename from config/credentials.yml.enc rename to config/credentials.yml.enc.ci From a97da5b821768a1a2fdcf0eba185835d70cc2ee7 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 16 Mar 2023 12:22:37 -0300 Subject: [PATCH 22/26] fix: volver a ignorar los secretos --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index baf85364..496b66cb 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ # Ignore master key for decrypting credentials and more. /config/master.key +/config/credentials.yml.enc /public/packs /public/packs-test From 117b8502769b1b554878a219b32f15d4a4dfb13b Mon Sep 17 00:00:00 2001 From: f Date: Thu, 30 Mar 2023 10:27:30 -0300 Subject: [PATCH 23/26] fix: hacer pull antes de push --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index ab4887ac..887d397f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -47,6 +47,7 @@ pipeline: - "dotenv RAILS_ENV=production bundle exec rails assets:precompile" - "dotenv RAILS_ENV=production bundle exec rails assets:clean" - "git add public && git commit -m \"ci: assets [skip ci]\"" + - "git pull upstream ${CI_COMMIT_BRANCH}" - "git push upstream ${CI_COMMIT_BRANCH}" secrets: - "SSH_KEY" From edd88d04b93aee72429c826ccdf3437a4b2aa0f2 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 30 Mar 2023 11:29:23 -0300 Subject: [PATCH 24/26] =?UTF-8?q?feat:=20pre=20comprimir=20con=20brotli=20?= =?UTF-8?q?tambi=C3=A9n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 887d397f..19bd429b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -28,7 +28,7 @@ pipeline: assets: image: "registry.nulo.in/sutty/panel:${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}" commands: - - "apk add python2 dotenv openssh-client" + - "apk add python2 dotenv openssh-client brotli" - "install -d -m 700 ~/.ssh/" - "echo \"$${KNOWN_HOSTS}\" | base64 -d >> ~/.ssh/known_hosts" - "chmod 600 ~/.ssh/known_hosts" @@ -46,6 +46,7 @@ pipeline: - "dotenv RAILS_ENV=production bundle exec rails webpacker:clobber" - "dotenv RAILS_ENV=production bundle exec rails assets:precompile" - "dotenv RAILS_ENV=production bundle exec rails assets:clean" + - "find public -type f -print0 | xargs -r0 brotli -k9" - "git add public && git commit -m \"ci: assets [skip ci]\"" - "git pull upstream ${CI_COMMIT_BRANCH}" - "git push upstream ${CI_COMMIT_BRANCH}" From 59e97ef6856fb8617df3edaab6dcf7e2df5554e5 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 31 Mar 2023 18:16:11 -0300 Subject: [PATCH 25/26] =?UTF-8?q?fix:=20forzar=20la=20compilaci=C3=B3n=20d?= =?UTF-8?q?e=20brotli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 19bd429b..1d760b52 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -46,7 +46,7 @@ pipeline: - "dotenv RAILS_ENV=production bundle exec rails webpacker:clobber" - "dotenv RAILS_ENV=production bundle exec rails assets:precompile" - "dotenv RAILS_ENV=production bundle exec rails assets:clean" - - "find public -type f -print0 | xargs -r0 brotli -k9" + - "find public -type f -print0 | xargs -r0 brotli -k9f" - "git add public && git commit -m \"ci: assets [skip ci]\"" - "git pull upstream ${CI_COMMIT_BRANCH}" - "git push upstream ${CI_COMMIT_BRANCH}" From dd3ef04fc4b759d818ac9ef16db88e59761889ab Mon Sep 17 00:00:00 2001 From: f Date: Thu, 6 Apr 2023 11:19:33 -0300 Subject: [PATCH 26/26] =?UTF-8?q?feat:=20generar=20im=C3=A1genes=20p=C3=BA?= =?UTF-8?q?blicas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1d760b52..2e775624 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,10 +1,10 @@ pipeline: publish: - image: "plugins/docker" + image: "docker.io/woodpeckerci/plugin-docker-buildx" settings: - registry: "registry.nulo.in" + registry: "gitea.nulo.in" username: "sutty" - repo: "registry.nulo.in/sutty/panel" + repo: "gitea.nulo.in/sutty/panel" tags: - "${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}" - "latest" @@ -12,10 +12,10 @@ pipeline: - "RUBY_VERSION=${RUBY_VERSION}" - "RUBY_PATCH=${RUBY_PATCH}" - "ALPINE_VERSION=${ALPINE_VERSION}" - - "BASE_IMAGE=registry.nulo.in/sutty/rails" + - "BASE_IMAGE=gitea.nulo.in/sutty/rails" purge: false secrets: - - "docker_password" + - "DOCKER_PASSWORD" when: branch: - "rails" @@ -26,7 +26,7 @@ pipeline: - "Dockerfile" - ".dockerignore" assets: - image: "registry.nulo.in/sutty/panel:${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}" + image: "gitea.nulo.in/sutty/panel:${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}" commands: - "apk add python2 dotenv openssh-client brotli" - "install -d -m 700 ~/.ssh/" @@ -66,6 +66,6 @@ pipeline: - "yarn.lock" matrix: include: - - ALPINE_VERSION: "3.14.8" + - ALPINE_VERSION: "3.14.10" RUBY_VERSION: "2.7" - RUBY_PATCH: "6" + RUBY_PATCH: "8"