forked from tosdr/Frontpage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
140 lines (127 loc) · 3.45 KB
/
.drone.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
kind: pipeline
name: default
steps:
- name: lint
image: node:buster
volumes:
- name: node_modules
path: /usr/local/lib/node_modules
commands:
- npm install -g stylelint stylelint-config-standard jslint
- npx stylelint "themes/crisp/css/*.css"
- jslint "themes/crisp/js/!(*.min).js"
#- name: clone_phoenix
# image: alpine/git
# volumes:
# - name: phoenix
# path: /phoenix
# commands:
# - git clone https://github.com/tosdr/edit.tosdr.org /phoenix
#- name: install_phoenix
# image: ruby:2.7.2
# volumes:
# - name: bundle
# path: /usr/local/bundle
# - name: phoenix
# path: /phoenix
# environment:
# DATABASE_HOST: postgres
# RAILS_ENV: development
# DATABASE_USER: postgres
# commands:
# - cd /phoenix
# - gem install bundler
# - gem install rails
# - bundle install
# - rails db:create db:migrate db:seed
# - echo 'u = Service.create :id => 1, :name => "Test Service", :url => "example.com", :created_at => "now()", :updated_at => "now()", :slug => "test_slug"' | rails c -e development
- name: create_postgres_db
image: postgres:9-alpine
commands:
- psql -h postgres -U postgres -c "CREATE DATABASE tosdr_dev;"
- name: create_crisp_config
image: alpine
commands:
- echo -e "MYSQL_HOSTNAME=postgres\n" > .env
- echo -e "MYSQL_USERNAME=postgres\n" >> .env
- echo -e "MYSQL_PASSWORD=postgres\n" >> .env
- echo -e "MYSQL_DATABASE=tosdr_dev\n" >> .env
- echo -e "REDIS_HOST=redis\n" >> .env
- echo -e "REDIS_PORT=6379\n" >> .env
- name: migrate_crisp_lint
image: php:7.4-buster
environment:
COMPOSER_ALLOW_SUPERUSER: 1
commands:
- mkdir /tmp/ci
- cd /tmp/ci
- apt-get update && apt-get install -y libpq-dev autoconf gcc libc6-dev make libicu-dev wget git-core zip
- pecl install redis-5.3.2
- docker-php-ext-install pgsql pdo_pgsql pdo_mysql intl
- docker-php-ext-enable pdo_pgsql pdo_mysql redis intl
- wget https://getcomposer.org/composer-stable.phar -O /tmp/ci/composer
- cd /drone/src
- php /tmp/ci/composer install
- php bin/cli.php migrate
- php bin/cli.php theme install crisp
- vendor/bin/twig-linter lint themes/crisp/templates/
# - vendor/bin/phpunit tests --bootstrap pixelcatproductions/crisp.php
- rm /tmp/ci/composer
- name: Zip Production
image: node:alpine
commands:
- apk --no-cache add zip bash
- mkdir dist
- zip -r dist/build.zip ./ -x '*.git*' -x 'pixelcatproductions/cache' -x '.env' -x 'static' -x '.vscode' -x 'dist' -x 'nbproject'
when:
branch:
- master
event:
- push
- name: Upload Build Artifacts
image: plugins/s3
settings:
bucket: tosdr-artifacts
source: ./dist/*
strip_prefix: true
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
target: /CrispCMS/builds/${DRONE_BUILD_NUMBER}
endpoint: https://s3.eu-west-2.jbcdn.net
when:
branch:
- master
event:
- push
#- name: docker
# image: plugins/docker
# settings:
# username:
# from_secret: DOCKER_USERNAME
# password:
# from_secret: DOCKER_TOKEN
# repo: jbackpcat/tosdr-crisp
# tags: latest
# when:
# event:
# exclude:
# - pull_request
# - tag
volumes:
- name: bundle
temp: {}
- name: phoenix
temp: {}
- name: node_modules
temp: {}
services:
- name: redis
image: redis
- name: postgres
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_HOST_AUTH_METHOD: trust