Skip to content

Commit 7888eca

Browse files
committed
Merge branch 'feature/manage-compile' into 'develop'
Feature/manage compile See merge request ASIP-Sante/esante-ressources!1
2 parents 035d10c + 9ec769f commit 7888eca

File tree

1,485 files changed

+249
-69540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,485 files changed

+249
-69540
lines changed

.docksal/commands/compile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
## Compile styleguide and site based on src
4+
##
5+
## Usage: fin compile
6+
7+
# Abort if anything fails
8+
set -e
9+
10+
source "${PROJECT_ROOT}/.docksal/commands/helpers"
11+
12+
#-------------------------- Execution --------------------------------
13+
14+
# Site updating
15+
echo -e "${green_bg} Step 1 ${NC}${green} Compiling...${NC}"
16+
17+
time -p compile
18+
19+
echo -e "${green_bg} DONE! ${NC}${green} Completed all compiling steps.${NC}"
20+
21+
#-------------------------- END: Execution --------------------------------

.docksal/commands/gulp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env sh
2+
3+
#: exec_target = node
4+
5+
## Execute gulp commands
6+
##
7+
## Usage: fin gulp
8+
9+
# Abort if anything fails
10+
set -e
11+
12+
source "${PROJECT_ROOT}/.docksal/commands/helpers"
13+
14+
cd "${PROJECT_ROOT}"
15+
16+
if [ ! -d "node_modules" ]
17+
then
18+
echo_yellow "Node modules don't exist."
19+
echo_green "Installing node modules..."
20+
21+
npm ci
22+
fi
23+
24+
#-------------------------- Execution --------------------------------
25+
26+
./node_modules/.bin/gulp ${@}

.docksal/commands/helpers

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
## Define helpers for others scripts.
4+
##
5+
## No "fin" usage.
6+
7+
#-------------------------- Settings --------------------------------
8+
9+
PROJECT_ROOT="/var/www"
10+
11+
#-------------------------- END: Settings --------------------------------
12+
13+
#-------------------------- Helper functions --------------------------------
14+
15+
# Console colors
16+
red='\033[0;31m'
17+
green='\033[0;32m'
18+
green_bg='\033[1;97;42m'
19+
lavender_bg='\033[1;30;0;44m'
20+
yellow='\033[1;33m'
21+
NC='\033[0m'
22+
23+
echo_red () { echo -e "${red}$1${NC}"; }
24+
echo_green () { echo -e "${green}$1${NC}"; }
25+
echo_green_bg () { echo -e "${green_bg}$1${NC}"; }
26+
echo_lavender_bg () { echo -e "${lavender_bg}$1${NC}"; }
27+
echo_yellow () { echo -e "${yellow}$1${NC}"; }
28+
29+
30+
# Compile SCSS
31+
compile ()
32+
{
33+
#echo_green "Compiling"
34+
fin gulp
35+
}
36+
37+
#-------------------------- END: Helper functions --------------------------------

.docksal/commands/init

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
## Initialize stack and site (full reset)
4+
##
5+
## Usage: fin init
6+
7+
# Abort if anything fails
8+
set -e
9+
10+
source "${PROJECT_ROOT}/.docksal/commands/helpers"
11+
12+
#-------------------------- Execution --------------------------------
13+
14+
# Stack initialization
15+
echo -e "${green_bg} Step 1 ${NC}${green} Initializing stack...${NC}"
16+
fin project reset -f
17+
18+
# Site initialization
19+
echo -e "${green_bg} Step 2 ${NC}${green} Initializing site...${NC}"
20+
21+
time -p compile
22+
23+
echo -e "${green_bg} DONE! ${NC}${green} Completed all initialization steps.${NC}"
24+
25+
#-------------------------- END: Execution --------------------------------

.docksal/commands/npm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env sh
2+
3+
#: exec_target = node
4+
5+
## Execute npm commands
6+
##
7+
## Usage: fin npm
8+
9+
# Abort if anything fails
10+
set -e
11+
12+
source "${PROJECT_ROOT}/.docksal/commands/helpers"
13+
14+
cd "${PROJECT_ROOT}"
15+
16+
#-------------------------- Execution --------------------------------
17+
18+
npm ${@}

.docksal/docksal.env

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@
1010

1111
# Override virtual host (matches project folder name by default)
1212
VIRTUAL_HOST=esante-ressources.docksal.site
13+
14+
# Lock images versions for LAMP services
15+
# This will prevent images from being updated when Docksal is updated
16+
NODE_IMAGE='node:12-alpine'
17+
1318
# Override document root ('docroot' by default)
14-
DOCROOT=web/styleguide
19+
DOCROOT=styleguide

.docksal/docksal.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,16 @@ services:
88
- "${VIRTUAL_HOST}:${DOCKSAL_HOST_IP}"
99
labels:
1010
- io.docksal.virtual-host=${VIRTUAL_HOST},*.${VIRTUAL_HOST},${VIRTUAL_HOST}.*
11+
12+
# Compile sources
13+
node:
14+
image: ${NODE_IMAGE}
15+
volumes:
16+
- project_root:/var/www:rw,nocopy,cached # Project root volume
17+
labels:
18+
- io.docksal.user=node
19+
- io.docksal.shell=sh
20+
- io.docksal.project-root=${PROJECT_ROOT}
21+
environment:
22+
- PROJECT_ROOT=/var/www
23+
command: tail -F anything

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
.idea
1+
.idea
2+
3+
node_modules
4+
5+
# Generated folders by gulp compilation
6+
site
7+
styleguide

.gitlab-ci.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,21 @@ stages:
3333
# Build job.
3434
################################################################################
3535

36-
#css-build:
37-
# stage: build
38-
# needs: []
39-
# extends:
40-
# - .node_image
41-
# - .build_rules
42-
# variables:
43-
# FOLDERS: g_nius
44-
# script:
45-
# - |
46-
# for FOLDER in $FOLDERS
47-
# do
48-
# cd ${CI_PROJECT_DIR}/web/themes/custom/${FOLDER}
49-
# npm ci
50-
# npm run prod:css
51-
# done
52-
# artifacts:
53-
# paths:
54-
# - web/themes/custom/g_nius/css
55-
# expire_in: 1 hour
36+
build:site:
37+
stage: build
38+
needs: []
39+
extends:
40+
- .node_image
41+
- .build_rules
42+
before_script:
43+
- npm ci
44+
script:
45+
- ./node_modules/.bin/gulp
46+
artifacts:
47+
paths:
48+
- web/site
49+
- web/styleguide
50+
expire_in: 1 hour
5651

5752
################################################################################
5853
# Code quality jobs.
@@ -122,8 +117,8 @@ stages:
122117

123118
generate_package:
124119
stage: build
125-
needs: []
126-
dependencies: []
120+
needs: ["build:site"]
121+
dependencies: ["build:site"]
127122
extends:
128123
- .ressources_variables
129124
- .tags_rules

.gitlab/ci/images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
################################################################################
77

88
.node_image:
9-
image: node:16.14-alpine
9+
image: node:12-alpine

0 commit comments

Comments
 (0)