-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade vagrant environment #492
Changes from all commits
7afa977
45672d8
2897a22
f63a664
43d4019
4f20861
5be4dd6
ec00840
2d88562
30cd4f1
4f9dfb9
ca13a13
315030e
2c1c215
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,11 @@ PGUSER=atr | |
PGPASSWORD=atr | ||
PGHOST=localhost | ||
PGPORT=5432 | ||
ENVIRONMENT=dev | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @evmiguel I see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @howard-e Good catch! Since the vagrant environment mirrors production, it's technically not using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would be the consequence of leaving that variable unchanged? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jugglinmike The app would look for the server side rendering files for the embed feature in a different directory. |
||
ENVIRONMENT=vagrant | ||
ALLOW_FAKE_ROLE=true | ||
IMPORT_CONFIG=/home/aria-bot/config.env | ||
GITHUB_OAUTH_SERVER=https://github.com | ||
GITHUB_GRAPHQL_SERVER=https://api.github.com | ||
GITHUB_CLIENT_ID=7190d52e3c3ef8e48e70 | ||
GITHUB_CLIENT_SECRET=a5eebe76bdaaf126e34a9b5a5a9686cf1cdbb71f | ||
GITHUB_TEAM_ORGANIZATION=w3c | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,13 +28,6 @@ | |
when: deployment_mode != 'development' | ||
notify: "restart server" | ||
|
||
- name: Make vagrant folder writable | ||
file: | ||
path: /vagrant/server/scripts | ||
mode: '0777' | ||
recurse: yes | ||
when: deployment_mode == 'development' | ||
|
||
- name: Link application code | ||
file: | ||
dest: '{{source_dir}}' | ||
|
@@ -66,12 +59,12 @@ | |
ansible_ssh_pipelining: yes | ||
|
||
- name: Migrate database | ||
shell: DOTENV_CONFIG_PATH={{environment_config.dest}} node -r ./node_modules/dotenv/config $(npm bin)/sequelize-cli db:migrate --config ./config/config.js --migrations-path ./server/migrations/ | ||
shell: DOTENV_CONFIG_PATH={{environment_config.dest}} node -r ./node_modules/dotenv/config ./node_modules/.bin/sequelize-cli db:migrate --config ./config/config.js --migrations-path ./server/migrations/ | ||
args: | ||
chdir: '{{source_dir}}' | ||
|
||
- name: Seed database | ||
shell: DOTENV_CONFIG_PATH={{environment_config.dest}} node -r ./node_modules/dotenv/config $(npm bin)/sequelize-cli db:seed:all --config ./config/config.js --seeders-path ./server/seeders/ | ||
shell: DOTENV_CONFIG_PATH={{environment_config.dest}} node -r ./node_modules/dotenv/config ./node_modules/.bin/sequelize-cli db:seed:all --config ./config/config.js --seeders-path ./server/seeders/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to other reviewers: npm recently removed this subcommand. |
||
args: | ||
chdir: '{{source_dir}}' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
- https://dl.yarnpkg.com/debian/pubkey.gpg | ||
- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | ||
|
||
- include: upgrade.yml | ||
|
||
- name: Add software repositories | ||
apt_repository: | ||
state: present | ||
|
@@ -16,7 +18,7 @@ | |
become: yes | ||
with_items: | ||
- deb https://dl.yarnpkg.com/debian/ stable main | ||
- deb https://deb.nodesource.com/node_14.x buster main | ||
- deb https://deb.nodesource.com/node_18.x buster main | ||
|
||
- name: Install packages | ||
apt: | ||
|
@@ -25,3 +27,10 @@ | |
- yarn | ||
state: present | ||
become: yes | ||
|
||
- name: Check if Node exists | ||
command: node --version | ||
register: new_node_version | ||
|
||
- name: Show status of nodejs installation | ||
debug: msg="{{ new_node_version.stdout }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's safe to trust apt to tell us if the installation failed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted this debug message for us to compare the version in the |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- name: Check if Node exists | ||
shell: | | ||
if ! node --version; then | ||
echo "Node.js is not installed" | ||
fi | ||
register: node_version | ||
ignore_errors: true | ||
|
||
- name: Show status of nodejs installation | ||
debug: msg="{{ node_version.stdout }}" | ||
|
||
- name: Remove Node.js repo if not version 18 | ||
apt_repository: | ||
state: absent | ||
repo: deb https://deb.nodesource.com/node_14.x buster main | ||
update_cache: True | ||
become: yes | ||
when: '"18" not in node_version.stdout' | ||
|
||
- name: Remove Node.js if not version 18 | ||
apt: | ||
name: nodejs | ||
state: absent | ||
become: yes | ||
when: '"18" not in node_version.stdout' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jugglinmike This is a naive world writable solution for the rsync options on the server folder. I know it's not setting the ownership on
aria-bot
, as suggested, but it does circumvent a Vagrant error on rsync whenaria-bot
isn't created on first provision. Given the time constraints, could we push this or something like this forward so that we can get the upgrade in place before the sprint ends?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jugglinmike I can also confirm that with this change, I am no longer running into permissions issues.