Skip to content

Commit

Permalink
Change the WordPress Plugins repository deployment method.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei committed Jun 27, 2019
1 parent 44031ae commit add04d1
Show file tree
Hide file tree
Showing 71 changed files with 779 additions and 334 deletions.
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
81 changes: 15 additions & 66 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,68 +1,17 @@
### Composer and NPM ###
vendor
node_modules

### Windows OS ###
Thumbs.db
desktop.ini

### Other ###
/dist/*
!/dist/.gitkeep
/node_modules
/wordpress
/server
/export
/package-lock.json
/composer.lock
/.idea
.DS_Store
.DS_Store?
*.log
.phpintel

### Prepros ###
prepros.cfg
prepros-6.config

### PhpStorm+iml ###
# Created by https://www.gitignore.io/api/phpstorm+iml
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

### PhpStorm+iml Patch ###
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
/.env
/.ENV
./build

*.iml
modules.xml
.idea/misc.xml
*.ipr
/vendor/
mix-manifest.json
mix.js.map
61 changes: 0 additions & 61 deletions .idea/codeStyleSettings.xml

This file was deleted.

67 changes: 0 additions & 67 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

25 changes: 0 additions & 25 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/php.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/vagrant.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/watcherTasks.xml

This file was deleted.

23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: php
php:
- "7.0"

sudo: true

script:
# Override default Travis script action [phpunit]
- php -l ./src/*.php

branches:
only:
# Enable Travis hook on tags (there is regular expression for semver tag)*
- "/\\d\\.\\d\\.\\d/"

# Enable Travis deployment
deploy:
# Use script as a deployment tool
provider: script
script: sh ./deploy.sh
# Restrict deployment only for tags
on:
tags: true
6 changes: 6 additions & 0 deletions custom.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
file_uploads = On
memory_limit = 1024M
upload_max_filesize = 1024M
post_max_size = 1024M
max_execution_time = 1200
max_input_vars = 2000
29 changes: 29 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

PLUGIN_SLUG="${PWD##*/}"

sed -i -e "s/__STABLE_TAG__/$TRAVIS_TAG/g" ./src/readme.txt
sed -i -e "s/__STABLE_TAG__/$TRAVIS_TAG/g" ./src/${PWD##*/}.php
svn co --depth immediates "https://plugins.svn.wordpress.org/$PLUGIN_SLUG" ./svn

svn update --set-depth infinity ./svn/trunk
svn update --set-depth infinity ./svn/assets
svn update --set-depth infinity ./svn/tags/$TRAVIS_TAG

cp -R ./src/* ./svn/trunk
cp -R ./wp_org/assets/* ./svn/assets

# 3. Switch to SVN repository
cd ./svn

svn add --force trunk
svn add --force assets

svn cp trunk tags/$TRAVIS_TAG

svn add --force tags

svn ci --message "Release $TRAVIS_TAG" \
--username $SVN_USERNAME \
--password $SVN_PASSWORD \
--non-interactive
Loading

0 comments on commit add04d1

Please sign in to comment.