-
Install git
- Recommended installation notes:
- Linux: install via a native package management tool, e.g. apt
- MacOS: install via Xcode command line tools (
$ xcode-select --install
) or install Xcode (via the Mac App Store) - Windows: install via a Bash-like environment, e.g. Git for Windows
- Confirm installation via the following command:
$ git --version
- Recommended installation notes:
-
Install Docker
-
- Note: It is bad practice to include operating system and IDE lines in a project's .gitignore unless they are required by the project. This project does not require a specific operating system nor IDE so ensure your global .gitignore includes lines for all files relevant to your operating system(s) and IDE(s)
-
Clone the repository
$ git clone [email protected]:ModusCreateOrg/vue-lambda.git
- Change your current directory to the local clone of the repository
$ cd vue-lambda
- Build the Docker image (see below)
- Install dependencies (see below)
- Deploy Support CloudFormation Stack (see below)
- (If forked: ) Integrate Travis with repository to build automagically Branch CloudFormation Stack
- You must add the following environment variables to the Travis build configuration:
- AWS_DEFAULT_REGION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- You must add the following environment variables to the Travis build configuration:
- If you're testing with Lighthouse, do it on the fallback route:
/pwa
- Build the Docker image
$ docker build -t vue-lambda .
- Run commands via the Docker image
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind vue-lambda COMMAND
-
Install npm dependencies
-
Note:
unsafe-perm
is used so that iltorb can successfully install a pre-compiled binary for compression (rather than building one duringinstall
)
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind vue-lambda npm install --unsafe-perm
- Start the development server. You can access the website at:
http://localhost
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind -p 80:80 vue-lambda
-
Lint files using ESLint, stylelint and Prettier
- Note: It is strongly recommended to incorporate ESLint, stylelint, Prettier and EditorConfig into your IDE's syntax checking, highlighting and
on save
event
- Note: It is strongly recommended to incorporate ESLint, stylelint, Prettier and EditorConfig into your IDE's syntax checking, highlighting and
-
Check for errors via:
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind vue-lambda npm run lint
- Automagically fix any automagically-fixable errors via:
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind vue-lambda npm run lint-fix
- Check if any configuration rules conflict with Prettier via:
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind vue-lambda npm run lint-check-rules
- Test files via unit and snapshot test using Jest
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind vue-lambda npm run test:unit
- Run Docker in interactive mode
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind -it vue-lambda /bin/bash
-
Deploy the support CloudFormation stack
- Note: AWS CLI configuration files must exist on your host machine at
~/.aws
- Note: You must use unique values for
<S3_BUCKET_NAME_ARTIFACTS>
and<S3_BUCKET_NAME_STATIC>
- Note: AWS CLI configuration files must exist on your host machine at
$ docker run --mount src="$(pwd)",target=/opt/vue-lambda,type=bind --mount src="$(cd ~/.aws && pwd)",target=/root/.aws,type=bind -e STACK_NAME="vue-lambda-support" -e S3_BUCKET_NAME_ARTIFACTS="<S3_BUCKET_NAME_ARTIFACTS>" -e S3_BUCKET_NAME_STATIC="<S3_BUCKET_NAME_STATIC>" vue-lambda bash ./bin/deploy-support.sh