shipit-cli 0.10.0__py3-none-any.whl → 0.10.1__py3-none-any.whl

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.
shipit/assets/php/php.ini CHANGED
@@ -22,6 +22,8 @@ error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
22
22
  display_errors = Off
23
23
  display_startup_errors = Off
24
24
  log_errors = On
25
+ access_log = /dev/stdout
26
+ error_log = /dev/stderr
25
27
  ignore_repeated_errors = Off
26
28
  ignore_repeated_source = Off
27
29
  report_memleaks = On
@@ -1,15 +1,20 @@
1
1
  # Needed to get the WP-CLI commands to avoid asking for the TTY size
2
- export COLUMNS=80
2
+ IFS=$'\n\t'
3
+
4
+ export COLUMNS=80 # Prevent WP-CLI from asking for TTY size
5
+ export PAGER="cat"
6
+
7
+ echo "🚀 Starting WordPress setup..."
3
8
 
4
9
  echo "Creating required directories..."
5
10
 
6
11
  mkdir -p wp-content/plugins
7
12
  mkdir -p wp-content/upgrade
8
13
 
9
- echo "Installing WordPress core..."
14
+ echo "Installing WordPress core"
10
15
 
11
16
  wp core install \
12
- --url="$WP_SITE_URL" \
17
+ --url="$WP_SITEURL" \
13
18
  --title="$WP_SITE_TITLE" \
14
19
  --admin_user="$WP_ADMIN_USERNAME" \
15
20
  --admin_password="$WP_ADMIN_PASSWORD" \
@@ -17,9 +22,63 @@ wp core install \
17
22
  --locale="$WP_LOCALE"
18
23
 
19
24
 
20
- if [ -z "$WP_UPDATE_DB" ]; then
25
+ if [ "${WP_UPDATE_DB:-false}" = "true" ]; then
21
26
  echo "Updating database..."
22
27
  wp core update-db
23
28
  fi
24
29
 
25
- echo "Installation complete"
30
+ # Install plugins from WP_PLUGINS environment variable
31
+ if [ -n "${WP_PLUGINS:-}" ]; then
32
+ echo "Installing plugins from WP_PLUGINS: $WP_PLUGINS"
33
+
34
+ IFS=',' # Split by commas
35
+ for PLUGIN_ENTRY in $WP_PLUGINS; do
36
+ if [[ "$PLUGIN_ENTRY" =~ ^https?:// ]]; then
37
+ echo "Installing plugin from URL: $PLUGIN_ENTRY"
38
+ wp plugin install "$PLUGIN_ENTRY" --activate
39
+ else
40
+ # Extract name and version using parameter expansion
41
+ PLUGIN_NAME="${PLUGIN_ENTRY%%:*}"
42
+ PLUGIN_VERSION="${PLUGIN_ENTRY#*:}"
43
+
44
+ if [[ "$PLUGIN_NAME" == "$PLUGIN_VERSION" ]]; then
45
+ echo "Installing plugin '${PLUGIN_NAME}' (latest version)..."
46
+ wp plugin install "$PLUGIN_NAME" --activate
47
+ else
48
+ echo "Installing plugin '${PLUGIN_NAME}' (version: ${PLUGIN_VERSION})..."
49
+ wp plugin install "$PLUGIN_NAME" --version="$PLUGIN_VERSION" --activate
50
+ fi
51
+ fi
52
+ done
53
+ fi
54
+
55
+ # Install themes from WP_THEMES environment variable
56
+ if [ -n "${WP_THEMES:-}" ]; then
57
+ echo "🎨 Installing themes from WP_THEMES: $WP_THEMES"
58
+ IFS=','
59
+
60
+ for THEME_ENTRY in $WP_THEMES; do
61
+ if [[ "$THEME_ENTRY" =~ ^https?:// ]]; then
62
+ echo "Installing theme from URL: $THEME_ENTRY"
63
+ wp theme install "$THEME_ENTRY"
64
+ else
65
+ THEME_NAME="${THEME_ENTRY%%:*}"
66
+ THEME_VERSION="${THEME_ENTRY#*:}"
67
+
68
+ if [[ "$THEME_NAME" == "$THEME_VERSION" ]]; then
69
+ echo "Installing theme '${THEME_NAME}' (latest version)..."
70
+ wp theme install "$THEME_NAME"
71
+ else
72
+ echo "Installing theme '${THEME_NAME}' (version: ${THEME_VERSION})..."
73
+ wp theme install "$THEME_NAME" --version="$THEME_VERSION"
74
+ fi
75
+ fi
76
+ done
77
+ fi
78
+
79
+ if [ -n "${WP_DEFAULT_THEME:-}" ]; then
80
+ echo "Activating default theme: $WP_DEFAULT_THEME"
81
+ wp theme activate "$WP_DEFAULT_THEME"
82
+ fi
83
+
84
+ echo "✅ WordPress Installation complete"
@@ -21,7 +21,6 @@ define( 'WP_AUTO_UPDATE_CORE', false); // Disable automatic aupdates and checks
21
21
  * @package WordPress
22
22
  */
23
23
 
24
-
25
24
  function get_env_var(string $name, string $default = ''): string
26
25
  {
27
26
  if (isset($_ENV[$name])) {
@@ -29,14 +28,17 @@ function get_env_var(string $name, string $default = ''): string
29
28
  }
30
29
 
31
30
  if ($default === '') {
32
- $stderr = fopen("php://stderr", "wb");
33
- fwrite($stderr, "Configuration error: environment variable " . $name . " not provided. Using default value: " . $default . PHP_EOL);
34
- fclose($stderr);
31
+ error_log("Configuration error: environment variable " . $name . " not provided.");
35
32
  }
36
33
 
37
34
  return $default;
38
35
  }
39
36
 
37
+ function get_env_var_bool(string $name, bool $default = false): bool
38
+ {
39
+ return in_array(get_env_var($name, $default ? "1" : "0"), ["1", "true", "yes", "on", "y"], true);
40
+ }
41
+
40
42
  // ** Database settings - You can get this info from your web host ** //
41
43
  /** The name of the database for WordPress */
42
44
  define( 'DB_NAME', get_env_var('DB_NAME', 'wordpress') );
@@ -87,14 +89,14 @@ define('NONCE_SALT', get_env_var('NONCE_SALT', 'no secret provided'));
87
89
  $scheme = isset( $_SERVER['HTTPS'] ) && '1' === (string) $_SERVER['HTTPS'] ? "https://" : "http://";
88
90
 
89
91
  if (!defined('WP_HOME')) {
90
- define( 'WP_HOME', isset($_SERVER['HTTP_HOST']) ? ($scheme . $_SERVER['HTTP_HOST'] ): "http://localhost");
92
+ define( 'WP_HOME', get_env_var('WP_HOME', isset($_SERVER['HTTP_HOST']) ? ($scheme . $_SERVER['HTTP_HOST'] ): "http://localhost"));
91
93
  }
92
94
 
93
- define( 'WP_SITEURL', WP_HOME . '/' );
95
+ define( 'WP_SITEURL', get_env_var('WP_SITEURL', WP_HOME . '/') );
94
96
 
95
- define( 'WP_MEMORY_LIMIT', '256M' );
96
- define( 'WP_MAX_MEMORY_LIMIT', '256M' );
97
- define( 'WP_POST_REVISIONS', false );
97
+ define( 'WP_MEMORY_LIMIT', get_env_var('WP_MEMORY_LIMIT', '256M') );
98
+ define( 'WP_MAX_MEMORY_LIMIT', get_env_var('WP_MAX_MEMORY_LIMIT', '256M') );
99
+ define( 'WP_POST_REVISIONS', get_env_var_bool('WP_POST_REVISIONS', false));
98
100
 
99
101
  /**#@-*/
100
102
 
@@ -118,11 +120,20 @@ $table_prefix = 'wp_';
118
120
  *
119
121
  * @link https://wordpress.org/support/article/debugging-in-wordpress/
120
122
  */
121
- define( 'WP_DEBUG', false );
123
+ define( 'WP_DEBUG', get_env_var_bool('WP_DEBUG', false) );
122
124
 
123
125
  /* Add any custom values between this line and the "stop editing" line. */
124
126
 
127
+ // Optionally include an additional wp-config.php file if defined
128
+ if ( getenv('WP_ADDITIONAL_CONFIG') ) {
129
+ $extra_config_path = getenv('WP_ADDITIONAL_CONFIG');
125
130
 
131
+ if ( file_exists( $extra_config_path ) ) {
132
+ require_once $extra_config_path;
133
+ } else {
134
+ error_log( "WP_ADDITIONAL_CONFIG defined but file not found: {$extra_config_path}" );
135
+ }
136
+ }
126
137
 
127
138
  /* That's all, stop editing! Happy publishing. */
128
139
 
shipit/version.py CHANGED
@@ -1,5 +1,5 @@
1
1
  __all__ = ["version", "version_info"]
2
2
 
3
3
 
4
- version = "0.10.0"
5
- version_info = (0, 10, 0, "final", 0)
4
+ version = "0.10.1"
5
+ version_info = (0, 10, 1, "final", 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shipit-cli
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Shipit CLI is the best way to build, serve and deploy your projects anywhere.
5
5
  Project-URL: homepage, https://wasmer.io
6
6
  Project-URL: repository, https://github.com/wasmerio/shipit
@@ -2,10 +2,10 @@ shipit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  shipit/cli.py,sha256=k60mGxpBoyxYgdsFfosc3HuSm5m7Nus5I9RnAaP8X0E,60820
3
3
  shipit/generator.py,sha256=W4MynSFwId4PRWWrF0R3NsANye_Zv8TwXCUXai94pW0,6553
4
4
  shipit/procfile.py,sha256=GlfdwzFUr0GWGKaaiXlLKNFInWaRNMy_wN14UEyU_5Q,2974
5
- shipit/version.py,sha256=kFcU-e4oDxwCFdfvjlVkQgvkQaOBmtFeg-EaPmeM9c0,97
6
- shipit/assets/php/php.ini,sha256=9STxIKCYaku3rbfWP9VwUGaG40zuS6bCd_psNpx9BQk,2530
7
- shipit/assets/wordpress/install.sh,sha256=YyYzX43I_vlzAKcm7nSOSflxbEaLQgovnrle9oCkEyU,557
8
- shipit/assets/wordpress/wp-config.php,sha256=bqtT3ep1SfG9H2zdyYHACN4eehLBzYs4ZP0L-uiCWyQ,4179
5
+ shipit/version.py,sha256=SEO-RlxHRJwzrNq9nnUQaHiEEN2nAfsVlW1Q9R0SXPU,97
6
+ shipit/assets/php/php.ini,sha256=SaR3wvssSROtxTY_CQ5-BspM_47_I971V5X2dsqe8sU,2579
7
+ shipit/assets/wordpress/install.sh,sha256=h_Pbuj1nUqC0dE91yAYxeBiWf2oFbBWn0oCUkkosUsE,2498
8
+ shipit/assets/wordpress/wp-config.php,sha256=8M4C6xLI5ziX1udM7B-Ef3jd9xuMGVRve6cCuOgDT4o,4786
9
9
  shipit/providers/base.py,sha256=-lraLhnXtc2SfYNIUiyry7xD2NL4q0n6voNjr6qfRis,2994
10
10
  shipit/providers/gatsby.py,sha256=kzfS-z040GaJ0a9u2_6S6K-ykGSX2yPG17VpjUWBOBA,2393
11
11
  shipit/providers/hugo.py,sha256=l3IZ14LGYc3wQ7Uk0iQMDNN9Syd1G4HPzm0ePCGFyzE,1808
@@ -17,7 +17,7 @@ shipit/providers/python.py,sha256=kQpaaQi8ajHM_SFk2xI5lRIeOc6PXSKumb-Tv_5n6m0,20
17
17
  shipit/providers/registry.py,sha256=JCuQaYTvJcWK1nS-om9TIQgGW6pT5BuNLIRzChLLFWE,731
18
18
  shipit/providers/staticfile.py,sha256=hs8ER8rATTho8pBJ6b6ibaOqAfbNZKmlRqbalSdeYY0,2740
19
19
  shipit/providers/wordpress.py,sha256=6wd0wPBlE9DvNQgmcEKnH0TArGDkHfRvT9XhqnfOWTU,3258
20
- shipit_cli-0.10.0.dist-info/METADATA,sha256=94O3cZZT3pBMq20dhD7ph1-vljYQP--Wc6F8g83TId0,616
21
- shipit_cli-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- shipit_cli-0.10.0.dist-info/entry_points.txt,sha256=7AE1NjSrHaSDfbfsRRO50KKnHFTbB0Imsccd1WynzAQ,72
23
- shipit_cli-0.10.0.dist-info/RECORD,,
20
+ shipit_cli-0.10.1.dist-info/METADATA,sha256=7fCKb7M90W9ffVYj-XZEP0ig4Bv2KEJk5FjcvLR4HtE,616
21
+ shipit_cli-0.10.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
+ shipit_cli-0.10.1.dist-info/entry_points.txt,sha256=7AE1NjSrHaSDfbfsRRO50KKnHFTbB0Imsccd1WynzAQ,72
23
+ shipit_cli-0.10.1.dist-info/RECORD,,