Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MostafaMollaali
dynamic
Commits
b7349664
Commit
b7349664
authored
8 years ago
by
Lars Bilke
Committed by
Lars Bilke
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] Contentful import is skipped on web-target when not all
requirements were met.
parent
1b52476c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/cmake/Web.cmake
+17
-8
17 additions, 8 deletions
scripts/cmake/Web.cmake
with
17 additions
and
8 deletions
scripts/cmake/Web.cmake
+
17
−
8
View file @
b7349664
if
(
NOT NPM
OR NOT PIP OR NOT PYTHON_EXECUTABLE
)
if
(
NOT NPM
)
return
()
return
()
endif
()
endif
()
...
@@ -10,16 +10,25 @@ endif()
...
@@ -10,16 +10,25 @@ endif()
add_custom_target
(
web-install
add_custom_target
(
web-install
COMMAND
${
PACKAGE_MANAGER
}
COMMAND
${
PACKAGE_MANAGER
}
COMMAND
${
PIP
}
install -r requirements.txt
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/web
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/web
BYPRODUCTS
${
CMAKE_SOURCE_DIR
}
/web/node_modules
BYPRODUCTS
${
CMAKE_SOURCE_DIR
}
/web/node_modules
)
)
add_custom_target
(
web-import
if
(
PIP AND PYTHON_EXECUTABLE AND
COMMAND
${
PYTHON_EXECUTABLE
}
import.py
(
EXISTS
${
CMAKE_SOURCE_DIR
}
/web/import/secret.py OR
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/web/import
DEFINED ENV{CONTENTFUL_ACCESS_TOKEN}
))
DEPENDS web-install
)
add_custom_target
(
web-import
COMMAND
${
PIP
}
install -r ../requirements.txt
COMMAND
${
PYTHON_EXECUTABLE
}
import.py
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/web/import
DEPENDS web-install
)
set
(
IMPORT_TARGET web-import
)
else
()
message
(
STATUS
"[web] Skipping import from Contentful!"
)
endif
()
if
(
DEFINED OGS_WEB_BASE_URL
)
if
(
DEFINED OGS_WEB_BASE_URL
)
set
(
HUGO_ARGS --baseURL
${
OGS_WEB_BASE_URL
}
)
set
(
HUGO_ARGS --baseURL
${
OGS_WEB_BASE_URL
}
)
...
@@ -32,7 +41,7 @@ endif()
...
@@ -32,7 +41,7 @@ endif()
add_custom_target
(
web
add_custom_target
(
web
COMMAND
${
NPM
}
run build --
${
HUGO_ARGS
}
COMMAND
${
NPM
}
run build --
${
HUGO_ARGS
}
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/web
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/web
DEPENDS web-install
web-import
DEPENDS web-install
${
IMPORT_TARGET
}
)
)
add_custom_target
(
web-clean
add_custom_target
(
web-clean
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment