Skip to content

Commit

Permalink
2.0 Release: Allow spin to configure production servers (#24)
Browse files Browse the repository at this point in the history
* 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 <jay@521dimensions.com>

* 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 <dan@521dimensions.com>

* 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 <dan@521dimensions.com>
  • Loading branch information
jaydrogers and danpastori authored Jan 4, 2024
1 parent 8f9e192 commit 7209749
Show file tree
Hide file tree
Showing 221 changed files with 18,209 additions and 474 deletions.
134 changes: 134 additions & 0 deletions .github/code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders 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, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

Binary file modified .github/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/spin-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions .github/workflows/action_marketing-site-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Site Deployment - Preview 👨‍🔬

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- docs/**

jobs:
publish-preview-site:
uses: ./.github/workflows/service_deploy-static-site.yml
secrets: inherit
with:
environment-name: 'ssu-spin (Preview)'
14 changes: 14 additions & 0 deletions .github/workflows/action_marketing-site-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Site Deployment - Production 🚀
on:
push:
branches:
- main
paths:
- docs/**

jobs:
publish-production-site:
secrets: inherit
uses: ./.github/workflows/service_deploy-static-site.yml
with:
environment-name: 'ssu-spin (Production)'
30 changes: 6 additions & 24 deletions .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
name: publish-beta

on:
workflow_dispatch:
release:
types: [prereleased]

jobs:
publish:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [16]
fail-fast: true

steps:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org/

- name: checkout
uses: actions/checkout@v2

- name: Publish BETA build
run: npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN_SECRET}}

publish-prerelease:
uses: ./.github/workflows/service_publish-node-package.yml
with:
release-tag: beta
secrets: inherit
30 changes: 6 additions & 24 deletions .github/workflows/publish-stable-release.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
name: publish-stable

on:
workflow_dispatch:
release:
types: [released]

jobs:
publish:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [16]
fail-fast: true

steps:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org/

- name: checkout
uses: actions/checkout@v2

- name: Publish STABLE build
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN_SECRET}}

publish-stable-release:
uses: ./.github/workflows/service_publish-node-package.yml
with:
release-tag: latest
secrets: inherit
48 changes: 48 additions & 0 deletions .github/workflows/service_deploy-static-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
workflow_call:
inputs:
environment-name:
required: true
type: string

jobs:
deploy-static-site:
runs-on: ubuntu-22.04
permissions:
contents: read
deployments: write
environment:
name: ${{ inputs.environment-name }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: './docs/.nvmrc'

- name: Set env file
run: |
if [[ -z "$BASE_64_SECRET" ]]; then
echo '🚨🚨🚨 ENV File not set 🚨🚨🚨' 1>&2
exit 1
fi
echo $BASE_64_SECRET | base64 -d > .env
working-directory: ./docs
env:
BASE_64_SECRET: ${{ secrets.ENV_FILE_BASE64 }}

- run: |
yarn install --frozen-lockfile
yarn build
npx nuxi generate
working-directory: ./docs
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ssu-spin
directory: docs/.output/public
branch: ${{ github.head_ref || github.ref_name }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/service_publish-node-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
workflow_call:
inputs:
runs-on:
required: false
type: string
default: 'ubuntu-22.04'
node-version:
required: false
type: string
default: '18'
release-tag:
required: true
type: string

jobs:
publish:
runs-on: ${{ inputs.runs-on }}

steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
registry-url: https://registry.npmjs.org/

- name: checkout
uses: actions/checkout@v4

- name: Set NPM version (${{ github.ref_name }}).
run: npm version --git-tag-version=false --commit-hooks=false ${{ github.ref_name }}

- name: Publish release (${{ inputs.release-tag }})
run: npm publish --access public --tag ${{ inputs.release-tag }}
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN_SECRET}}
2 changes: 1 addition & 1 deletion .github/workflows/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- cron: 30 15 * * 0-6
jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor/
/node_modules/
/node_modules/
.env*
7 changes: 6 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
tools/
conf/
conf/
cache/
docs/
.env*
.github/
tools/
Loading

0 comments on commit 7209749

Please sign in to comment.