-
-
Notifications
You must be signed in to change notification settings - Fork 37
Add a Makefile to automate common command-line tasks
#436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Raruto
wants to merge
9
commits into
dev
Choose a base branch
from
makefiles
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
608c7e5
add `Makefile` tasks
Raruto 1d75e6f
make `clean` before `install`
Raruto d62b784
rename `Makefile.server.mk` into `Makefile.tasks.mk`
Raruto 276a8df
remove `clean` before `install`
Raruto a7474db
use make tests within `test_runner.yml` workflow
Raruto cb83b08
convert some bash statements to posix shell
Raruto 14fd69c
switch to legacy `docker-compose` binary on `test_runner.yml`
Raruto 3aad6cc
fallback to `docker cp`
Raruto 2a1b0d8
add `$${DOCKER_EXEC}` alias within `make tests`
Raruto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,3 +75,6 @@ run_local*.sh | |
| /pymast | ||
|
|
||
| /shared-volume | ||
|
|
||
| Makefile.semver.mk | ||
| Makefile.venv.mk | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| ## | ||
| # Makefile entrypoint | ||
| ## | ||
|
|
||
| PROJECT_NAME = G3W-ADMIN | ||
|
|
||
| ## | ||
| # see: <https://github.com/g3w-suite/makefiles/> | ||
| ## | ||
| INCLUDE_MAKEFILES_RELEASE = v0.1.2 | ||
| INCLUDE_MAKEFILES = Makefile.semver.mk Makefile.venv.mk | ||
|
|
||
| ## | ||
| # Get a list of tasks when `make` is run without args. | ||
| ## | ||
| default: list-tasks | ||
| help: list-tasks | ||
|
|
||
| ## | ||
| # Download required packages | ||
| ## | ||
| install: $(INCLUDE_MAKEFILES) venv install-reqs | ||
| @: | ||
|
|
||
| ## | ||
| # Download and include any makefiles | ||
| # specified in the INCLUDE_MAKEFILES list | ||
| ## | ||
| $(INCLUDE_MAKEFILES): | ||
| wget https://raw.githubusercontent.com/g3w-suite/makefiles/$(INCLUDE_MAKEFILES_RELEASE)/$@ | ||
| $(foreach i, ${INCLUDE_MAKEFILES}, $(eval include $i)) | ||
|
|
||
| ## | ||
| # Remove downloaded makefiles | ||
| ## | ||
| clean: | ||
| rm $(INCLUDE_MAKEFILES) | ||
|
|
||
| ## | ||
| # Print a list of available tasks | ||
| # | ||
| # https://stackoverflow.com/a/26339924 | ||
| ## | ||
| list-tasks: | ||
| @echo Available tasks: | ||
| @echo ---------------- | ||
| @$(MAKE) -pRrq -f $(firstword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | grep -E -v -e '^[^[:alnum:]]' -e '^$@$$' | ||
| @echo | ||
|
|
||
| ## | ||
| # Include here any project specific tasks | ||
| ## | ||
| include Makefile.tasks.mk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| ## | ||
| # Makefile for G3W-ADMIN assets (CSS/JS, fonts, images) | ||
| ## | ||
|
|
||
| ## | ||
| # Common files and folder paths | ||
| ## | ||
| BOWER_COMPONENTS_FOLDER = g3w-admin/core/static/bower_components | ||
| LOCAL_SETTINGS_FILE = g3w-admin/base/settings/local_settings.py | ||
| SHARED_VOLUME = /shared-volume | ||
| APPS_FOLDER = g3w-admin | ||
|
|
||
| ## | ||
| # TODO: find out how to remove gulp as dependency (ref: gulp-useref, gulp-uglify, gulp-clean-css) | ||
| # | ||
| # Generate CSS an JS bundles: | ||
| # | ||
| # g3w-admin/templates/base.html --> g3w-admin/core/static/dist/css/vendor.min.css | ||
| # g3w-admin/templates/base.html --> g3w-admin/core/static/dist/css/g3wadmin.min.css | ||
| # g3w-admin/templates/base.html --> g3w-admin/core/static/dist/js/vendor.min.js | ||
| # g3w-admin/templates/base.html --> g3w-admin/core/static/dist/js/g3wadmin.min.js | ||
| # | ||
| ## | ||
| build-assets: icheck_png fonts font-summernote | ||
| gulp build && rm g3w-admin/core/static/dist/base.html | ||
|
|
||
| ## | ||
| # Update css folder: | ||
| # | ||
| # g3w-admin/core/static/dist/css/ <-- g3w-admin/core/static/bower_components/icheck/skins/flat/blue*.png | ||
| # g3w-admin/core/static/dist/css/ <-- g3w-admin/core/static/bower_components/icheck/skins/flat/green*.png | ||
| ## | ||
| icheck_png: LOOKUP_RULE = -maxdepth 1 -type f \( -name "blue*.png" -or -name "green*.png" \) | ||
| icheck_png: INPUT_FILES = $(shell find g3w-admin/core/static/bower_components/icheck/skins/flat/ $(LOOKUP_RULE)) | ||
| icheck_png: DEST_FOLDER = g3w-admin/core/static/dist/css/ | ||
| icheck_png: | ||
| cp -vi ${INPUT_FILES} ${DEST_FOLDER} | ||
|
|
||
| ## | ||
| # Update fonts folder: | ||
| # | ||
| # g3w-admin/core/static/dist/fonts/ <-- g3w-admin/core/static/bower_components/**/*.{eot,ttf,woff,woff2} | ||
| # g3w-admin/core/static/dist/fonts/ <-- g3w-admin/core/static/modules/**/*.{eot,ttf,woff,woff2} | ||
| ## | ||
| fonts: LOOKUP_RULE = -type f \( -name "*.eot" -or -name "*.ttf" -or -name "*.woff" -or -name "*.woff2" \) | ||
| fonts: INPUT_FILES = $(shell find g3w-admin/core/static/bower_components $(LOOKUP_RULE)) $(shell find g3w-admin/core/static/modules/ $(LOOKUP_RULE)) | ||
| fonts: DEST_FOLDER = g3w-admin/core/static/dist/fonts/ | ||
| fonts: | ||
| cp -vi ${INPUT_FILES} ${DEST_FOLDER} | ||
|
|
||
| ## | ||
| # Update fonts folder: | ||
| # | ||
| # g3w-admin/core/static/dist/css/font/ <-- g3w-admin/core/static/modules/summernote/font/*.{eot,ttf,woff,woff2} | ||
| ## | ||
| fonts-summernote: LOOKUP_RULE = -maxdepth 1 -type f \( -name "*.eot" -or -name "*.ttf" -or -name "*.woff" -or -name "*.woff2" \) | ||
| fonts-summernote: INPUT_FILES = $(shell find g3w-admin/core/static/modules/summernote/font/ $(LOOKUP_RULE)) | ||
| fonts-summernote: DEST_FOLDER = g3w-admin/core/static/dist/css/font/ | ||
| fonts-summernote: | ||
| cp -vi ${INPUT_FILES} ${DEST_FOLDER} | ||
|
|
||
| ## | ||
| # Symlink folders: | ||
| # | ||
| # node_modules/@bower_components <--> g3w-admin/core/static/bower_components | ||
| ## | ||
| $(BOWER_COMPONENTS_FOLDER): | ||
| yarn --ignore-engines --ignore-scripts --prod ;\ | ||
| nodejs -e "try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), $(BOWER_COMPONENTS_FOLDER), 'junction') } catch (e) { console.log(e); }" | ||
|
|
||
| ## | ||
| # Copy file: | ||
| # | ||
| # docker_settings.py --> g3w-admin/base/settings/local_settings.py | ||
| ## | ||
| $(LOCAL_SETTINGS_FILE): | ||
| cp ./settings_docker.py ./g3w-admin/base/settings/local_settings.py | ||
|
|
||
| ## | ||
| # Make folder: | ||
| # | ||
| # /shared-volume/media | ||
| ## | ||
| $(SHARED_VOLUME)/media: | ||
| cd $(SHARED_VOLUME) && mkdir media | ||
|
|
||
| ## | ||
| # Make folder: | ||
| # | ||
| # /shared-volume/static | ||
| ## | ||
| $(SHARED_VOLUME)/static: $(SHARED_VOLUME)/media | ||
| cd $(SHARED_VOLUME) && ln -s media static | ||
|
|
||
| ## | ||
| # Make folder: | ||
| # | ||
| # /shared-volume/media/projects | ||
| ## | ||
| $(SHARED_VOLUME)/media/projects: $(SHARED_VOLUME)/media | ||
| cd $(SHARED_VOLUME)/media && mkdir projects | ||
|
|
||
| ## | ||
| # Make folder: | ||
| # | ||
| # /shared-volume/project_data | ||
| ## | ||
| $(SHARED_VOLUME)/project_data: | ||
| cd $(SHARED_VOLUME) && mkdir project_data |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the automated tests are run on the Ubuntu 20.04 runner image:
g3w-admin/.github/workflows/test_runner.yml
Lines 7 to 9 in 10f48f8
As per actions/runner-images/images/linux/Ubuntu2004-Readme.md, the
docker compose(v2) is installed, so why we can't just use that instead ofdocker-compose(v1)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens because some of these packets are available for GitHub Actions or Azure DevOps (that's why
Docker Compose v2 2.14.0+azure-1is only available for Azure V1 pipelines)Ref: runner-images#faqs
runner-images/images/linux/scripts/installers/docker-compose.sh
runner-images/images/win/scripts/Installers/Install-Docker.ps1