forked from a-z-listing/a-z-listing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
35 lines (31 loc) · 1.4 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
include:
- template: Code-Quality.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/License-Scanning.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
- project: a-z-listing/ci-config
file: /build-and-test.yml
- project: a-z-listing/ci-config
file: /release-WordPress.org.yml
stages:
- build
- test
- release
update-docs-on-release:
stage: release
image: registry.gitlab.com/a-z-listing/ci-config/php:7.4
only:
- tags
before_script:
- mkdir -p $HOME/.ssh && cp known_hosts $HOME/.ssh/ && touch $HOME/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa && echo "$SSH_PRIVATE_KEY" > $HOME/.ssh/id_rsa
script: |
POSTS_TO_DELETE=$(wp --ssh=$SSH_USERNAME@$SSH_HOST:$SITE_DIRECTORY post list \
--post_type=wp-parser-function,wp-parser-method,wp-parser-class,wp-parser-hook \
--format=ids)
wp --ssh=$SSH_USERNAME@$SSH_HOST:$SITE_DIRECTORY post delete $POSTS_TO_DELETE
for tax in wp-parser-source-file wp-parser-source-file wp-parser-since wp-parser-since; do
TERMS_TO_DELETE=$(wp --ssh=$SSH_USERNAME@$SSH_HOST:$SITE_DIRECTORY term list $tax --format=ids)
wp --ssh=$SSH_USERNAME@$SSH_HOST:$SITE_DIRECTORY term delete $tax $TERMS_TO_DELETE
done
wp --ssh=$SSH_USERNAME@$SSH_HOST:$SITE_DIRECTORY parser create wp-content/plugins/a-z-listing --user=diddledani