Skip to content

Commit

Permalink
Merge branch 'dev' into 'master'
Browse files Browse the repository at this point in the history
Dev

See merge request template/typo3!9
  • Loading branch information
Tobias Terhechte committed Jan 14, 2021
2 parents 1f26dda + 54f0bf5 commit 209ecb6
Show file tree
Hide file tree
Showing 28 changed files with 949 additions and 996 deletions.
27 changes: 0 additions & 27 deletions .gitlab-ci.yml.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
image: mia3/gitlab-ci:7.3

stages:
- build
- deploy

before_script:
Expand All @@ -14,32 +13,6 @@ before_script:
- ssh-keyscan -p 2222 'gitlab.mia3.com' >> ~/.ssh/known_hosts # gitlab server
- ssh-keyscan -p 22 'mia3.com' >> ~/.ssh/known_hosts # deployment target server

# Cache libraries in between jobs
cache:
paths:
- node_modules/
- public/
- vendor/
- packages/

# Development build - with sourcemaps
build:
stage: build
script:
- make install
- make build
only:
- dev

# Production build - minified
build_prod:
stage: build
script:
- make install
- make build/production
only:
- master

deploy_int:
stage: deploy
script: make integration/deploy
Expand Down
10 changes: 7 additions & 3 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

143 changes: 62 additions & 81 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
.PHONY: help install test run build deploy/staging
.PHONY: help install test run build
.DEFAULT_GOAL := help

# Upload *untracked* generated assets on deployment
assets_path = packages/template/Resources/Public/Build
define env/shell
ssh $($1/user)@$($1/host) -p $($1/port) 'cd $($1/path) && $2'
endef

define env/upload
rsync -rzPh -e 'ssh -p $($1/port)' --files-from="rsync_deploy.txt" \
'./' '$($1/user)@$($1/host):$($1/path)'
endef

help:
@grep -E '^[a-zA-Z\/_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


# --------------------------------------------------------------------- #
# Local environment #
# --------------------------------------------------------------------- #
setup: install-dependencies setup/database-connection migrate build clear-cache ## Setup the new project

setup: install setup/database-connection migrate build clear-cache ## Setup the new project
./vendor/bin/typo3cms extension:setupactive
./vendor/bin/typo3cms backend:createadmin admin

build/watch: ## Build assets with sourcemaps and watch for changes
./node_modules/.bin/encore dev --watch


install: ## Install composer and yarn dependencies
composer install
yarn install
Expand All @@ -28,9 +33,11 @@ update: ## Update composer and yarn dependencies
yarn upgrade

build: ## Build assets with sourcemaps
yarn
./node_modules/.bin/encore dev

build/production: ## Build minified assets
yarn
./node_modules/.bin/encore production

migrate: ## Apply database migration
Expand All @@ -50,6 +57,7 @@ setup/database-connection: ## Create an AdditionalConfiguration.php
emails/generate:
./node_modules/.bin/mjml ./packages/template/Resources/Private/Email/*.mjml --output ./packages/template/Resources/Private/Templates/Email;


# --------------------------------------------------------------------- #
# Integration environment #
# Branch: dev #
Expand All @@ -59,34 +67,25 @@ integration/user =
integration/port = 22
integration/path =

define integration/shell
ssh $(integration/user)@$(integration/host) -p$(integration/port) 'cd $(integration/path) &&$1'
endef
integration/deploy:
yarn
make build

# Upload
$(call env/upload,integration)

# Composer
$(call env/shell,integration, COMPOSER_DISCARD_CHANGES=true composer install --no-dev --optimize-autoloader --ignore-platform-reqs)

integration/deploy: build emails/generate ## Deploys to integration from your local machine. Updates database schema and clears caches
git -C ./ ls-files --exclude-standard -oi --directory > /tmp/excludes;
rsync --recursive --compress \
--progress \
--exclude=".git" \
--exclude="public/typo3conf/AdditionalConfiguration.php" \
--exclude-from="/tmp/excludes" \
-e 'ssh -p$(integration/port)' \
'./' \
'$(integration/user)@$(integration/host):$(integration/path)'
rsync -rz \
--progress \
-e 'ssh -p$(integration/port)' \
'./$(assets_path)/Build/' \
'$(integration/user)@$(integration/host):$(integration/path)/$(assets_path)/Build/'
$(call integration/shell, composer install)
$(call integration/shell, php_cli ./vendor/bin/typo3cms database:updateschema)
$(call integration/shell, php_cli ./vendor/bin/typo3cms cache:flush)

integration/clear-cache: ## Clears integration caches
$(call integration/shell, php_cli ./vendor/bin/typo3cms cache:flush)
# TYPO3
$(call env/shell,integration, php_cli ./vendor/bin/typo3cms database:updateschema)
$(call env/shell,integration, php_cli ./vendor/bin/typo3cms cache:flush)

integration/clear-cache: ## Clears integration cache
$(call env/shell,integration, php_cli ./vendor/bin/typo3cms cache:flush)

integration/connection-test: ## Tests connection to your project
$(call integration/shell, cd $(production/path) && ls -la)
$(call env/shell,integration, ls -la)


# --------------------------------------------------------------------- #
Expand All @@ -98,34 +97,25 @@ staging/user =
staging/port = 22
staging/path =

define staging/shell
ssh $(staging/user)@$(staging/host) -p$(staging/port) 'cd $(staging/path) &&$1'
endef
staging/deploy:
yarn
make build

# Upload
$(call env/upload,staging)

# Composer
$(call env/shell,staging, COMPOSER_DISCARD_CHANGES=true composer install --no-dev --optimize-autoloader --ignore-platform-reqs)

# TYPO3
$(call env/shell,staging, php_cli ./vendor/bin/typo3cms database:updateschema)
$(call env/shell,staging, php_cli ./vendor/bin/typo3cms cache:flush)

staging/deploy: build/production emails/generate ## Deploys to staging from your local machine. Updates database schema and clears caches
git -C ./ ls-files --exclude-standard -oi --directory > /tmp/excludes;
rsync --recursive --compress \
--progress \
--exclude=".git" \
--exclude="public/typo3conf/AdditionalConfiguration.php" \
--exclude-from="/tmp/excludes" \
-e 'ssh -p$(staging/port)' \
'./' \
'$(staging/user)@$(staging/host):$(staging/path)'
rsync -rz \
--progress \
-e 'ssh -p$(staging/port)' \
'./$(assets_path)/Build/' \
'$(staging/user)@$(staging/host):$(staging/path)/$(assets_path)/Build/'
$(call staging/shell, composer install)
$(call staging/shell, php_cli ./vendor/bin/typo3cms database:updateschema)
$(call staging/shell, php_cli ./vendor/bin/typo3cms cache:flush)

staging/clear-cache: ## Clears staging caches
$(call staging/shell, php_cli ./vendor/bin/typo3cms cache:flush)
staging/clear-cache: ## Clears staging cache
$(call env/shell,staging, php_cli ./vendor/bin/typo3cms cache:flush)

staging/connection-test: ## Tests connection to your project
$(call staging/shell, cd $(staging/path) && ls -la)
$(call env/shell,staging, ls -la)


# --------------------------------------------------------------------- #
Expand All @@ -137,34 +127,25 @@ production/user =
production/port = 22
production/path =

define production/shell
ssh $(production/user)@$(production/host) -p$(production/port) 'cd $(production/path) &&$1'
endef
production/deploy:
yarn
make build

# Upload
$(call env/upload,production)

# Composer
$(call env/shell,production, COMPOSER_DISCARD_CHANGES=true composer install --no-dev --optimize-autoloader --ignore-platform-reqs)

# TYPO3
$(call env/shell,production, php_cli ./vendor/bin/typo3cms database:updateschema)
$(call env/shell,production, php_cli ./vendor/bin/typo3cms cache:flush)

production/deploy: build/production emails/generate ## Deploys to production from your local machine. Updates database schema and clears caches
git -C ./ ls-files --exclude-standard -oi --directory > /tmp/excludes;
rsync --recursive --compress \
--progress \
--exclude=".git" \
--exclude="public/typo3conf/AdditionalConfiguration.php" \
--exclude-from="/tmp/excludes" \
-e 'ssh -p$(production/port)' \
'./' \
'$(production/user)@$(production/host):$(production/path)'
rsync -rz \
--progress \
-e 'ssh -p$(production/port)' \
'./$(assets_path)/Build/' \
'$(production/user)@$(production/host):$(production/path)/$(assets_path)/Build/'
$(call production/shell, composer install)
$(call production/shell, php_cli ./vendor/bin/typo3cms database:updateschema)
$(call production/shell, php_cli ./vendor/bin/typo3cms cache:flush)

production/clear-cache: ## Clears production caches
$(call production/shell, php_cli ./vendor/bin/typo3cms cache:flush)
production/clear-cache: ## Clears production cache
$(call env/shell,production, php_cli ./vendor/bin/typo3cms cache:flush)

production/connection-test: ## Tests connection to your project
$(call production/shell, cd $(production/path) && ls -la)
$(call env/shell,production, ls -la)


# --------------------------------------------------------------------- #
Expand Down
3 changes: 2 additions & 1 deletion assets/template/Scripts/Components/Button/ButtonClose.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
</script>

<style scoped>
@import "../../../Styles/Variables.css";
@import '../../../Styles/Variables.css';
.button-close
{
background: transparent;
Expand Down
2 changes: 1 addition & 1 deletion assets/template/Scripts/Components/Form/BaseForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}).then(res => {
this.htmlResponse = res.data;
}).catch(error => {
console.log(error)
console.log(error);
this.htmlResponse = 'Server error. Please try again.';
});
}
Expand Down
3 changes: 2 additions & 1 deletion assets/template/Scripts/Components/Form/BaseInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
</script>

<style scoped>
@import "../../../Styles/Variables.css";
@import '../../../Styles/Variables.css';
.baseInput
{
position: relative;
Expand Down
3 changes: 2 additions & 1 deletion assets/template/Scripts/Components/Form/BaseTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
</script>

<style scoped>
@import "../../../Styles/Variables.css";
@import '../../../Styles/Variables.css';
.baseTextarea
{
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
</script>

<style scoped>
@import '~hamburgers/dist/hamburgers.min.css';
@import '../../../Styles/Variables.css';
.hamburger-inner,
.hamburger-inner::after,
.hamburger-inner::before
Expand Down
19 changes: 8 additions & 11 deletions assets/template/Scripts/Main.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
import Vue from 'vue';
import store from './Store';
import 'swiper/swiper-bundle.min.css'
import {Swiper as SwiperClass, Pagination, Navigation, Autoplay} from 'swiper/swiper.esm.js'
import VueAwesomeSwiper from "vue-awesome-swiper";
import { Swiper as SwiperClass, Pagination, Navigation, Autoplay } from 'swiper/js/swiper.esm.js';
import GLightbox from 'glightbox';


// Swiper modules
SwiperClass.use([Pagination, Navigation, Autoplay])
SwiperClass.use([Pagination, Navigation, Autoplay]);

/**
* document ready class
*/
window.onload = function (){
document.body.classList.add("document--loaded")
window.onload = function () {
document.body.classList.add('document--loaded');

/**
* GLightbox Configuration
*/
const lightbox = GLightbox({
touchNavigation: true
})
}
});
};

/**
* Autoloading components from "Components"-directory
Expand All @@ -40,7 +37,7 @@ Vue.directive('click-outside', {
bind: function (el, binding, vnode) {
el.event = function (event) {
// here I check that click was outside the el and his children
if (!(el == event.target || el.contains(event.target))) {
if (!(el === event.target || el.contains(event.target))) {
// and if it did, call method provided in attribute value
vnode.context[binding.expression](event);
}
Expand Down Expand Up @@ -79,7 +76,7 @@ new Vue({
},
methods: {
hasState(id, value) {
return this.state[id] == value;
return this.state[id] === value;
},
goBack(evt) {
window.history.back();
Expand Down
Loading

0 comments on commit 209ecb6

Please sign in to comment.