Use the following commands to create a new project:
composer create-project sumocoders/application-skeleton my_project
git init
git add .
git commit -n -m "Initial commit"
Start you project by running:
symfony serve
npm run watch
Open deploy.php
and check the configuration, replace the example values
(prefixed with $
) with correct values.
Try to deploy to staging by running:
symfony php vendor/bin/deployer.phar deploy staging
Log in through ssh
on the dev-server and alter the .env.local
-file to use the
correct credentials.
Each time something is merged into the staging branch it can be deployed automatically. To do so, follow the steps below:
- Open the project in Gitlab.
- Open Settings → Repository → Deploy Keys.
- Click the tab "Privately accessible deploy keys" and enable the key called "Sumo deploy user".
- Open Settings → CI / CD → Variables.
- Add a variable called
SSH_PRIVATE_KEY
, the value can be found in 1Password under "Sumo Deploy User private key". You can check the "Protect variable" flag. - Add a variable called
SSH_KNOWN_HOSTS
, the value should be the output ofssh-keyscan -H dev02.sumocoders.eu
. - Open
.gitlab-ci.yaml
, scroll toDeploy - to staging
. - Alter the url under
environment → url
.
Building assets:
# compile assets once
npm run dev
# or, recomile assets automatically when files change
npm run watch
# on deploy, create a production build
npm run build
For more information about Encore, see the official documentation.
We use panther to add functional tests to our project.
By default, a page response 200 should be tested on al pages. To do this you can add your urls to the providePublicUrls
and/or provideLoggedInUrls
.
There is a test-script scripts/test.sh
which you can use:
COMPOSER_MEMORY_LIMIT=-1 ./scripts/test.sh BRANCH-TO_TEST TARGETDIR
This will create a new project that uses the commited code in the selected branch. The new project will be located in the TARGETDIR
Kudos to beporter.