|
Server : LiteSpeed System : Linux premium152.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64 User : idesfsze ( 1473) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/idesfsze/public_html/wp-content/plugins/op-builder/ |
options:
docker: true
pipelines:
custom:
# Build and push to S3
build-and-push-to-s3:
- variables:
- name: VERSION
default: "0.0.0"
required: true
- step:
image: lpeharda/op-builder-bitbucket-code-build-container:6
name: Build OP Builder and push to S3
script:
# Set plugin version and build manifest
- sed -i "s/0.0.0/$VERSION/g" op-builder.php
- sed -i "s/0.0.0/$VERSION/g" manifest.json
- sed -i "s/COMMIT_HASH/$BITBUCKET_COMMIT/g" manifest.json
- sed -i "s/1970-01-01 00:00:00/$(date +"%Y-%m-%d %H:%M:%S")/g" manifest.json
# Install Node Dependencies & Build Assets
- nvm use
- npm install --only=prod
- ./node_modules/gulp/bin/gulp.js prod
# Archive and Upload to S3
- rm -rf _docs dist node_modules tests resources/bin resources/assets/fonts resources/assets/img resources/assets/sass admin *.md .build .stylelintrc .eslintrc gulpfile.js phpunit.xml.dist auth.json bitbucket-pipelines.yml composer.json composer.lock package.json package-lock.json
- apt-get update && apt-get install -y zip
- mkdir op-builder
- shopt -s extglob
- mv !(op-builder) op-builder
- zip -r op-builder-$VERSION.zip ./*
- mkdir dist
- mv op-builder-$VERSION.zip dist/op-builder-$VERSION.zip
- pipe: atlassian/aws-s3-deploy:1.6.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: "packages.op3/builds/op-builder"
LOCAL_PATH: "dist"
after-script:
- if [[ $BITBUCKET_EXIT_CODE -eq 0 ]]; then curl "$WEBHOOKS_URL/webhooks/bitbucket-pipelines?_token=$WEBHOOKS_TOKEN" -d "product_uid=op-builder&version=$VERSION" ; else echo "Step failed"; fi