Commit 7bde1638 authored by Gyanendra Mishra's avatar Gyanendra Mishra Committed by GitHub

Initial commit

parents
version: 2.1
orbs:
npm-publisher: uraway/npm-publisher@0.2.0
kurtosis-docs-checker: kurtosis-tech/docs-checker@0.2.0
parameters:
go-version:
type: string
default: 1.16
node-version:
type: string
default: 16.13.0
# NOTE: Because CircleCI jobs run on separate machines from each other, we duplicate steps (like checkout) between jobs. This is because doing the "correct" DRY
# refactoring of, "one job for checkout, one job for build Docker image, etc." would require a) persisting files between jobs and b) persisting Docker images between
# jobs. Both are annoying (saving/loading workspaces require re-downloading the workspace over the network, and there doesn't seem to be a good way to do Docker
# images), so we run everything inside a single job.
# See also: https://discuss.circleci.com/t/can-docker-images-be-preserved-between-jobs-in-a-workflow-without-a-manual-load-save/23388/12
jobs:
check_golang:
docker:
- image: "cimg/go:<< pipeline.parameters.go-version>>"
steps:
- checkout
# If the only changes are to the docs, don't run the slow (and expensive) code checks
# `git diff --exit-code` returns 0 exit code if no changes, and 1 if changes
- run: |
if git --no-pager diff --exit-code origin/develop...HEAD -- . ':!docs'; then
circleci-agent step halt
fi
# The 'git config' and 'go env' steps are to allow Go to read modules from our private Github repos
# The KURTOSISBOT_GITHUB_TOKEN is a secret provided at CI build time
- run: |
git config --global url."https://${KURTOSISBOT_GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
go env -w "GOPRIVATE=github.com/kurtosis-tech/*"
golang/scripts/build.sh
check_typescript:
docker:
- image: "cimg/node:<< pipeline.parameters.node-version>>"
steps:
- checkout
# If the only changes are to the docs, don't run the slow (and expensive) code checks
# `git diff --exit-code` returns 0 exit code if no changes, and 1 if changes
- run: |
if git --no-pager diff --exit-code origin/develop...HEAD -- . ':!docs'; then
circleci-agent step halt
fi
- run: typescript/scripts/build.sh
publish_typescript:
docker:
- image: "cimg/node:<< pipeline.parameters.node-version>>"
steps:
- checkout
- run: typescript/scripts/build.sh
- npm-publisher/publish-from-package-version:
package-path: typescript
publish-token-variable: NPMJS_AUTH_TOKEN
workflows:
build:
jobs:
# -- PR check jobs ------------------------------------------
- kurtosis-docs-checker/check-docs:
markdown-link-check-config-json: "{}"
filters:
branches:
ignore:
- develop
- master
- check_golang:
context:
# This pulls in KurtosisBot's Github token, so that we can read from our private repos
- github-user
filters:
branches:
ignore:
- develop
- master
- check_typescript:
filters:
branches:
ignore:
- develop
- master
# -- End PR check jobs ---------------------------------------
# -- Artifact-publishing jobs --------------------------------
# TODO UNCOMMENT WHEN READY
#- publish_typescript:
# context:
# - npmjs-user
# filters:
# branches:
# ignore: /.*/
# tags:
# only: /^[0-9]+\.[0-9]+\.[0-9]+$/
# -- End artifact-publishing jobs ----------------------------
# A wrapper workflow that calls down to Kurtosis Release workflow repo
name: Release Workflow
on:
workflow_dispatch:
inputs:
bump_major:
description: 'Do you want to bump the MAJOR version ("X" in "X.Y.Z") on this release?'
required: true
type: boolean
jobs:
release:
uses: kurtosis-tech/release/.github/workflows/release.yml@master
with:
bump_major: ${{ inputs.bump_major }}
secrets: inherit
\ No newline at end of file
# IntelliJ
.idea
*.iws
*.iml
*.ipr
# VS Code
*.vscode
# Jenv
.java-version
# Pyenv
.python-version
# Mac spotlight index files
.DS_Store
*.un~
Session.vim
.netrwhist
*~
*.pyc
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*~.nib
local.properties
.classpath
.settings/
.loadpath
# Vim swapfiles
*.swp
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Archive files
*.tgz
*.zip
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
# Ignore Vim helptags
doc/tags
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Test binary, built with `go test -c`
*.test
# Output directories
build/
dist/
# Java
.gradle
# Node
node_modules
yarn-error.log
# Bazel
/bazel-*
./scripts/update-package-versions.sh
TODO REPLACE WITH REPO NAME
===========================
TODO replace with repo description
TODO COMPLETE AND DELETE
------------------------
CONFIGURE GENERAL REPO SETTINGS
1. [ ] Check "always suggest updating pull request branches"
1. [ ] Check "allow auto-merge"
1. [ ] Check "automatically delete head branches"
1. [ ] Give the "Engineers" team Admin access to the repo
SET UP KURTOSIS BRANCH PROTECTION
1. [ ] Under "Branches", create a new branch protection rule
1. [ ] Set the rule name to `master`
1. [ ] Check "Require pull request reviews before merging"
1. [ ] Check "Require approvals" (leaving it at 1)
1. [ ] Check "Allow specified actors to bypass required pull requests" and give the `kurtosisbot` user the permission
1. [ ] Check "Require status checks to pass before merging"
1. [ ] Check "Require branches to be up-to-date before merging" (NOTE: this prevents subtle bugs where two people change code in two separate branches, both their branches pass CI, but when merged they fail)
1. [ ] Add the status checks you want to pass (NOTE: if you have no CI/status checks for now, this is fine - just leave it empty)
1. [ ] Check "Require conversation resolution before merging" (NOTE: this is important as people sometimes forget comments)
1. [ ] Check "Include admins" at the bottom (admins can make mistakes too)
1. [ ] Select "Create" at the bottom
SET UP CIRCLECI
1. [ ] Commit a `.circleci/config.yml` file (easiest to copy from another project)
1. [ ] Visit [the CircleCI projects page](https://app.circleci.com/projects/project-dashboard/github/kurtosis-tech/) and select "Set Up Project"
1. [ ] **VERY IMPORTANT:** Open the CircleCI project settings, go to Advanced, and set the following values:
* [ ] `Pass secrets to builds from forked pull requests` = `false`
* **HUGE WARNING:** This is VERY VERY IMPORTANT to be set to `false`!!! If it's `true`, somebody could fork our repo, add an `echo "${GITHUB_TOKEN}"` in their fork, our CI would happily run it and print the value, and they'd get to impersonate us and do all sorts of nasty things like delete repos!!!!!
* [ ] `Only build pull requests` = `true`
* If this is set to `false` (the default), CircleCI will build _every_ commit, which will quickly exhaust our CircleCI credits and mean we can't build CI
* [ ] `Auto-cancel redundant builds` = `true`
* If this is set to `false` (the default), CircleCI will waste credits unnecessarily (which is probably why it defaults to `false` - because they want you using more credits :P)
1. [ ] If you need any additional secrets (Docker, Kurtosis user, etc.), find the ones you need [from the list](https://app.circleci.com/settings/organization/github/kurtosis-tech/contexts?return-to=https%3A%2F%2Fapp.circleci.com%2Fpipelines%2Fgithub%2Fkurtosis-tech) add them to the `context` section of the project's CircleCI `config.yml` using Circle
SET UP VERSIONING/RELEASING
1. [ ] Ask Kevin to make the Kurtosisbot RELEASER_TOKEN available to this repo so that the repo-releasing Github Action can use it (Kevin eeds to go into `kurtosis-tech` org settings and give the secret access to your new repo)
# TBD
# 0.0.0
* Initial commit
module TODOOOOOOOOOOO
go 1.17
require (
)
#!/usr/bin/env bash
# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template
set -euo pipefail # Bash "strict mode"
script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
lang_root_dirpath="$(dirname "${script_dirpath}")"
# ==================================================================================================
# Constants
# ==================================================================================================
# ==================================================================================================
# Main Logic
# ==================================================================================================
cd "${lang_root_dirpath}"
go test ./...
go build ./...
#!/usr/bin/env bash
# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template
set -euo pipefail # Bash "strict mode"
script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
root_dirpath="$(dirname "${script_dirpath}")"
# ==================================================================================================
# Constants
# ==================================================================================================
BUILD_SCRIPT_RELATIVE_FILEPATHS=(
"golang/scripts/build.sh"
"typescript/scripts/build.sh"
)
# ==================================================================================================
# Main Logic
# ==================================================================================================
for build_script_rel_filepath in "${BUILD_SCRIPT_RELATIVE_FILEPATHS[@]}"; do
build_script_abs_filepath="${root_dirpath}/${build_script_rel_filepath}"
if ! bash "${build_script_abs_filepath}"; then
echo "Error: Build script '${build_script_abs_filepath}' failed" >&2
exit 1
fi
done
#!/usr/bin/env bash
# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template
set -euo pipefail # Bash "strict mode"
script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
root_dirpath="$(dirname "${script_dirpath}")"
# ==================================================================================================
# Constants
# ==================================================================================================
UPDATE_PACKAGE_VERSIONS_SCRIPT_FILENAME="pre-release-script_update-package-versions.sh" # From devtools; expected to be on the PATH
# ==================================================================================================
# Arg Parsing & Validation
# ==================================================================================================
show_helptext_and_exit() {
echo "Usage: $(basename "${0}") new_version"
echo ""
echo " new_version The version of this repo that is about to released"
echo ""
exit 1 # Exit with an error so that if this is accidentally called by CI, the script will fail
}
new_version="${1:-}"
if [ -z "${new_version}" ]; then
echo "Error: No new version provided" >&2
show_helptext_and_exit
fi
# ==================================================================================================
# Main Logic
# ==================================================================================================
bash "${UPDATE_PACKAGE_VERSIONS_SCRIPT_FILENAME}" "${root_dirpath}" "${new_version}"
golang
typescript
{
"//": "TODO TODO Add package name, description, license, etc. here",
"version": "0.0.0",
"main": "./build/index",
"types": "./build/index",
"scripts": {
"build": "tsc",
"test": "ts-mocha -p tsconfig.json 'test/**/*.ts'"
},
"files": [
"build"
],
"engines": {
"node": ">= 16.13.0"
},
"dependencies": {
},
"devDependencies": {
"@types/mocha": "^9.0.0",
"mocha": "^9.0.3",
"ts-mocha": "^8.0.0",
"typescript": "^4.3.5"
}
}
#!/usr/bin/env bash
# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template
set -euo pipefail # Bash "strict mode"
script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
lang_root_dirpath="$(dirname "${script_dirpath}")"
# ==================================================================================================
# Main Logic
# ==================================================================================================
cd "${lang_root_dirpath}"
yarn install
yarn test
yarn build
// TODO Export classes for people who use this package here, for example:
// export { SomeClass } from "./some_file";
import { strict as assert } from "assert";
describe('TODO REPLACE WITH CLASS NAME', function() {
describe('#TODO REPLACE WITH FUNCTION NAME', function() {
it('TODO REPLACE WITH DESCRIPTION', async function() {
const actual: string = "FOO";
const expected: string = "FOO";
assert.equal(actual, expected);
})
})
});
{
"compilerOptions": {
"module": "commonjs",
"outDir": "build",
"downlevelIteration": true,
"declaration": true,
"strict": true,
"lib": [
"es2015"
]
},
"include": [
"src/**/*"
]
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment