Skip to content
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: 2 additions & 1 deletion .github/workflows/prerelease-checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Pre-release checks

on:
on: # yamllint disable-line rule:truthy
workflow_call:

jobs:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Release on github

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- release/*
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-java.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Release maven package

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- release/*
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release-javascript.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: Release ci-environment npm module

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- release/*

jobs:

pre-release-check:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-ruby.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Release ci-environment ruby gem

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- release/*
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test-go.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: test-go
on:
on: # yamllint disable-line rule:truthy
push:
branches:
- main
Expand All @@ -13,7 +14,7 @@ jobs:
test:
strategy:
matrix:
go-version: [ 1.17.x, 1.18.x ]
go-version: ["1.17.x", "1.18.x"]
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-java.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: test-java

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- main
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/test-javascript.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: test-javascript

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- main
Expand All @@ -26,17 +27,17 @@ jobs:
node-version: '16.x'

steps:
- name: set git core.autocrlf to 'input'
run: git config --global core.autocrlf input
- uses: actions/checkout@v3
- name: with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- run: npm install-ci-test
working-directory: javascript
- run: npm run eslint-fix
working-directory: javascript
- run: ./scripts/fail-if-dirty
- name: set git core.autocrlf to 'input'
run: git config --global core.autocrlf input
- uses: actions/checkout@v3
- name: with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- run: npm install-ci-test
working-directory: javascript
- run: npm run eslint-fix
working-directory: javascript
- run: ./scripts/fail-if-dirty
23 changes: 12 additions & 11 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: test-ruby

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- main
Expand All @@ -26,14 +27,14 @@ jobs:
ruby: '3.0'

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
working-directory: ruby
- name: bundle exec rake
working-directory: ruby
- name: bundle exec rake
working-directory: ruby
run: bundle exec rake
- run: ./scripts/fail-if-dirty
run: bundle exec rake
- run: ./scripts/fail-if-dirty
2 changes: 1 addition & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
copy-template:
cp ../CiEnvironments.json CiEnvironments.json

test: copy-template
test: copy-template
@echo "running all tests"
@go install ./...
@go fmt ./...
Expand Down
12 changes: 6 additions & 6 deletions go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ To embed the templates for the ci-environment go module, we'll use go:embed to i
## Template Expressions

### Simple Environment Variables
Many are simple replacements of environment variables. E.g, for Azure DevOps, the URI is simply the value of the `${BUILD_BUILDURI}` environment variable.
Many are simple replacements of environment variables. E.g, for Azure DevOps, the URI is simply the value of the `${BUILD_BUILDURI}` environment variable.

### Multiple Environment Variables and/or Constants
For others, it is a combination of multiple enviroment variables and constants. E.g., for Github Actions, the URI is the combination of `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`.
For others, it is a combination of multiple enviroment variables and constants. E.g., for Github Actions, the URI is the combination of `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`.

### Expression Syntax
Still for others, there is some additional processing of values that can be found in environment variables. In these cases, the value in the template consists of three parts: the environment variable to be used, the regex expression (including capture groups) to to used to derive the final value, and the template to be applied using the value(s) from those
capture groups.
Still for others, there is some additional processing of values that can be found in environment variables. In these cases, the value in the template consists of three parts: the environment variable to be used, the regex expression (including capture groups) to to used to derive the final value, and the template to be applied using the value(s) from those
capture groups.

E.g., the Git remote template for CodeShip has a value of `${CI_PULL_REQUEST/(.*)\\/pull\\/\\d+/\\1.git}`. The sections of this expression are delineated by unescaped slashes. So the three parts are the `CI_PULL_REQUEST` environment variable, the regex of `(.*)\\/pull\\/\\d+`, and the template of `\\1.git`.
E.g., the Git remote template for CodeShip has a value of `${CI_PULL_REQUEST/(.*)\\/pull\\/\\d+/\\1.git}`. The sections of this expression are delineated by unescaped slashes. So the three parts are the `CI_PULL_REQUEST` environment variable, the regex of `(.*)\\/pull\\/\\d+`, and the template of `\\1.git`.

So in this example, the URL in the CI_PULL_REQUEST environment variable will have everything prior to `pull/\d+` in a capture group, then the first (and only in this example) capture group is prepended to the literal `.git`. So if the CI_PULL_REQUEST envrionment variable were `https://github.com/owner/repo/pull/42`, then the value of `https://github.com/owner/repo` would be part of that first capture group, and then the resulting value will be `https://github.com/owner/repo.git`.
So in this example, the URL in the CI_PULL_REQUEST environment variable will have everything prior to `pull/\d+` in a capture group, then the first (and only in this example) capture group is prepended to the literal `.git`. So if the CI_PULL_REQUEST envrionment variable were `https://github.com/owner/repo/pull/42`, then the value of `https://github.com/owner/repo` would be part of that first capture group, and then the resulting value will be `https://github.com/owner/repo.git`.

Or as explained in ARCHITECTURE.md:
>The expression syntax for environment variables can use the form `${variable/pattern/replacement}`, similar to [bash parameter substitution](https://tldp.org/LDP/abs/html/parameter-substitution.html), but inspired from [sed's s command](https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html) which provides support for capture group back-references in the replacement.
Expand Down
2 changes: 1 addition & 1 deletion java/scripts/check-jar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ check_jar() {

find . -name "*.jar" | while read jar; do
check_jar "${jar}"
done
done
2 changes: 1 addition & 1 deletion javascript/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion javascript/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"semi": false,
"singleQuote": true,
"printWidth": 100
}
}
2 changes: 1 addition & 1 deletion javascript/package.cjs.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"type": "commonjs"}
{"type": "commonjs"}
2 changes: 1 addition & 1 deletion javascript/tsconfig.build-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"target": "ES5",
"module": "CommonJS",
},
}
}
1 change: 0 additions & 1 deletion scripts/fail-if-dirty
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ if [[ ! -z "${diff}" ]]; then
>&2 echo "${diff}"
exit 1
fi

2 changes: 1 addition & 1 deletion testdata/JetBrainsSpace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ JB_SPACE_API_URL=jetbrains.space
JB_SPACE_PROJECT_KEY=ij
JB_SPACE_GIT_REPOSITORY_NAME=intellij
JB_SPACE_GIT_REVISION=057f8fe233b17629af084064c2a7b8d1dbb795ad
JB_SPACE_GIT_BRANCH=main
JB_SPACE_GIT_BRANCH=main