This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
wercker.yml
79 lines (68 loc) · 3.14 KB
/
wercker.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
box:
id: php
build:
steps:
- script:
name: Globals
code: |
export ARTIFACT_NAME="wobble"
- script:
name: Validate PHP files
code: |
find . -name '*.php' | xargs -I{} php -l {}
- install-packages:
packages: git unzip jq
- script:
name: install composer
code: curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
- script:
name: install dependencies
code: |-
composer install --no-interaction
- script:
name: copy files to pkg/
code: |
mkdir -p $WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}
cp -r bin docs etc shared web WobbleApi \
composer.json composer.lock \
vendor/ \
$WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}/
echo "Branch: $WERCKER_GIT_BRANCH" > $WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}/INFO
echo "Commit: $WERCKER_GIT_COMMIT" >> $WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}/INFO
echo "CI: $CI" >> $WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}/INFO
echo "WerckerStartedBy: $WERCKER_STARTED_BY" >> $WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}/INFO
echo "WerckerApplicationUrl: $WERCKER_APPLICATION_URL" >> $WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}/INFO
echo "WerckerBuildUrl: $WERCKER_BUILD_URL" >> $WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}/INFO
debug "$(cat $WERCKER_OUTPUT_DIR/pkg/${ARTIFACT_NAME}/INFO)"
- yudai/[email protected]:
input: $WERCKER_OUTPUT_DIR/pkg
output: $WERCKER_OUTPUT_DIR/dist
- script:
name: show hash sums
code: |
info "$(cat $WERCKER_OUTPUT_DIR/dist/SHASUMS)"
setMessage "SHA1: $(cat $WERCKER_OUTPUT_DIR/dist/SHASUMS)"
- zeisss/[email protected]:
url: $FS_ENDPOINT
file: $WERCKER_OUTPUT_DIR/dist/${ARTIFACT_NAME}.tar.gz
path: /artifacts/${ARTIFACT_NAME}/${WERCKER_GIT_BRANCH}-${WERCKER_GIT_COMMIT}/${ARTIFACT_NAME}.tar.gz
username: $FS_USER
password: $FS_PASSWORD
acl: public-read
deploy:
steps:
- script:
name: Deploy artifact
code: |
site_name=${DEPLOY_SITE_NAME:-ARTIFACT_NAME}
desired_version="${WERCKER_GIT_BRANCH}-${WERCKER_GIT_COMMIT}"
test -z "$DEPLOY_TOKEN" && fail "Env DEPLOY_TOKEN missing."
deployResult=$(curl -H"Authorization: bearer ${DEPLOY_TOKEN}" "${DEPLOY_ENDPOINT}" --data-urlencode "site=${site_name}" --data-urlencode "desired_version=${desired_version}" --output $WERCKER_REPORT_ARTIFACTS_DIR/deploy.json -w '%{http_code}')
if [ "$deployResult" -eq 200 ]; then
success "Deploy completed."
else
fail "$(cat $WERCKER_REPORT_ARTIFACTS_DIR/deploy.json)"
fi
after-steps:
- wercker/slack-notifier:
url: $DEPLOY_SLACK_URL