diff --git a/.drone.yml b/.drone.yml index c03c0e52c..9ba97735a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -62,7 +62,8 @@ steps: # Backup the original git configuration before changing attributes - export GIT_CONF=$PWD/.git/config - - cp $GIT_CONF /tmp/git.config.orig + - export TMP_GIT_CONF=/tmp/git.config.orig + - cp $GIT_CONF $TMP_GIT_CONF - git config --global --add safe.directory $PWD # Install the SSH and PGP keys @@ -95,7 +96,7 @@ steps: - git checkout master # Restore the original git configuration - - mv /tmp/git.config.orig $GIT_CONF + - mv $TMP_GIT_CONF $GIT_CONF when: event: @@ -187,7 +188,8 @@ steps: # Backup the original git configuration before changing attributes - export GIT_CONF=$PWD/.git/config - - cp $GIT_CONF /tmp/git.config.orig + - export TMP_GIT_CONF=/tmp/git.config.orig + - cp $GIT_CONF $TMP_GIT_CONF - git config --global --add safe.directory $PWD - cd platypush/backend/http/webapp @@ -242,7 +244,93 @@ steps: - git push -f origin master # Restore the original git configuration - - mv /tmp/git.config.orig $GIT_CONF + - mv $TMP_GIT_CONF $GIT_CONF + +### +### Regenerate the components.json cache +### + +- name: update-components-cache + image: alpine + + environment: + SSH_PUBKEY: + from_secret: ssh_pubkey + SSH_PRIVKEY: + from_secret: ssh_privkey + PGP_KEY: + from_secret: pgp_key + PGP_KEY_ID: + from_secret: pgp_key_id + + when: + branch: + - master + event: + - push + + depends_on: + - build-ui + + commands: + - export SKIPCI="$PWD/.skipci" + - export CACHEFILE="$PWD/platypush/components.json.gz" + - | + [ -f "$SKIPCI" ] && exit 0 + + - apk add --update --no-cache $(cat platypush/install/requirements/alpine.txt) + - pip install . --break-system-packages + - | + python - < ~/.ssh/id_rsa.pub + - | + cat < ~/.ssh/id_rsa + $SSH_PRIVKEY + EOF + - chmod 0600 ~/.ssh/id_rsa + - ssh-keyscan git.platypush.tech >> ~/.ssh/known_hosts 2>/dev/null + + - git config user.name "Platypush CI/CD Automation" + - git config user.email "admin@platypush.tech" + - git config commit.gpgsign true + - git config user.signingkey $PGP_KEY_ID + - git add "$CACHEFILE" + - git commit dist -S -m "[Automatic] Updated components cache" --no-verify + - git remote rm origin + - git remote add origin git@git.platypush.tech:platypush/platypush.git + - git push -f origin master + + # Restore the original git configuration + - mv $TMP_GIT_CONF $GIT_CONF ### ### Update the Arch packages @@ -264,7 +352,7 @@ steps: - push depends_on: - - build-ui + - update-components-cache commands: - | @@ -364,7 +452,7 @@ steps: - push depends_on: - - build-ui + - update-components-cache commands: - | @@ -463,7 +551,7 @@ steps: - push depends_on: - - build-ui + - update-components-cache commands: - | @@ -774,7 +862,7 @@ steps: - push depends_on: - - build-ui + - update-components-cache commands: - | diff --git a/MANIFEST.in b/MANIFEST.in index ac702393c..310df247f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,3 +3,4 @@ recursive-include platypush/install * include platypush/plugins/http/webpage/mercury-parser.js include platypush/config/*.yaml global-include manifest.yaml +global-include components.json.gz diff --git a/platypush/backend/http/webapp/src/components/panels/Extensions/Install.vue b/platypush/backend/http/webapp/src/components/panels/Extensions/Install.vue index d12cefc0d..b118a4f90 100644 --- a/platypush/backend/http/webapp/src/components/panels/Extensions/Install.vue +++ b/platypush/backend/http/webapp/src/components/panels/Extensions/Install.vue @@ -7,11 +7,11 @@
- -
+ +
-
+