Skip to content
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

Add Dockerfile for local development #60

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
###
# ```{rubric} GitHub Pages Workflow
# ```
# ---
# This is a basic workflow to help you get started with Actions.
#
# ```{literalinclude} /.github/workflows/pages.yml
# :language: yaml
# :start-at: "name: Test, Build, Deploy to GitHub Pages\n"
# :end-before: "###\n"
# ```
#
# Set a name for the workflow.
name: Test, Build, Deploy to GitHub Pages
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch: {}

###
# ```{rubric} Permissions Updates
# ```
# Enable read for contents and issues, and write for checks and PRs.
#
# ```{literalinclude} /.github/workflows/pages.yml
# :language: yaml
# :start-at: "permissions:\n"
# :end-before: "###\n"
# ```
permissions:
contents: read
issues: read
checks: write
pull-requests: write

###
# ```{rubric} Workflow Jobs
# ```
# ---
# A workflow run is made up of one or more
# jobs that can run sequentially or in parallel
#
jobs:
###
# ```{rubric} markdownlint
# ```
# ---
# Check that the markdown in this repo is up to our (arbitrary) standards.
#
# ```{literalinclude} /.github/workflows/pages.yml
# :language: yaml
# :start-at: "markdownlint:\n"
# :end-before: "###\n"
# ```
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Set up NodeJS
uses: actions/setup-node@main
- name: Install the checker
run: npm i -g markdownlint-cli2 markdownlint-cli2-formatter-junit --save-dev
- name: Lint the Markdown
run: markdownlint-cli2 **/*.md *.md
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: markdownlint
comment_title: "Markdown Lint"
files: markdownlint-cli2-junit.xml
###
# ```{rubric} Build GitHub Pages Site
# ```
# ---
# Build the pages site using Sphinx and upload the resulting artifact.
#
# ```{literalinclude} /.github/workflows/pages.yml
# :language: yaml
# :start-at: " build:\n"
# :end-before: "###\n"
# ```
build:
needs: markdownlint
runs-on: ubuntu-20.04
permissions:
contents: read
pages: write
id-token: write
steps:
- run: |
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install -y helm
- run: helm plugin install https://github.com/helm-unittest/helm-unittest
- uses: actions/checkout@main
with:
fetch-depth: 0
- uses: actions/setup-python@main
with:
python-version: 3.11
cache: pipenv
- name: Setup pages
uses: actions/configure-pages@main
- name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
- name: Install Python dependencies
run: |
pipenv install --dev
pipenv install -e .
- name: Build the static site
run: pipenv run sphinx-build -a -E . deploy
- name: Upload artifact
uses: actions/upload-pages-artifact@main
with:
path: './deploy'
###
# ```{rubric} Deploy the Pages site
# ```
# ---
# Download the artifact and deploy to pages.
#
# ```{literalinclude} /.github/workflows/pages.yml
# :language: yaml
# :start-at: " pages:\n"
# ```
pages:
needs: build
runs-on: ubuntu-20.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Download pages artifact
id: download
uses: actions/download-artifact@main
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
symenv_debug.log
reflog
21 changes: 13 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
# symenv

## [1.2.16] - 2022-05-24
## [1.2.17](https://github.com/platonic-io/symenv/releases/tag/v1.2.17)

### Added
### Fixed 1.2.17 - 2022-07-20

- Fixed artifact ordering by expecting 0s in the artifact counter (#53)

## [1.2.16](https://github.com/platonic-io/symenv/releases/tag/v1.2.16)

### Added - 2022-05-24

- Login function which is independent from any other commands.

## [1.2.13] - 2020-03-30
## [1.2.13](https://github.com/platonic-io/symenv/releases/tag/v1.2.13)

### Removed
### Removed 1.2.13 - 2022-03-29

- Remove ability to install VSCode extension

### Fixed
### Fixed 1.2.13

- Symenv timeout issue with auth requests. It will timeout in 30 seconds now

## [1.2.12](https://github.com/platonic-io/symenv/releases/tag/v1.2.12)

## [1.2.12] - 2020-03-28

### Fixed
### Fixed 1.2.12 - 2020-03-28

- Add error catching for package download failures
- Extract package tar directly to correct directory
118 changes: 102 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,126 @@
###### Development
# Readme

## Usage

The simplest way to get up and running is with
[Docker](https://www.docker.com/products/docker-desktop/).

1. Pull the most recent version of the symenv image.

```shell
docker pull ghcr.io/platonic-io/symenv:latest
```

2. Run the container on your local system with either bash or zsh.

```shell
# Use Bash
docker run --name symenv -it "ghcr.io/platonic-io/symenv:$(git describe --tags --abbrev=0)" bash

# Use zsh -- Note that zsh is not officially supported.
docker run --name symenv -it "ghcr.io/platonic-io/symenv:$(git describe --tags --abbrev=0)" zsh
```

3. Use the shell provided by the container to authenticate.

```shell
symenv login --registry=portal.platonic.io
```

4. List the available versions.

```shell
symenv ls-remote
```

This should produce a list of available versions similar to the following.

```shell
v2.0.0
v2.0.1
v2.0.2
v2.0.3
v3.0.0
v4.0.0
v4.1.0
```

5. Install one or more of the available versions.

```shell
symenv install v4.1.0
```

6. Use the assembly.

## Development

Prerequisites:

- `curl` or `wget`
- `jq`
- an account for Symbiont's portal

```shell
source ./test.sh
```
### Development Usage

For usage against the staging portal, append a `--registry=<registry>` to commands that perform remote operations. Note that
you will also need to use a token created by said registry in order for authentication to work. If need be, use `symenv reset`
to clear your authentication token.
```shell
symenv install --registry=portal-staging.waf-symbiont.io
```
1. Prepare the environment.

```shell
source ./test.sh
```

You should see output similar to this.

```shell
=> Downloading symenv as script to '/root/.symbiont'
[1]- Done symenv_download -s "$SYMENV_SOURCE_LOCAL" -o "$INSTALL_DIR/symenv.sh" || { symenv_echo "Failed to download '$SYMENV_SOURCE_LOCAL'" 1>&2; return 1; }
[2]+ Done symenv_download -s "$SYMENV_BASH_COMPLETION_SOURCE" -o "$INSTALL_DIR/bash_completion" || { symenv_echo "Failed to download '$SYMENV_BASH_COMPLETION_SOURCE'" 1>&2; return 2; }

=> Append to profile file then close and reopen your terminal to start using symenv or run the following to use it now:

export SYMENV_DIR="$HOME/.symbiont"
[ -s "$SYMENV_DIR/symenv.sh" ] && \. "$SYMENV_DIR/symenv.sh" # This loads symenv
[ -s "$SYMENV_DIR/versions/current" ] && export PATH="$SYMENV_DIR/versions/current/bin":$PATH # This loads symenv managed SDK
[ -s "$SYMENV_DIR/bash_completion" ] && \. "$SYMENV_DIR/bash_completion" # This loads symenv bash_completion
```

2. Choose a registry by appending the `--registry=portal.platonic.io` flag to commands
that perform remote operations.

> Note that you will also need to use a token created by said registry
> in order for authentication to work.
>
> If need be, use `symenv reset` to clear your authentication token.

3. Install the environment.

###### Installation
```shell
symenv install --registry=portal.platonic.io v4.1.0
```

### Docker Usage

You can find information on how to build and run a container with symenv [here](docker/README.md).

## Installation

Prerequisites:

- `curl` or `wget`
- `jq`
- an account for Symbiont's portal

Remotely

```shell
curl --proto '=https' --tlsv1.2 -sSf https://<host>/<path>/install.sh | bash
```

eg.
```shell
# Example

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/symbiont-io/symenv/main/install.sh | bash
```

###### Commands
### Commands

```help
Usage:
Expand All @@ -52,4 +139,3 @@ Usage:
--all Include the non-release versions
symenv reset Resets your environment to a fresh install of symenv
```

2 changes: 1 addition & 1 deletion auth_example_flow.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash

CODE_REQUEST_RESPONSE=$(curl --silent --proto '=https' --tlsv1.2 --request POST \
--url "https://internal-portal.us.auth0.com/oauth/device/code" \
Expand Down
25 changes: 25 additions & 0 deletions docker/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# shellcheck disable=SC1091

CLICOLOR=1
# shellcheck disable=SC2016
LESS='-R --use-color -Dd+r$Du+b$'
LSCOLORS="Ea"
PS1='[\[\e[31m\]\u\[\e[0m\]@\[\e[32m\]\H\[\e[0m\]:\[\e[33m\]\w\[\e[0m\]]{\[\e[34m\]$?\[\e[0m\]}\$ '
SYMENV_DIR="$HOME/.symbiont"

# shellcheck disable=SC1091
if [ -f /usr/share/bash-completion/bash_completion ]; then
source /usr/share/bash-completion/bash_completion
fi

PATH="$SYMENV_DIR/versions/current/bin:$PATH"

. "$HOME/.symbiont/symenv.sh"
. "$HOME/.symbiont/bash_completion"

export CLICOLOR
export LESS
export LSCOLORS
export PS1
export PATH
18 changes: 18 additions & 0 deletions docker/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/zsh

export SYMENV_DIR="$HOME/.symbiont"

# This loads symenv
if [ -f "$SYMENV_DIR/symenv.sh" ]; then
source "$SYMENV_DIR/symenv.sh"
fi

# This loads symenv managed SDK
if [ -f "$SYMENV_DIR/versions/current" ]; then
export PATH="$SYMENV_DIR/versions/current/bin":$PATH
fi

# This loads symenv bash_completion
if [ -f "$SYMENV_DIR/bash_completion" ]; then
source "$SYMENV_DIR/bash_completion"
fi
Loading