ci: update bundle scripts to use `pnpm exec` + add openssh-client to ci docker image

This commit is contained in:
Yassine Doghri 2023-02-22 17:25:14 +00:00
parent e0c3ddb07d
commit 9ef58808fc
6 changed files with 11 additions and 14 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --verbose --edit "$1" pnpm exec commitlint --verbose --edit "$1"

View File

@ -7,5 +7,5 @@ INTERACTIVE="--no-interaction"
vendor/bin/captainhook $INTERACTIVE --configuration=captainhook.json --bootstrap=vendor/autoload.php hook:pre-commit "$@" <&0 vendor/bin/captainhook $INTERACTIVE --configuration=captainhook.json --bootstrap=vendor/autoload.php hook:pre-commit "$@" <&0
npm run typecheck pnpm run typecheck
npx lint-staged pnpm exec lint-staged

View File

@ -17,7 +17,7 @@
[ [
"@semantic-release/exec", "@semantic-release/exec",
{ {
"prepareCmd": "./scripts/bundle.sh ${nextRelease.version} && ./scripts/package.sh ${nextRelease.version} && npx prettier --write CHANGELOG.md" "prepareCmd": "./scripts/bundle.sh ${nextRelease.version} && ./scripts/package.sh ${nextRelease.version} && pnpm exec prettier --write CHANGELOG.md"
} }
], ],
"@semantic-release/npm", "@semantic-release/npm",

View File

@ -19,6 +19,7 @@ RUN \
wget \ wget \
jq \ jq \
zip \ zip \
openssh-client \
rsync \ rsync \
icu-libs \ icu-libs \
mysql \ mysql \

View File

@ -9,7 +9,7 @@ stages:
- cd docs - cd docs
- chmod +x ./scripts/i18n-filter.sh - chmod +x ./scripts/i18n-filter.sh
- ./scripts/i18n-filter.sh src - ./scripts/i18n-filter.sh src
- npm ci - pnpm install
cache: cache:
paths: paths:
@ -20,7 +20,7 @@ build:
extends: .documentation-setup extends: .documentation-setup
stage: build stage: build
script: script:
- npm run build - pnpm run build
except: except:
- main - main
- beta - beta
@ -33,7 +33,7 @@ build-production:
name: production name: production
url: https://docs.castopod.org/ url: https://docs.castopod.org/
script: script:
- npm run build - pnpm run build
artifacts: artifacts:
paths: paths:
- docs/.vitepress/dist - docs/.vitepress/dist
@ -56,10 +56,6 @@ deploy:
SSH_PORT: 3242 SSH_PORT: 3242
SOURCE_FOLDER: "docs/.vitepress/dist/" SOURCE_FOLDER: "docs/.vitepress/dist/"
before_script: before_script:
# install rsync for file transfers
- apt-get update && apt-get install rsync -y
# ssh config
- "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )"
# Run ssh-agent (inside the build environment) # Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store

View File

@ -6,14 +6,14 @@ set -e
if [ "${CI_COMMIT_BEFORE_SHA}" = "0000000000000000000000000000000000000000" ]; if [ "${CI_COMMIT_BEFORE_SHA}" = "0000000000000000000000000000000000000000" ];
then then
echo "commitlint from HEAD^" echo "commitlint from HEAD^"
pnpx commitlint --from=HEAD^ pnpm exec commitlint --from=HEAD^
else else
echo "commitlint from ${CI_COMMIT_BEFORE_SHA}" echo "commitlint from ${CI_COMMIT_BEFORE_SHA}"
br=`git branch -r --contains ${CI_COMMIT_BEFORE_SHA}` br=`git branch -r --contains ${CI_COMMIT_BEFORE_SHA}`
if [ ! -n $br ]; if [ ! -n $br ];
then then
pnpx commitlint --from=HEAD^ pnpm exec commitlint --from=HEAD^
else else
pnpx commitlint --from="${CI_COMMIT_BEFORE_SHA}" pnpm exec commitlint --from="${CI_COMMIT_BEFORE_SHA}"
fi fi
fi fi