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

14 redesign gitlab ci platform for testing #19

Merged
merged 4 commits into from
May 1, 2024
Merged
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
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# shellcheck disable=SC2148 disable=SC2034
LOG_LEVEL=0
LOG_DIR=tmp
SHELL_DIR=shell
CODECOV_TOKEN="<YOUR_CODECOV_TOKEN>"
GITHUB_TOKEN="<YOUR_GITHUB_TOKEN>"
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }} # required for private repos
directory: coverage
flags: unittests # optional
name: codecov-wild # optional
name: codecov-wizard # optional
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/test/gitlab/home/
/test/jenkins/home/
/test/jenkins/config/secrets.properties
/infra/jenkins/config/secrets.properties
/test/jenkins/config/secrets.yaml
/test/jenkins/config/exported-jenkins.yaml
/tmp/
.DS_Store
Expand Down
7 changes: 7 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ~/.shellcheckrc

external-sources=true
source-path="./shell"

# Suggest ${VAR} in place of $VAR
enable=require-variable-braces
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library identifier: "wild@17-add-more-configurations-on-workflow-pipeline", retriever: modernSCM(
library identifier: "wizard@14-redesign-gitlab-ci-platform-for-testing", retriever: modernSCM(
[$class: 'GitSCMSource',
remote: 'https://github.com/scalastic/wild.git',
credentialsId: 'wild-github-token']) _
remote: 'https://github.com/scalastic/wizard.git',
credentialsId: 'wizard-github-token']) _

wildPipeline()
wizardPipeline()
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

![Wizard](docs/images/wizard.png)

[![License](https://img.shields.io/github/license/scalastic/wild.svg?style=flat-square)](https://github.com/scalastic/wild/blob/master/LICENSE)
[![License](https://img.shields.io/github/license/scalastic/wizard.svg?style=flat-square)](https://github.com/scalastic/wizard/blob/master/LICENSE)
[![bash](https://img.shields.io/badge/bash-4.4%2B-brightgreen)](https://www.gnu.org/software/bash/)
[![Test and Code Coverage](https://github.com/scalastic/wild/actions/workflows/workflow.yml/badge.svg?branch=main)](https://github.com/scalastic/wild/actions/workflows/workflow.yml)
[![codecov](https://codecov.io/gh/scalastic/wild/branch/main/graph/badge.svg?token=KO9TRVNQWE)](https://codecov.io/gh/scalastic/wild)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/scalastic/wild)](https://img.shields.io/github/v/release/scalastic/wild)
[![GitHub stars](https://img.shields.io/github/stars/scalastic/wild?style=social)](https://img.shields.io/github/stars/scalastic/wild?style=social)
[![GitHub forks](https://img.shields.io/github/forks/scalastic/wild?style=social)](https://img.shields.io/github/forks/scalastic/wild?style=social)
[![Test and Code Coverage](https://github.com/scalastic/wizard/actions/workflows/workflow.yml/badge.svg?branch=main)](https://github.com/scalastic/wizard/actions/workflows/workflow.yml)
[![codecov](https://codecov.io/gh/scalastic/wizard/branch/main/graph/badge.svg?token=KO9TRVNQWE)](https://codecov.io/gh/scalastic/wizard)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/scalastic/wizard)](https://img.shields.io/github/v/release/scalastic/wizard)
[![GitHub stars](https://img.shields.io/github/stars/scalastic/wizard?style=social)](https://img.shields.io/github/stars/scalastic/wizard?style=social)
[![GitHub forks](https://img.shields.io/github/forks/scalastic/wizard?style=social)](https://img.shields.io/github/forks/scalastic/wizard?style=social)

# Wizard - The Magical Integration Framework

Expand Down Expand Up @@ -43,9 +43,9 @@ Embrace the enchantment of Wizard to fill the void in the DevOps approach and em

Currently, `Wizard` is tailored for seamless use on the following platforms:

- Your local environment (Unix-based systems)
- Jenkins
- GitLab-CI
- [ ] Your local environment (Unix-based systems)
- [x] Jenkins
- [ ] GitLab-CI (_WIP_)

Please note that our magical integration framework may expand its compatibility with more platforms in the future. Stay tuned for updates!

Expand All @@ -59,7 +59,7 @@ In order to utilize `Wizard` on your local machine, the following prerequisites

## Installation

### Install with Homebrew
### Install with Homebrew (_WIP_)

```bash
brew tap scalastic/tap
Expand All @@ -76,26 +76,26 @@ git clone

## Wizard CLI

### Usage
### Usage (_WIP_)

```bash
wizard [options] [command]
```

### Command options

| Option | Description |
| --- | --- |
| -h, --help | Display help for command |
| -v, --version | Display version of Wild |
| -d, --debug | Display debug information |
| -q, --quiet | Do not display any output |
| Option | Description |
| --- |---------------------------------------|
| -h, --help | Display help for command |
| -v, --version | Display version of Wizard |
| -d, --debug | Display debug information |
| -q, --quiet | Do not display any output |
| -c, --config | Specify the configuration file to use |
| -p, --project | Specify the project directory to use |
| -l, --log | Specify the log file to use |
| -t, --trace | Specify the trace file to use |
| -e, --env | Specify the environment file to use |
| -i, --input | Specify the input file to use |
| -p, --project | Specify the project directory to use |
| -l, --log | Specify the log file to use |
| -t, --trace | Specify the trace file to use |
| -e, --env | Specify the environment file to use |
| -i, --input | Specify the input file to use |

## Project directory

Expand Down Expand Up @@ -148,7 +148,7 @@ wizard [options] [command]

- [Semantic Versioning](https://semver.org/) - Semantic Versioning 2.0.0.

### Contributions
### Contributions (_WIP_)

All contributions are welcome!

Expand Down
4 changes: 2 additions & 2 deletions config/json-schema/workflow-schema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://scalastic.io/workflow.schema.json",
"title": "Wild",
"description": "A workflow definition in Wild",
"title": "Wizard",
"description": "A workflow definition in Wizard",
"version": "0.0.1",
"type": "object",
"properties": {
Expand Down
4 changes: 2 additions & 2 deletions config/k8s/containers-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ metadata:
pipeline: jenkinsfile
spec:
containers:
- name: 'wild'
image: scalastic/wild
- name: 'wizard'
image: scalastic/wizard
command:
- cat
tty: true
Expand Down
2 changes: 1 addition & 1 deletion config/workflow-default.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "wild-test-001",
"id": "wizard-test-001",
"name": "Sample Workflow for Testing",
"version": "1.0.0",
"actions": [
Expand Down
14 changes: 7 additions & 7 deletions contrib/build.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env bash
#
# Inline Wild script and act as a wrapper.
# Inline Wizard script and act as a wrapper.
# This script is for release purposes.

set -euo pipefail

export WILD_CWD="${PWD}"
export WIZARD_CWD="${PWD}"

mkdir -p ./bin
rm -f ./bin/wild
./src/lib/ext/inline.sh --in-file ./src/wild.sh --out-file ./bin/wild
grep -Ev "^[[:blank:]]*#[^!]|^[[:blank:]]*$" ./bin/wild > ./bin/wild.tmp
mv ./bin/wild.tmp ./bin/wild
chmod u+x ./bin/wild
rm -f ./bin/wizard
./src/lib/ext/inline.sh --in-file ./src/wizard.sh --out-file ./bin/wizard
grep -Ev "^[[:blank:]]*#[^!]|^[[:blank:]]*$" ./bin/wizard > ./bin/wizard.tmp
mv ./bin/wizard.tmp ./bin/wizard
chmod u+x ./bin/wizard

echo "ok"
2 changes: 1 addition & 1 deletion contrib/make_doc.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Generates Wild source code documentation.
# Generates Wizard source code documentation.

set -euo pipefail

Expand Down
12 changes: 6 additions & 6 deletions contrib/make_package_json.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#!/usr/bin/env bash
#
# Creates a package.json file for Wild
# Creates a package.json file for Wizard

export LANG=C

version() {
./bin/wild --version
./bin/wizard --version
}

files() {
echo "["
files="$(find src -not -path "*lib/ext*" \( -type f -o -type l \) -exec echo " \"{}\"," \; | sort)"
files="$(find src -not -path "*lib/ext*" -not -name ".DS_Store" \( -type f -o -type l \) -exec echo " \"{}\"," \; | sort)"
echo "${files%,}"
echo " ]"
}

cat<<JSON
{
"name": "Wild",
"name": "Wizard",
"version": "$(version)",
"description": "Wild fills the missing link of the DevOps approach and its shift-left principal herein. With Wild the shifts are so close to the developer that they no longer exist.",
"description": "Welcome to Wizard, a versatile and magical framework that empowers you to effortlessly execute uniform integration scripts both locally and on your server.",
"homepage": "https://scalastic.io/en/",
"scripts": ["wild"],
"scripts": ["wizard"],
"license": "MIT",
"files": $(files),
"install": "make install"
Expand Down
2 changes: 1 addition & 1 deletion contrib/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ is_prerelease() {
return 1
}

version=$(bin/wild --version)
version=$(bin/wizard --version)

confirm "Release $version?" || exit 0
run git tag -s -a "$version" -m "$version"
Expand Down
2 changes: 1 addition & 1 deletion docker/basic/alpine/Dockerfile.02
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM bash:latest

LABEL Author="wild by scalastic"
LABEL Author="wizard by scalastic"

RUN apk update \
&& apk add --no-cache curl jq \
Expand Down
2 changes: 1 addition & 1 deletion docker/basic/alpine/Dockerfile.03
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:latest

LABEL Author="wild by scalastic"
LABEL Author="wizard by scalastic"

# make sure the package repository is up to date
RUN set -ex \
Expand Down
2 changes: 1 addition & 1 deletion docker/basic/scratch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:latest as downloader

ENV JQ_VERSION jq-1.6/jq-linux64
LABEL Author="wild by scalastic"
LABEL Author="wizard by scalastic"

RUN apk add --no-cache curl ca-certificates

Expand Down
2 changes: 1 addition & 1 deletion docker/basic/ubi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM redhat/ubi9:9.2

LABEL Author="WILD by Scalastic"
LABEL Author="WIZARD by Scalastic"

RUN yum install jq -y
4 changes: 2 additions & 2 deletions docker/build-all-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -euo pipefail

docker build -t scalastic/wild:latest "./docker/basic/ubi/"
docker build -t scalastic/wizard:latest "./docker/basic/ubi/"

docker push scalastic/wild:latest
docker push scalastic/wizard:latest
Binary file added docs/images/wizard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/src/lib/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Common functions used in stage scripts

---------------------------------------
*Generated from [src/lib/common.sh](../../../src/lib/common.sh) on 08.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
*Generated from [src/lib/common.sh](../../../src/lib/common.sh) on 18.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
6 changes: 5 additions & 1 deletion docs/src/lib/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ Logger functions for bash scripts
log__log "$LOG_LEVEL_DEBUG" "This is a debug message" "$LOG_LEVEL_DEBUG_COLOR" "$LOG_COLOR_OFF"
```

* Output

* `stdout`: Redirects and writes the message to stderr and file log/stdout.log

### `log__banner 🚫 (private)`

* Log a banner message.
Expand Down Expand Up @@ -211,4 +215,4 @@ log_banner "This is a banner message"
* `stdout`: Writes the banner message to stdout

---------------------------------------
*Generated from [src/lib/log.sh](../../../src/lib/log.sh) on 08.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
*Generated from [src/lib/log.sh](../../../src/lib/log.sh) on 18.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
2 changes: 1 addition & 1 deletion docs/src/lib/platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ platform_get_platform
* `stdout`: The platform where the script is running

---------------------------------------
*Generated from [src/lib/platform.sh](../../../src/lib/platform.sh) on 08.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
*Generated from [src/lib/platform.sh](../../../src/lib/platform.sh) on 18.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
2 changes: 1 addition & 1 deletion docs/src/lib/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ project__architecture_print_layers
* `stdout`: The project architecture layers as a formatted string

---------------------------------------
*Generated from [src/lib/project.sh](../../../src/lib/project.sh) on 08.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
*Generated from [src/lib/project.sh](../../../src/lib/project.sh) on 18.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
2 changes: 1 addition & 1 deletion docs/src/lib/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ tooling_set_jq
### `tooling_get_ip ✅ (public)`

---------------------------------------
*Generated from [src/lib/tooling.sh](../../../src/lib/tooling.sh) on 08.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
*Generated from [src/lib/tooling.sh](../../../src/lib/tooling.sh) on 18.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
2 changes: 1 addition & 1 deletion docs/src/lib/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ workflow_load_action_definition "action1" "config/workflow-default.json"
* `return`: Action definition as an array

---------------------------------------
*Generated from [src/lib/workflow.sh](../../../src/lib/workflow.sh) on 08.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
*Generated from [src/lib/workflow.sh](../../../src/lib/workflow.sh) on 18.09.2023 (writen with ✨ by [gendoc](../../../src/lib/ext/gendoc.sh))*
2 changes: 1 addition & 1 deletion helm/create-ca-tls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

set -euo pipefail

COMPANY_NAME=${1:-scalastic}
COMPANY_NAME=${1:-macompanie}
CERT_CA_PATH="${CERT_CA_PATH:=openssl/ca}"

echo "Creating CA certificate..."
Expand Down
Loading
Loading