This is a build guide to help walk you through setting up a new Next.js project.
- Tiged -
npm install -g tiged
- DDev
- Docker & Docker Compose/Docker Desktop
- Clone this repository using Tiged/Degit.
degit --mode=git [email protected]:forumone/nextjs-project.git [project-name]
Note: If you have an issue with that command try without the --mode=git
option
- Initialize the new project as a Git repository.
cd [project-name]
git init
- Add the git remote for the new repository.
git remote add origin [email protected]:forumone/[project-name].git
- Update configuration in the
./.ddev/config.yaml
. Updatename: nextjs-project
to the correct project name.
If you are setting up a headless Drupal project, continue with the setup steps in /starterkits/drupal/README.md.
Please remove:
./.storybook
- In the
./package.json
, remove... "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" ...
- Uninstall the storybook related packages as well in
package.json
- Run
npm i --package-lock-only
Please delete: ./github
folder.
- In the
.buildkite
, please delete... - seek-oss/aws-sm#v2.0.0: file: - path: .env secret-id: [NEED THIS CONFIGURED] ...
- Rename
./buildkite/pipeline-base.yaml
>.buildkite/pipeline.yaml
- Please put a
halp
request in to get asecrets manager
setup for the project. (This may change in the future) - Will need to provide what
.env
are needed to put into secrets manager. - In the
.buildkite/pipeline-base.yml
> will need to update:[NEED THIS CONFIGURED]
tobe updated.- Please reference: https://github.com/forumone/NYU-CDHDB/blob/main/.buildkite/pipeline-base.yml#L49
- That reference is referring to: https://github.com/forumone/NYU-CDHDB/blob/main/.buildkite/pipeline.yml#L7
Configuring Capistrano deployments requires editing of the following files:
capistrano/deploy.rb
capistrano/deploy/dev.rb
capistrano/deploy/stage.rb
capistrano/deploy/prod.rb
If additional environments are required you can copy capistrano/deploy/dev.rb
to a new stage file and make the required changes.
Configuring the general deployment settings happens in capistrano/deploy.rb
and requires replacing the
following placeholder tokens in the settings:
This is simply a name for the application that will be used as a directory name. Replace it with a relevant string to be used to identify your application.
This should be the HTTPS clone URL for your repo to be deployed. You may access this from the GitHub UI.
The files located at capistrano/deploy/*.rb
define deployment targets for the application to be released to.
For each environment the application is being deployed to there should be one matching file with the
environment-specific configuration defined. To create a new deployment environment, the
capistrano/deploy/dev.rb
file may be duplicated and renamed to match the name of the new environment. Then
the same configuration process described below should be followed by customizing each of the following tokens
in the file settings:
The stage name should match that of the containing file. For example, the dev.rb
file should set this to :dev
.
This is the URL used to access the site being deployed.
This is the name of the environment's vhost directory where the application will be deployed to. Usually this
is a combination of a short application name followed by the environment name, e.g., nextjs.dev
. By replacing
this token in the full path, the setting would look like this:
# The path to the project on the server
set :deploy_to, '/var/www/vhosts/nextjs.dev'
This is the specific git branch to be deployed to this environment from the repository. Typically these follow the pattern in the following table.
Environment | Branch |
---|---|
dev | integration |
stage | main |
prod | live |
This defines the servers to be deployed to and the logins to be used for access. In most use cases, each instance of this token will use the same login. An example login would look like:
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
role :app, %w{[email protected]}, :primary => true
role :web, %w{[email protected]}
role :db, %w{[email protected]}
Remove this README.md
file and rename the README.project.md
file to README.md
. Update the README.md
with the correct details for your projects. Take note of the Project Name at the top as well as the Buildkite badge setup. (Note: The Buildkite build status badge can be found in the Buildkite pipeline settings online.)