Created
February 11, 2020 12:22
-
-
Save fabdbt/f620a5eeca0942518e5d2347f8300cca to your computer and use it in GitHub Desktop.
GitLab CI - ZIP Wordpress plugin and upload it to AWS S3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DO NOT FORGET TO SET YOUR ENVIRONMENT VARIABLES : AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | |
# ZIP stage is using shell runner (quick start), UPLOAD stage is using docker runner | |
# Usage on Wordpress : wp plugin install [S3_PATH]/xxx.zip --activate --force (update) | |
stages: | |
- zip | |
- upload | |
zip_plugin: | |
stage: zip | |
only: | |
- master | |
script: | |
- mkdir -p ./dist | |
- zip -r dist/xxx.zip xxx | |
artifacts: | |
expire_in: 1 week | |
paths: | |
- dist | |
deploy_aws: | |
image: python:alpine3.11 | |
stage: upload | |
only: | |
- master | |
before_script: | |
- pip install awscli | |
script: | |
- aws s3 cp dist/xxx.zip s3://[BUCKET]/[PATH]/ --acl public-read | |
tags: | |
- docker-build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment