Skip to content

Commit 7209749

Browse files
2.0 Release: Allow spin to configure production servers (#24)
* Initial commit for 2.0 release * Initial commit of the docs site * Ignore docs on NPM * Ignore unnecessary files on packaging * Added CloudFlare pages * Test deployment * Remove CF Pages Actions * Added node version * Updated OG data * Added social image * Added macOS installation instructions * Added Windows instructions * Added linux instructions * Original documents for composer and yarn * Changed to PHP 8.2 (#28) * Fixed function reference * Added command reference * Added simple templates * Updated templates * Added "spin stop" * Clarified error * Fixed upgrade call * Fixed spin stop and spin kill logic * Removed quotes to prevent from command not running correctly * Clarified Linux install notes * Clarity adjustment * Restructured files * Set permissions * Fixed actions reference * Moved variable * Updated "spin new" and added "spin latest" * Added improved CI workflow * Changed to Discord * Added help * Improved update logic * Improved logic * Renamed cache files * Added prompt to check for updates * Improved interval function * Fixed save_current_time_to_cache_file function * Lots of improvements and sanity checks * Prevent commands for checking for a compose file * Organized function * Added installation detection * Improved updating * Added example configuration * Organized templates * Moved template files * Renamed tempalte * Updated install script * Fixed compose check logic * Removed escape * Support pull cache for multiple projects * Improved pulling experience * Added Spin Pull command * Updated description * Remove compose check for spin kill * Added prune command * Fix cache creation bug * Set cleaner debugger * Added docker compose yml default * Fixed development logic * Remove orphans on run * Fixed logic * Improved error handling * Removed shift from exec * Support multiple envs * Added SPIN_USER_ID and SPIN_GROUP_ID * Added debugging * Renamed to compose file * Added spin ENV * Added user permissions * Remove user id * Fix auto-update and auto-pull functionality * Updated header * Clear spin cache * Update title in stop.md file * Update PHP version to beta-8.3-cli * Refactor prune.sh script to improve cache clearing * Update PHP tag to beta-cli * Prevent "new" from checking for a docker compose file * Set LOG_LEVEL=off * Remove duplicate LOG_LEVEL environment variable * Updated Windows documentation * Update SPIN_HOME default value * Update BRANCH variable in install.sh script * Update Spin installation version in setup_spin function * Refactor get_latest_release function to get_install_version * Fix default value for BRANCH variable * Update Spin clone message to include version * Enable verbose output in install.sh script * Fix installation script and return branch version * Fix typo in install.sh * Add contributing documentation and installation instructions for Spin * Update Spin installation and upgrade scripts with sparse checkout * Add new images and update installation instructions for Spin * Update Spin installation script URLs * Refactor Spin installation script to improve performance * Remove update from Docker check * Update Spin clone command in install.sh * Remove whitespace * Remove templates * Add init action and check for Docker running This commit adds a new `init` action to the `spin` script, which initializes the spin environment. Additionally, a new function `check_if_docker_is_running` is added to check if Docker is running before using `spin`. This ensures that Docker is properly set up before executing any commands. * Refactor project creation commands * Refactor function name to install_spin_package_to_project() * Updated Documentation Site to Nuxt 3.8 (#38) * Updated package to 3.8 for Nuxt * Nuxt Upgrade, OG Images, ready for testing * Update .env.example file with BASE_PATH configuration * Add workflows for site deployment --------- Co-authored-by: Jay Rogers <[email protected]> * Update environment names for marketing site workflows * Test CI * Test CI * Added test * Removed test * Updated code panel * Added templates * Working spin new and spin init * Added spin vault * Update default images in spin script * Updated variables to be set * Remove docker name * Remove container name * Fix password encryption in .spin.example.yml * Fix typo in encryption prompt * Refactor spin script to skip compose check for certain commands * Refactor init.sh script and add .spin.inventory.ini file * Add common server configuration and user templates * Refactor template copying and add to .gitignore * Add .gitignore line in init.sh and copy common files * Fix path in docker run command * Organized common template * Refactor vault.sh script to handle local and Docker environments * Refactor vault.sh script and add show_help function * Add provision command to spin script * Fix encryption file name in init.sh * Update .gitignore file to use correct name for vault password file * Add spin-inventory.ini file with server configurations * Add provision script and run_ansible function This commit adds a new provision script and a run_ansible function to the codebase. The provision script installs the required Ansible roles and runs the playbook. The run_ansible function sets up the necessary configurations for running Ansible commands in a Docker container. * Update SPIN_ANSIBLE_IMAGE to use Ubuntu instead of Alpine * Add .gitignore file to spin collections * Update vault_run_command in vault.sh * Add 'vault' command to the list of allowed commands * Updated inventory template * Refactor encryption check and provision script * Add default config and inventory files from GitHub * Remove spin inventory and configuration files * Update SPIN_ANSIBLE_IMAGE to version 2.15-alpine-3.18 * Update runs-on to ubuntu-22.04 in workflows * Add base64 encoding and decoding functionality * Working templates * Remove unnecessary environment variable from run.sh * Fix permission issues in development and set "www-data" user to the same UID as the developer's user * Add PHP action and default users * Update Docker user and group settings * Refactor file copying and encryption process * Add support for linux/amd64 platform in Docker run command * Add .dockerignore.lineinfile template file * Refactored init script * Fix grep command in init.sh to suppress error output * Add .infrastructure to .dockerignore * Fix permission issues in development by setting the "www-data" user to the same user and group that is running docker * Update user and group IDs in Docker commands * Add support for GitHub Action templates and update Docker image references * Remove unnecessary comment in install_spin_package_to_project function * Encrypt files with Ansible Vault and ensure ownership * Add support for --version and -v options in spin script * Fix Docker run command in init.sh * Refactored main command * Update Docker volume mount path in init.sh * Add support for remote user argument in provision script * Update Dockerfile to handle dynamic group ID * Set to user mod * Added docker-php-serversideup-set-id * Update shell type in install and upgrade scripts * Update SPIN_HOME path in install.sh * Fix SPIN_HOME variable in install.sh * Update install.sh script to use bash instead of sh * Update shell environment output in install.sh * Update index and installation documentation * Update installation instructions for Spin on Windows and Linux * Update PATH configuration for Spin installation * Refactor template file path handling in init.sh * Update installation instructions for Composer and NPM/Yarn * Added YouTube video * Removed "php" command * Add options to run latest stable versions of PHP and Node * Updated formatting of code reference * Add base64 command reference to documentation * Add spin vault command reference to documentation * Update vault command documentation * Update docker run command to include user ID and group ID * Updated Readme * Docs WIP * Create new Landing page for Spin (#40) * Create branch * Landing page ready for testing * Added video embed component * Added titles --------- Co-authored-by: Dan Pastori <[email protected]> * Added full size image * Responsive image component added * Changed text color Ref #42 * Updated README * Added code of conduct and changed images * Updated OG image * Fixed links * Added GitHub link * Added GIthub * Added more detail * Set proper versions for deployment * Added detail how Spin works * Added pre-requisites * Added help menu * Added requirements * Added demo * Added Dockerfile support * Added common services * Adde ini * Added guides for generating assets * Added server config documentation * Moved order * Mvoed * Added GitHub Actions docs * Added docs * Fixed init * Added existing project documentation * Add contributing guidelines * Added main content * Update link to mkpasswd in .spin.yml * Add latest for Spin --------- Co-authored-by: Dan Pastori <[email protected]>
1 parent 8f9e192 commit 7209749

File tree

221 files changed

+18209
-474
lines changed

Some content is hidden

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

221 files changed

+18209
-474
lines changed

.github/code_of_conduct.md

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official e-mail address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement at
64+
[INSERT CONTACT METHOD].
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations
134+

.github/header.png

37.8 KB
Loading

.github/spin-diagram.png

48.1 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Site Deployment - Preview 👨‍🔬
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
paths:
7+
- docs/**
8+
9+
jobs:
10+
publish-preview-site:
11+
uses: ./.github/workflows/service_deploy-static-site.yml
12+
secrets: inherit
13+
with:
14+
environment-name: 'ssu-spin (Preview)'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Site Deployment - Production 🚀
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- docs/**
8+
9+
jobs:
10+
publish-production-site:
11+
secrets: inherit
12+
uses: ./.github/workflows/service_deploy-static-site.yml
13+
with:
14+
environment-name: 'ssu-spin (Production)'
+6-24
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
11
name: publish-beta
22

33
on:
4+
workflow_dispatch:
45
release:
56
types: [prereleased]
67

78
jobs:
8-
publish:
9-
runs-on: ${{ matrix.os }}
10-
11-
strategy:
12-
matrix:
13-
os: [ubuntu-latest]
14-
node: [16]
15-
fail-fast: true
16-
17-
steps:
18-
- name: Setup Node.js
19-
uses: actions/setup-node@v2
20-
with:
21-
node-version: ${{ matrix.node }}
22-
registry-url: https://registry.npmjs.org/
23-
24-
- name: checkout
25-
uses: actions/checkout@v2
26-
27-
- name: Publish BETA build
28-
run: npm publish --access public --tag beta
29-
env:
30-
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN_SECRET}}
31-
9+
publish-prerelease:
10+
uses: ./.github/workflows/service_publish-node-package.yml
11+
with:
12+
release-tag: beta
13+
secrets: inherit
+6-24
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
11
name: publish-stable
22

33
on:
4+
workflow_dispatch:
45
release:
56
types: [released]
67

78
jobs:
8-
publish:
9-
runs-on: ${{ matrix.os }}
10-
11-
strategy:
12-
matrix:
13-
os: [ubuntu-latest]
14-
node: [16]
15-
fail-fast: true
16-
17-
steps:
18-
- name: Setup Node.js
19-
uses: actions/setup-node@v2
20-
with:
21-
node-version: ${{ matrix.node }}
22-
registry-url: https://registry.npmjs.org/
23-
24-
- name: checkout
25-
uses: actions/checkout@v2
26-
27-
- name: Publish STABLE build
28-
run: npm publish --access public
29-
env:
30-
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN_SECRET}}
31-
9+
publish-stable-release:
10+
uses: ./.github/workflows/service_publish-node-package.yml
11+
with:
12+
release-tag: latest
13+
secrets: inherit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
environment-name:
5+
required: true
6+
type: string
7+
8+
jobs:
9+
deploy-static-site:
10+
runs-on: ubuntu-22.04
11+
permissions:
12+
contents: read
13+
deployments: write
14+
environment:
15+
name: ${{ inputs.environment-name }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version-file: './docs/.nvmrc'
22+
23+
- name: Set env file
24+
run: |
25+
if [[ -z "$BASE_64_SECRET" ]]; then
26+
echo '🚨🚨🚨 ENV File not set 🚨🚨🚨' 1>&2
27+
exit 1
28+
fi
29+
echo $BASE_64_SECRET | base64 -d > .env
30+
working-directory: ./docs
31+
env:
32+
BASE_64_SECRET: ${{ secrets.ENV_FILE_BASE64 }}
33+
34+
- run: |
35+
yarn install --frozen-lockfile
36+
yarn build
37+
npx nuxi generate
38+
working-directory: ./docs
39+
40+
- name: Publish to Cloudflare Pages
41+
uses: cloudflare/pages-action@v1
42+
with:
43+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
44+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
45+
projectName: ssu-spin
46+
directory: docs/.output/public
47+
branch: ${{ github.head_ref || github.ref_name }}
48+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
runs-on:
5+
required: false
6+
type: string
7+
default: 'ubuntu-22.04'
8+
node-version:
9+
required: false
10+
type: string
11+
default: '18'
12+
release-tag:
13+
required: true
14+
type: string
15+
16+
jobs:
17+
publish:
18+
runs-on: ${{ inputs.runs-on }}
19+
20+
steps:
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: ${{ inputs.node-version }}
25+
registry-url: https://registry.npmjs.org/
26+
27+
- name: checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Set NPM version (${{ github.ref_name }}).
31+
run: npm version --git-tag-version=false --commit-hooks=false ${{ github.ref_name }}
32+
33+
- name: Publish release (${{ inputs.release-tag }})
34+
run: npm publish --access public --tag ${{ inputs.release-tag }}
35+
env:
36+
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN_SECRET}}

.github/workflows/sponsors.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- cron: 30 15 * * 0-6
66
jobs:
77
deploy:
8-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-22.04
99
steps:
1010
- name: Checkout 🛎️
1111
uses: actions/checkout@v2

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor/
2-
/node_modules/
2+
/node_modules/
3+
.env*

.npmignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
tools/
2-
conf/
2+
conf/
3+
cache/
4+
docs/
5+
.env*
6+
.github/
7+
tools/

0 commit comments

Comments
 (0)