capistrano-symfony-asset-mapper 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9b773119a0849a1922bb6348c4707c64705635d3813cba66ee4a21c201565a89
4
+ data.tar.gz: da6887e5254f93ad9fbaf7fa0e38f9a008ff49512dbb54bffae48f2680ef08eb
5
+ SHA512:
6
+ metadata.gz: 7f9bbc36ae378e8539801de42d68643dda3c1b85e1d95e4db6b8115b8f10cf34c0c9f7ba7da2f40da31cc5fecb39d7f31a27c8fe369c384b522daf18d959265f
7
+ data.tar.gz: fb1284c139c995c2523c2176b8a67849087e939a5ffc609fe3618fb06df71d0ea7ce5b9f15ad320b7e10b8c23a65def84daa5bf1f1089ca67656aee191581af1
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.2.1
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-php-fpm.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,44 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-asset-mapper (0.1.0)
5
+ capistrano (>= 3.1.0)
6
+ capistrano-symfony (>= 0.4.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ airbrussh (1.3.0)
12
+ sshkit (>= 1.6.1, != 1.7.0)
13
+ capistrano (3.9.0)
14
+ airbrussh (>= 1.0.0)
15
+ i18n
16
+ rake (>= 10.0.0)
17
+ sshkit (>= 1.9.0)
18
+ capistrano-composer (0.0.6)
19
+ capistrano (>= 3.0.0.pre)
20
+ capistrano-file-permissions (0.1.1)
21
+ capistrano (~> 3.1)
22
+ capistrano-symfony (0.4.0)
23
+ capistrano (~> 3.1)
24
+ capistrano-composer (~> 0.0.3)
25
+ capistrano-file-permissions (~> 0.1.0)
26
+ i18n (0.8.6)
27
+ net-scp (1.2.1)
28
+ net-ssh (>= 2.6.5)
29
+ net-ssh (4.1.0)
30
+ rake (10.5.0)
31
+ sshkit (1.14.0)
32
+ net-scp (>= 1.1.2)
33
+ net-ssh (>= 2.8.0)
34
+
35
+ PLATFORMS
36
+ ruby
37
+
38
+ DEPENDENCIES
39
+ bundler (~> 1.10)
40
+ capistrano-asset-mapper!
41
+ rake (~> 10.0)
42
+
43
+ BUNDLED WITH
44
+ 1.14.6
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 glooby
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # **Capistrano::Symfony::AssetMapper**
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/capistrano-asset-mapper.svg)](https://badge.fury.io/rb/capistrano-asset-mapper)
4
+
5
+ **Seamless Integration for Symfony Asset Mapper in Capistrano Deployments**
6
+
7
+ This gem extends Capistrano 3.x to support Symfony's Asset Mapper and SASS build tools, automating tasks like asset installation, compilation, and SASS-to-CSS builds during deployments. It's an essential tool for modern Symfony applications that utilize the Asset Mapper.
8
+
9
+ ---
10
+
11
+ ## **Installation**
12
+
13
+ Before using this gem, ensure that Capistrano is properly set up in your project. Then, add the following lines to your `Gemfile`:
14
+
15
+ ```ruby
16
+ gem 'capistrano', '~> 3.1.0'
17
+ gem 'capistrano-symfony'
18
+ gem 'capistrano-asset-mapper'
19
+ ```
20
+
21
+ Run `bundle` to install the dependencies:
22
+
23
+ ```bash
24
+ $ bundle
25
+ ```
26
+
27
+ Or install the gem manually:
28
+
29
+ ```bash
30
+ $ gem install capistrano-asset-mapper
31
+ ```
32
+
33
+ ---
34
+
35
+ ## **Usage**
36
+
37
+ ### **Requiring the Gem**
38
+
39
+ To use the default tasks, require the gem in your `Capfile`:
40
+
41
+ ```ruby
42
+ require 'capistrano/symfony'
43
+ require 'capistrano/asset-mapper'
44
+ ```
45
+
46
+ ---
47
+
48
+ ### **Hooks Execution**
49
+
50
+ The gem integrates with Capistrano’s deployment lifecycle. The following hooks are added automatically:
51
+
52
+ ```ruby
53
+ after 'deploy:updated', 'symfony:asset_mapper:install'
54
+ after 'deploy:updated', 'symfony:asset_mapper:sass_build'
55
+ after 'deploy:updated', 'symfony:asset_mapper:compile'
56
+ ```
57
+
58
+ These hooks perform the following tasks:
59
+ - **`importmap:install`**: Installs JavaScript dependencies.
60
+ - **`sass:build`**: Compiles SASS files into CSS.
61
+ - **`asset-map:compile`**: Compiles asset mappings for production.
62
+
63
+ ---
64
+
65
+ ### **Disabling Hooks**
66
+
67
+ If you want to skip these tasks during deployment (e.g., in non-production environments), you can disable them by setting the following variable in your `deploy.rb` or an environment-specific file (e.g., `config/deploy/production.rb`):
68
+
69
+ ```ruby
70
+ set :enable_symfony_asset_mapper_hooks, false
71
+ ```
72
+
73
+ Alternatively, you can disable the hooks for a single deployment by running:
74
+
75
+ ```bash
76
+ cap production deploy enable_symfony_asset_mapper_hooks=false
77
+ ```
78
+
79
+ ---
80
+
81
+ ### **Server Configuration**
82
+
83
+ Ensure that the server running the asset mapper tasks has the `web` role. For example:
84
+
85
+ ```ruby
86
+ server 'node1.example.com', user: 'deploy', roles: %w{web}
87
+ server 'node2.example.com', user: 'deploy', roles: %w{web}
88
+ server 'node3.example.com', user: 'deploy', roles: %w{web}
89
+ ```
90
+
91
+ This configuration ensures that tasks are executed only on servers with the `web` role.
92
+
93
+ ---
94
+
95
+ ### **Configurable Options**
96
+
97
+ You can customize the behavior of the gem using the following options:
98
+
99
+ ```ruby
100
+ # Enable or disable Symfony Asset Mapper hooks globally
101
+ set :enable_symfony_asset_mapper_hooks, true
102
+
103
+ # Flags for the Symfony importmap:install command
104
+ set :symfony_importmap_install_flags, '--no-interaction --no-debug'
105
+
106
+ # Flags for the Symfony sass:build command
107
+ set :symfony_sass_build_flags, '--no-interaction --no-debug'
108
+
109
+ # Flags for the Symfony asset-map:compile command
110
+ set :symfony_asset_map_compile_flags, '--no-interaction --no-debug'
111
+ ```
112
+
113
+ ---
114
+
115
+ ## **Development**
116
+
117
+ To install this gem onto your local machine, run:
118
+
119
+ ```bash
120
+ $ bundle exec rake install
121
+ ```
122
+
123
+ To release a new version:
124
+ 1. Update the version number in `capistrano-asset-mapper.gemspec`.
125
+ 2. Run:
126
+
127
+ ```bash
128
+ $ bundle exec rake release
129
+ ```
130
+
131
+ This command will create a git tag for the version, push commits and tags, and publish the `.gem` file to [RubyGems](https://rubygems.org).
132
+
133
+ ---
134
+
135
+ ## **Contributing**
136
+
137
+ We welcome contributions to improve this gem! To contribute:
138
+ 1. Fork the repository.
139
+ 2. Create your feature branch: `git checkout -b my-new-feature`.
140
+ 3. Commit your changes: `git commit -am 'Add some feature'`.
141
+ 4. Push the branch: `git push origin my-new-feature`.
142
+ 5. Create a pull request.
143
+
144
+ ---
145
+
146
+ ## **License**
147
+
148
+ This gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
149
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "capistrano-symfony-asset-mapper"
7
+ spec.version = '0.1.0' # Version initiale
8
+ spec.authors = ["Ahmed EBEN HASSINE"]
9
+ spec.email = ["ahmedbhs123@gmail.com"]
10
+
11
+ spec.summary = %q{AssetMapper & sass build support for Capistrano 3.x}
12
+ spec.description = %q{Provides integration for AssetMapper and Sass build support in Capistrano 3.x environments.}
13
+ spec.license = "MIT"
14
+ spec.homepage = "https://github.com/ahmed-bhs/capistrano-symfony-asset-mapper"
15
+
16
+ if spec.respond_to?(:metadata)
17
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
18
+ spec.metadata['homepage_uri'] = spec.homepage
19
+ spec.metadata['source_code_uri'] = "https://github.com/ahmed-bhs/capistrano-symfony-asset-mapper"
20
+ spec.metadata['changelog_uri'] = "https://github.com/ahmed-bhs/capistrano-symfony-asset-mapper/CHANGELOG.md"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency 'capistrano', '~> 3.1', '>= 3.1.0'
31
+ spec.add_dependency 'capistrano-symfony', '~> 0.4', '>= 0.4.0'
32
+
33
+ spec.add_development_dependency "bundler", "~> 1.10"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/symfony-asset-mapper.rake', __FILE__)
@@ -0,0 +1,39 @@
1
+ namespace :symfony do
2
+ namespace :asset_mapper do
3
+ desc "Install JavaScript dependencies using ImportMap"
4
+ task :install do
5
+ on roles(:web) do
6
+ symfony_console "importmap:install", fetch(:symfony_importmap_install_flags)
7
+ end
8
+ end
9
+
10
+ desc "Compile SASS files into CSS"
11
+ task :sass_build do
12
+ on roles(:web) do
13
+ symfony_console "sass:build", fetch(:symfony_sass_build_flags)
14
+ end
15
+ end
16
+
17
+ desc "Compile asset mappings for production"
18
+ task :compile do
19
+ on roles(:web) do
20
+ symfony_console "asset-map:compile", fetch(:symfony_asset_map_compile_flags)
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ namespace :load do
27
+ desc "Set default flags for Symfony asset tasks"
28
+ task :defaults do
29
+ set :enable_symfony_asset_mapper_hooks, true
30
+ set :symfony_importmap_install_flags, '--no-interaction --no-debug'
31
+ set :symfony_sass_build_flags, '--no-interaction --no-debug'
32
+ set :symfony_asset_map_compile_flags, '--no-interaction --no-debug'
33
+ end
34
+ end
35
+
36
+ # Hooks pour exécuter automatiquement les tâches
37
+ after 'deploy:updated', 'symfony:asset_mapper:install' if fetch(:enable_symfony_asset_mapper_hooks)
38
+ after 'deploy:updated', 'symfony:asset_mapper:sass_build' if fetch(:enable_symfony_asset_mapper_hooks)
39
+ after 'deploy:updated', 'symfony:asset_mapper:compile' if fetch(:enable_symfony_asset_mapper_hooks)
data/script/bootstrap ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ bundle install
data/script/release ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ rake release
metadata ADDED
@@ -0,0 +1,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-symfony-asset-mapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ahmed EBEN HASSINE
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-12-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.1.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.1.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: capistrano-symfony
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.4'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.4.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.4'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.4.0
53
+ - !ruby/object:Gem::Dependency
54
+ name: bundler
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1.10'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '1.10'
67
+ - !ruby/object:Gem::Dependency
68
+ name: rake
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '10.0'
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '10.0'
81
+ description: Provides integration for AssetMapper and Sass build support in Capistrano
82
+ 3.x environments.
83
+ email:
84
+ - ahmedbhs123@gmail.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - ".gitignore"
90
+ - ".ruby-version"
91
+ - CODE_OF_CONDUCT.md
92
+ - Gemfile
93
+ - Gemfile.lock
94
+ - LICENSE
95
+ - README.md
96
+ - Rakefile
97
+ - capistrano-symfony-asset-mapper.gemspec
98
+ - lib/capistrano/symfony-asset-mapper.rb
99
+ - lib/capistrano/tasks/symfony-asset-mapper.rake
100
+ - script/bootstrap
101
+ - script/release
102
+ homepage: https://github.com/ahmed-bhs/capistrano-symfony-asset-mapper
103
+ licenses:
104
+ - MIT
105
+ metadata:
106
+ allowed_push_host: https://rubygems.org
107
+ homepage_uri: https://github.com/ahmed-bhs/capistrano-symfony-asset-mapper
108
+ source_code_uri: https://github.com/ahmed-bhs/capistrano-symfony-asset-mapper
109
+ changelog_uri: https://github.com/ahmed-bhs/capistrano-symfony-asset-mapper/CHANGELOG.md
110
+ post_install_message:
111
+ rdoc_options: []
112
+ require_paths:
113
+ - lib
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ requirements: []
125
+ rubygems_version: 3.1.2
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: AssetMapper & sass build support for Capistrano 3.x
129
+ test_files: []