mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-09 11:58:33 +03:00
Compare commits
1 Commits
feature/ve
...
v0.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9eb6ea6e2 |
19
.github/workflows/cd.yml
vendored
19
.github/workflows/cd.yml
vendored
@@ -1,19 +0,0 @@
|
||||
name: CD
|
||||
on:
|
||||
push:
|
||||
branches: [ develop ]
|
||||
# pull_request:
|
||||
# branches: [ develop ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger CD build
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.CI_DISPATCH_TOKEN }}
|
||||
repository: forensic-architecture/configs
|
||||
event-type: remote-build
|
||||
client-payload: '{"runtime_args": "datasheet", "branch": "${GITHUB_REF##*/}"}'
|
||||
|
||||
25
.github/workflows/ci.yml
vendored
25
.github/workflows/ci.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches: [ develop ]
|
||||
pull_request:
|
||||
branches: [ develop ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- uses: actions/setup-node@v2-beta
|
||||
with:
|
||||
node-version: '12'
|
||||
|
||||
- run: npm install
|
||||
- run: npm test
|
||||
env:
|
||||
CI: true
|
||||
- run: npm run lint
|
||||
env:
|
||||
CI: true
|
||||
14
.travis.yml
Normal file
14
.travis.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- stable
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
before_script:
|
||||
- npm install -g yarn
|
||||
install:
|
||||
- yarn
|
||||
script:
|
||||
- yarn build
|
||||
- yarn lint
|
||||
- yarn test
|
||||
@@ -13,8 +13,8 @@ RUN yarn build
|
||||
RUN mkdir -p data
|
||||
|
||||
# set your port
|
||||
ENV PORT 4040
|
||||
EXPOSE 4040
|
||||
ENV PORT 8080
|
||||
EXPOSE 8080
|
||||
|
||||
# start command as per package.json
|
||||
CMD ["yarn", "start"]
|
||||
|
||||
Binary file not shown.
11
scripts/check-branch.sh
Executable file
11
scripts/check-branch.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
ENCRYPT_MESSAGE="\nThe .env.enc file has not changed its contents from the version on origin/develop.\nTo ensure that tests pass in Travis, you need to encrypt the contents of .env before pushing to the remote, so that the Travis server can use your service account credentials.\nEnsure that the Travis CLI is installed on your local, run\n\n\tnpm run travis-encrypt\n\nand then push to the remote again.\nIf you don't care whether your build passes on Travis, you can run:\n\n\tgit push --no-verify\n\nand bypass this check.\n\n"
|
||||
|
||||
# check whether .env.enc has changed
|
||||
if [ -z "`git diff origin/develop -- .env.enc`" ]; then
|
||||
echo $ENCRYPT_MESSAGE
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
38
scripts/encrypt.sh
Executable file
38
scripts/encrypt.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
echo "Encrypting .env file for Travis..."
|
||||
|
||||
# confirm that the user has the core repo as origin, and is therefore a maintainer
|
||||
# if [ -z `git config --get remote.origin.url | grep "forensic-architecture/datasheet-server"` ]; then
|
||||
# echo "Travis encryption not required for satellite contributors, continuing.."
|
||||
# exit 0
|
||||
# fi
|
||||
|
||||
# confirm travis is installed
|
||||
if [ ! hash travis 2>/dev/null ]; then
|
||||
echo "============================================================================================"
|
||||
echo "ERROR: Travis CLI is not installed on your local. Please install from:"
|
||||
echo "\thttps://github.com/travis-ci/travis.rb"
|
||||
echo "After installing, make sure that you login with:"
|
||||
echo "\ttravis login --pro"
|
||||
echo "============================================================================================"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# confirm there is a .env file to encrypt
|
||||
if [ ! -f .env ]; then
|
||||
echo "============================================================================================"
|
||||
echo "ERROR: You must create a .env file and add your credentials. See .env.example for an example"
|
||||
echo "============================================================================================"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# regex to match and delete 'before_install' and everything after it
|
||||
# necessary to delete these lines to get Travis to build for multiple accounts
|
||||
echo "creating new .travis.yml configuration"
|
||||
sed -i.old '/^before_install.*/,$ d' .travis.yml
|
||||
echo "old config file saved as .travis.yml.old"
|
||||
|
||||
travis encrypt-file .env --add --force --org
|
||||
git add .env.enc
|
||||
git add .travis.yml
|
||||
echo ".env.enc created and added to commit"
|
||||
@@ -63,7 +63,10 @@ export default (data) => {
|
||||
structure.__flat.forEach(label => {
|
||||
deepRow[label] = baseRow[label]
|
||||
})
|
||||
if (!Object.keys(deepRow).every(k => deepRow[k] === '')) {
|
||||
if (!Object.keys(deepRow).every(k => (
|
||||
(deepRow[k] === '') ||
|
||||
(Array.isArray(deepRow[k]) && deepRow[k].length === 0)
|
||||
))) {
|
||||
output.push(deepRow)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -6,7 +6,6 @@ function prefixedTabs (prefix, cfg) {
|
||||
return {
|
||||
[`${prf('events')}export_events`]: BP.deeprows,
|
||||
[`${prf('associations')}export_associations`]: BP.deeprows,
|
||||
[`${prf('editorials')}export_editorials`]: BP.deeprows,
|
||||
[`${prf('sources')}export_sources`]: BP.deepids,
|
||||
[`${prf('sites')}export_sites`]: BP.rows
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ test('should launch', t => {
|
||||
})
|
||||
|
||||
const passUrls = [
|
||||
'/api/'
|
||||
'/api/',
|
||||
]
|
||||
|
||||
const failUrls = [
|
||||
|
||||
Reference in New Issue
Block a user