-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathaction.yml
More file actions
34 lines (34 loc) · 1.57 KB
/
action.yml
File metadata and controls
34 lines (34 loc) · 1.57 KB
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
name: "Setup CouchDB"
description: "Set up a CouchDB database as a single node."
author: "Alexander Lang"
branding:
icon: "database"
color: "red"
inputs:
# See https://hub.docker.com/_/couchdb for supported versions
# and further details on input environment variables
couchdb-version:
description: "Version of CouchDB to use."
required: false
default: "latest"
runs:
using: "composite"
steps:
- name: Set up CouchDB
env:
INPUT_COUCHDB_VERSION: ${{ inputs.couchdb-version }}
GITHUB_ACTION_PATH: ${{ github.action_path }}
run: |
sed -i "s/COUCHDB_VERSION/$INPUT_COUCHDB_VERSION/" $GITHUB_ACTION_PATH/Dockerfile.couchdb
docker build --tag custom-couchdb -f $GITHUB_ACTION_PATH/Dockerfile.couchdb $GITHUB_ACTION_PATH
docker run -d -p 5984:5984 -p 5986:5986 --tmpfs /ram_disk:uid=5984,gid=5984,mode=770 custom-couchdb
shell: bash
- name: Wait for CouchDB to be ready
run: $GITHUB_ACTION_PATH/wait-for-couchdb.sh
shell: bash
- name: Set up CouchDB system databases
run: |
curl -sS 'http://admin:admin@127.0.0.1:5984/_users' -X PUT -H 'Content-Type: application/json' --data '{"id":"_users","name":"_users"}' > /dev/null
curl -sS 'http://admin:admin@127.0.0.1:5984/_global_changes' -X PUT -H 'Content-Type: application/json' --data '{"id":"_global_changes","name":"_global_changes"}' > /dev/null
curl -sS 'http://admin:admin@127.0.0.1:5984/_replicator' -X PUT -H 'Content-Type: application/json' --data '{"id":"_replicator","name":"_replicator"}' > /dev/null
shell: bash