-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
11,337 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,40 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
uses: "./.github/workflows/test.yml" | ||
|
||
deploy: | ||
needs: [ test ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get target server hostname | ||
id: get_hostname | ||
uses: mikefarah/yq@master | ||
with: | ||
cmd: yq '.all.hosts.* | key' deployment/inventory.yml | ||
- name: Get target server fingerprint | ||
id: get_fingerprint | ||
uses: mikefarah/yq@master | ||
with: | ||
repository: ambanum/OpenTermsArchive | ||
- name: Install SSH key | ||
cmd: yq '.all.hosts.*.ed25519_fingerprint' deployment/inventory.yml | ||
- name: Set up SSH | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SERVER_SSH_KEY }} | ||
known_hosts: ${{ secrets.SERVER_FINGERPRINT }} | ||
- run: echo "${{ secrets.ANSIBLE_VAULT_KEY }}" > vault.key | ||
known_hosts: ${{ steps.get_hostname.outputs.result }} ssh-ed25519 ${{ steps.get_fingerprint.outputs.result }} | ||
- run: echo "${{ secrets.ANSIBLE_VAULT_KEY }}" > deployment/vault.key | ||
- run: pip install --upgrade setuptools | ||
- run: pip install 'ansible ~= 2.9' | ||
- run: ansible-playbook ops/app.yml --inventory ops/inventories/production.yml --tags update-declarations --limit france_elections | ||
- name: Install dependencies | ||
working-directory: ./deployment | ||
run: ansible-galaxy collection install -p ./ -r requirements.yml --force | ||
- name: Deploy | ||
working-directory: ./deployment | ||
run: ansible-playbook ./ansible_collections/opentermsarchive/deployment/playbooks/deploy.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.DS_Store | ||
node_modules | ||
package-lock.json | ||
data | ||
vault.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"@opentermsarchive/engine": { | ||
"recorder": { | ||
"versions": { | ||
"storage": { | ||
"git": { | ||
"snapshotIdentiferTemplate": "https://github.com/OpenTermsArchive/france-elections-snapshots/commit/%SNAPSHOT_ID", | ||
"repository": "git@github.com:OpenTermsArchive/france-elections-versions.git", | ||
"path": "./data/versions" | ||
} | ||
} | ||
}, | ||
"snapshots": { | ||
"storage": { | ||
"git": { | ||
"repository": "git@github.com:OpenTermsArchive/france-elections-snapshots.git", | ||
"path": "./data/snapshots" | ||
} | ||
} | ||
} | ||
}, | ||
"fetcher": { | ||
"language": "en" | ||
}, | ||
"notifier": { | ||
"sendInBlue": { | ||
"updatesListId": 861, | ||
"updateTemplateId": 56 | ||
} | ||
}, | ||
"logger": { | ||
"timestampPrefix": false | ||
}, | ||
"tracker": { | ||
"githubIssues": { | ||
"repository": "OpenTermsArchive/france-elections-declarations" | ||
} | ||
}, | ||
"dataset": { | ||
"title": "france-elections", | ||
"versionsRepositoryURL": "https://github.com/OpenTermsArchive/france-elections-versions" | ||
}, | ||
"collection-api": { | ||
"port": 3000, | ||
"basePath": "/collection-api" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$ANSIBLE_VAULT;1.1;AES256 | ||
66663831663730303932353632313863636434656336333733353233323430346337333161313037 | ||
6165383434373636643634303965653835353233313562320a363566616665666362383930356662 | ||
34663639626539666334626161306137346462656434333561356433393834623965633165636635 | ||
6632316332313031360a366465633935323033663930303431363936656139643837386164646332 | ||
32613236303930633732303239653138623266333937346634383230643161393861616664373038 | ||
36666238646363616232643666343162376163623638613133616635623633613233643037393962 | ||
36306230393563653165613364656636653132326237363434363663376263316266626132313761 | ||
30643531616631333331623638343636613465666663623239646564366262333833663132616435 | ||
34383964326638306461653662346630326134653638663036656462383636373264613235616261 | ||
3130643938393738623465373434336331636161646662623164 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ansible.cfg | ||
[defaults] | ||
roles_path = ./ansible_collections/opentermsarchive/deployment/roles | ||
inventory = inventory.yml | ||
|
||
# The two following lines allow to have human readable output | ||
# Use the YAML callback plugin. | ||
stdout_callback = yaml | ||
# Use the stdout_callback when running ad-hoc commands. | ||
bin_ansible_callbacks = true | ||
|
||
vault_password_file = vault.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
all: | ||
hosts: | ||
51.89.225.198: | ||
ansible_user: debian | ||
ed25519_fingerprint: AAAAC3NzaC1lZDI1NTE5AAAAIKKjqn0w980q4yeqogV0p06MQavEw7fzPR6rplT3kiLj | ||
ota_source_repository: https://github.com/OpenTermsArchive/france-elections-declarations.git | ||
ota_source_repository_branch: deploy-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
apps: [ | ||
{ | ||
name: 'ota-collection-api', | ||
script: 'npm', | ||
args: 'run start:collection-api', | ||
min_uptime: '10s', | ||
max_restarts: 10, | ||
restart_delay: 1000, | ||
exponential_backoff_restart_delay: true, | ||
log_date_format: "YYYY-MM-DDTHH:mm:ssZ" | ||
} | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
collections: | ||
- name: opentermsarchive.deployment | ||
version: 2.0.2 |
Oops, something went wrong.