-
Notifications
You must be signed in to change notification settings - Fork 9
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
Setup for Netlify deployments #20
Conversation
d9b34f1
to
93264b2
Compare
* Remove docker-compose.yml * Remove pip, docker, unzip, ntp, and python-security Ansible roles * Add azavea.nodejs and azavea.yarn Ansible roles * Update STRTA to execute in the context of the dev VM * Update Vagrantfile to use ansible_local and rsync for livereload * Remove Nginx and restructure project files since this will be deployed on Netlify
e731453
to
13f367c
Compare
Going to set this up locally to check the impact of the dev environment changes. |
@@ -1,14 +1,5 @@ | |||
- src: azavea.pip | |||
version: 1.0.0 | |||
- src: azavea.nodejs |
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.
Out of curiosity, how frequently will this nodejs version change major versions?
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.
Does this help? https://github.com/nodejs/Release
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.
Oh -- I meant the azavea.nodejs role but it may be that there's no difference. Will the way this is set up also jump between LTS and non-LTS versions?
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.
We feed the NodeJS version in deployment/ansible/group_vars/all
and the azavea.nodejs
role installs whatever we specify. It's like a smart robot that can just pull whatever NodeJS version we ask of it.
Versioning for the role itself is just stuff like bug fixes and updating where to look for packages.
See: https://github.com/azavea/ansible-nodejs/blob/develop/CHANGELOG.md
I'm seeing this error locally when trying to run
Checking into it. |
Another q mostly for my curiosity: Is there a deployment-related reason to prefer keeping this project in Vagrant + Ansible rather than dropping the VM altogether and building it directly using It seems like that's what Netlify might do by default, according to a specified Node.js version. |
|
I was able to get the
However, I noticed the files in the Vagrant VM aren't syncing with edits I make on host. I made the changes above in my host editor first but they weren't reflected in the VM, so I had to also make the edits in the VM to get things to work. I'm not sure the dir path used above is correct, but it doesn't seems like these files exactly match either:
|
There isn't a deployment-related reason. But, for example, I don't have NodeJS installed on my laptop. I do all my work in the context of a development VM. This way, I know I will always be using the correct version of a dependency, I won't need to worry about managing dependencies, and I know that any reason the build fails won't be due to the environment. My laptop stays squeaky clean.
I'm not sure what they're doing behind the scenes to install NodeJS and Yarn, but you can set the I am updating the PR with more information on this, and pushing another commit up. See: https://www.netlify.com/docs/build-settings/
Yeah, I tested |
I modified $ vagrant rsync-auto |
Sounds good to me!
Should we add this to the |
Looks like Netlify deploys are working now! https://deploy-preview-20--idb-osm-extraction-tool.netlify.com/ I can't get the Could we drop the |
Running
Yes. That was preemptive on my part, because I saw that we used |
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.
LGTM. Netlify build is working and cibuild
and server
both work as expected locally!
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.
I was able to get the STRTAs to work locally and my local code changes were reflected inside the VM. 👍
scripts/lint
Outdated
-f docker-compose.yml \ | ||
run --rm --entrypoint ./node_modules/.bin/eslint \ | ||
app js/src/ --ext .js --ext .jsx | ||
./node_modules/.bin/eslint \ |
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.
It might be good to trap this as a package.json
script called lint
so that we can just use yarn run lint
.
exit 1 | ||
fi | ||
} | ||
#yarn run test |
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.
We should make an issue to add tests. In the past, we've commented out test execution in a STRTA and it went on to silently pass without executing tests for months.
e030db1
to
e82599a
Compare
I just found out that Netlify doesn't support |
Are you seeing anything when you navigate to https://idb-osm-extraction-tool.netlify.com/? That is the reported URL, but I'm getting a page not found error. |
That is the URL for See: https://www.netlify.com/docs/continuous-deployment/#branches-deploys |
Overview
Cursory Netlify TOML config file definition.
The repo was setup under the
Azavea Ops
Netlify user in theShared-Azavea Ops
LastPass folder.Resolves #11
Notes
The only "gotcha" I ran into was getting Netlify to install Yarn. Netlify looks for a
yarn.lock
file to determine if it should install Yarn. I had the project base directory set as.
, and I had to change it to./src
, and then update the other paths to behave relative to./src
.Netlify doesn't have
shellcheck
installed.Also, I feel like Netlify's documentation leaves a lot in the air and is unfinished.
See: https://www.netlify.com/docs/build-gotchas/#yarn
Testing
See Netlify deploy log: https://app.netlify.com/sites/idb-osm-extraction-tool/deploys/5b5613713813f05b6d20e520
Visit: https://5b5613713813f05b6d20e520--idb-osm-extraction-tool.netlify.com