forked from michaelborn/sqlFormatter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
149 lines (135 loc) · 5.25 KB
/
.travis.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
language: java
notifications:
slack:
secure: FIHlTn/YO7Wgumm1uIqmoEsqjQA7fV0AE94Rjc5yKzM3AquQa8HicgDVVk0d2GrKRnl0xt3j4ZJV//VJyIjlCd/QVKuj48R2ChjEY2im3+99HFPafCUI5/S2uyowKU6mJTFonH9v6p41eqxdbiAxJdDGOT0V2Gpt3UBSNuHz8ED9/aIHqv+P7M+VD6Xd2XYwctPniWlaSWx57sWcnG/VkFG45qFQAyha64uxOOe4M3ZmG/n5FfauZ8cBVLiRKEIr+CyNhh1ujfzi7+4uzMlSNL5t/BbZamAQuZzqGzGQ9RVvIlyPgUGNJtDEE/hWS09aagXF5T6EMj00szizErh4J1/x4qZwml5+TcBN31E0QmAhCtZe85sr3tYgic+hEz9XX1yymQzf/C7n4to2yNvq0r4g51xDk8IuP95WEh7zaqLlvFZvBFgxpHZBMYlRvhytjOYDeIFRMcGwHZcXosaG2ejqDwcGq/LC4oeG4sSwmg9sdRrtcmcanrNqrBka86WYO6LntI3JdZ86/1ACEUHzhCCwvrKELc9Ji1xxGAgS7QKH+s2/hnJuiMyv73gOVLKYC+wPMLt+fvOmPLSEl+PJiAIlToBq1KUBg03RSQLfPOLD7OrJ8VvDZsEPwejqlGDyc4wRglS9OTi7SnN5LYHSDNDdGdREegWqq9qDHEYEVLI=
env:
# Fill out these global variables for build process
global:
- MODULE_ID=sqlFormatter
matrix:
- ENGINE=lucee@5
- ENGINE=adobe@2016
- ENGINE=adobe@2018
branches:
only:
- development
- master
sudo: required
dist: focal
# Uncomment if you need db services
#services:
# - mysql
before_install:
# CommandBox Keys
- curl -fsSl https://downloads.ortussolutions.com/debs/gpg | sudo apt-key add -
- sudo echo "deb https://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a
/etc/apt/sources.list.d/commandbox.list
install:
# Install Commandbox
- sudo apt-get update && sudo apt-get --assume-yes install jq commandbox
# Install CommandBox Supporting Librarires
- box install commandbox-cfconfig,commandbox-dotenv,commandbox-docbox
# If using auto-publish, you will need to provide your API token with this line:
- box config set endpoints.forgebox.APIToken=$FORGEBOX_API_TOKEN > /dev/null
# Uncomment if you need db services
#before_script:
# # create database
# - mysql -u root -e 'create database coolblog;'
# # import database
# - mysql -u root < $TRAVIS_BUILD_DIR/test-harness/tests/resources/coolblog.sql
# - echo "Database created and loaded with test data"
# # Seed .env
# - echo "Seeding database .env file at /test-harness/.env"
# - touch test-harness/.env
# # ENV
# - printf "DB_HOST=localhost\n" >> test-harness/.env
# - printf "DB_USER=root\n" >> test-harness/.env
# - printf "DB_PASSWORD=\n" >> test-harness/.env
# - printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> test-harness/.env
# - printf "DB_BUNDLEVERSION=8.0.19\n" >> test-harness/.env
# - printf "DB_BUNDLENAME=com.mysql.cj\n" >> test-harness/.env
script:
# Set Current Version and Travis Tag
- TARGET_VERSION=`cat $TRAVIS_BUILD_DIR/box.json | jq '.version' -r`
- TRAVIS_TAG=${TARGET_VERSION}
- echo "Starting build for ${MODULE_ID} v${TARGET_VERSION}"
# Replace version so builder can issue it
- box package set [email protected]@[email protected]@
# Startup the harness
- cd test-harness
# run our dependency install to ensure the workbench is in place
- box install
# run our matrix server
- box server start serverConfigFile="server-${ENGINE}.json"
# Startup the app
#- curl http://localhost:60299
# Debugging of tests
#- curl http://localhost:60299/tests/runner.cfm?reporter=json -o testresults.json && cat testresults.json
# move back to build dir to build it
- cd $TRAVIS_BUILD_DIR
# Build Project
- box task run taskfile=build/Build target=run :version=${TARGET_VERSION} :projectName=${MODULE_ID} :buildID=${TRAVIS_BUILD_NUMBER} :branch=${TRAVIS_BRANCH}
# Cat results for debugging
#- cat build/results.json
after_failure:
# Cat out test results if they fail
#- cat build/results.json
- cd $TRAVIS_BUILD_DIR/test-harness
# Display the contents of our root directory
# Spit out our Commandbox log in case we need to debug
- box server log server-${ENGINE}.json
- cat `box system-log`
deploy:
# Module Deployment
- provider: s3
on:
branch:
- master
- development
condition: "$ENGINE = lucee@5"
skip_cleanup: true
#AWS Credentials need to be set in Travis
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_ACCESS_SECRET
# Destination
bucket: "downloads.ortussolutions.com"
local-dir: $TRAVIS_BUILD_DIR/.artifacts/$MODULE_ID
upload-dir: ortussolutions/coldbox-modules/$MODULE_ID
acl: public_read
# API Docs Deployment
- provider: s3
on:
branch:
- master
- development
condition: "$ENGINE = lucee@5"
skip_cleanup: true
#AWS Credentials need to be set in Travis
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_ACCESS_SECRET
bucket: "apidocs.ortussolutions.com"
local-dir: $TRAVIS_BUILD_DIR/.tmp/apidocs
upload-dir: coldbox-modules/$MODULE_ID/$TARGET_VERSION
acl: public_read
# Github Release only on Master
- provider: releases
api_key: ${GITHUB_TOKEN}
on:
branch:
- master
condition: "$ENGINE = lucee@5"
skip_cleanup: true
edge: true
file_glob: true
file: $TRAVIS_BUILD_DIR/.artifacts/$MODULE_ID/**/*
release_notes_file: $TRAVIS_BUILD_DIR/changelog-latest.md
name: v${TRAVIS_TAG}
tag_name: v${TRAVIS_TAG}
overwrite: true
# Once API Docs and Binaries are deployed to S3 Publish to ForgeBox
after_deploy:
# Move to build out artifact
- cd ${TRAVIS_BUILD_DIR}/.tmp/${MODULE_ID}
- cat box.json
# Only publish once using the lucee matrix
- if [ ${ENGINE} = 'lucee@5' ]; then box forgebox publish; fi