Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: semaphoreci/spc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.9.4
Choose a base ref
...
head repository: semaphoreci/spc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 11 commits
  • 34 files changed
  • 3 contributors

Commits on Aug 8, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2552e2a View commit details

Commits on Oct 17, 2023

  1. upgrade go to 1.20 (#44)

    lucaspin authored Oct 17, 2023
    Copy the full SHA
    0eaec4f View commit details

Commits on Jun 4, 2024

  1. feat: template expressions (#47)

    * Fix linting
    
    * Add template expressions to YAML parsing
    
    * Disable some revive rules for expression_test.go
    
    * Differentiate between percent and dollar sign expressions
    
    * Use sprout functions in the template expressions
    
    * Omit using parameter expressions before running templates
    
    * Exclude must functions from sprout
    
    * Check for nested expressions and prohibit them
    
    * Improve formatting log
    
    * Handle parsing numbers as JSON values
    
    * Increase scope of traversed elements of pipeline YAML
    
    * Reduce cognitive complexity of substituteExpression func
    
    * Remove redundant function
    
    * Remove parameters expression and rename parameterEvaluator to templateEvaluator
    
    * Add missing part of log message
    
    * Add more clauses to e2e test of parameters
    mattrym authored Jun 4, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    624cf02 View commit details
  2. Change secret used for Github releases (#48)

    mattrym authored Jun 4, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    02999e0 View commit details

Commits on Aug 26, 2024

  1. Evaluate template expressions everywhere except in job commands

    DamjanBecirovic committed Aug 26, 2024
    Copy the full SHA
    f6fe84e View commit details

Commits on Aug 28, 2024

  1. Merge pull request #49 from semaphoreci/db/params-in-promotion-ppl-file

    Evaluate template expressions everywhere except in job commands
    DamjanBecirovic authored Aug 28, 2024
    Copy the full SHA
    eb4b8b6 View commit details

Commits on Oct 10, 2024

  1. Replace commands_files with commands

    DamjanBecirovic committed Oct 10, 2024
    Copy the full SHA
    b6d1302 View commit details
  2. Fix Linter issues

    DamjanBecirovic committed Oct 10, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dbbf593 View commit details

Commits on Oct 11, 2024

  1. Merge pull request #50 from semaphoreci/db/commands-file-eval

    Replace commands_files with commands
    DamjanBecirovic authored Oct 11, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f5d68c7 View commit details

Commits on Oct 24, 2024

  1. Correctly read commands from cmd file when file path is absolute

    DamjanBecirovic committed Oct 24, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ed30309 View commit details
  2. Merge pull request #51 from semaphoreci/db/fix-cmd-files-abs-path

    Correctly read commands from cmd file when file path is absolute
    DamjanBecirovic authored Oct 24, 2024
    Copy the full SHA
    28ffb30 View commit details
8 changes: 4 additions & 4 deletions .semaphore/release.yml
Original file line number Diff line number Diff line change
@@ -2,19 +2,19 @@ version: "v1.0"
name: "Github Release"
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
type: e2-standard-2
os_image: ubuntu2004
blocks:
- name: "Github Release"
task:
env_vars:
- name: GO111MODULE
value: "on"
secrets:
- name: sem-robot-ghtoken
- name: release-token
prologue:
commands:
- sem-version go 1.16
- sem-version go 1.21
- "export GOPATH=~/go"
- "export PATH=/home/semaphore/go/bin:$PATH"
- checkout
29 changes: 24 additions & 5 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@ version: v1.0
name: Go
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
type: e2-standard-2
os_image: ubuntu2004

global_job_config:
prologue:
commands:
- sem-version go 1.16
- sem-version go 1.21
- export GO111MODULE=on
- export GOPATH=~/go
- 'export PATH=/home/semaphore/go/bin:$PATH'
@@ -19,13 +19,31 @@ global_job_config:
- go get ./...

blocks:
- name: "Security checks"
dependencies: []
task:
secrets:
- name: security-toolbox-shared-read-access
prologue:
commands:
- checkout
- mv ~/.ssh/security-toolbox ~/.ssh/id_rsa
- sudo chmod 600 ~/.ssh/id_rsa
jobs:
- name: Check dependencies
commands:
- make check.deps
- name: Check code
commands:
- make check.static

- name: Lint
dependencies: []
task:
jobs:
- name: Lint
commands:
- go get -u github.com/mgechev/revive
- go install github.com/mgechev/revive@latest
- make lint

- name: E2E
@@ -47,7 +65,7 @@ blocks:
jobs:
- name: go test
commands:
- go get gotest.tools/gotestsum
- go install gotest.tools/gotestsum@latest
- make test

- name: e2e
@@ -86,6 +104,7 @@ blocks:
- test/e2e/list_diff_with_default_branch.rb
- test/e2e/when_conditions_without_change_in.rb
- test/e2e/parameters_and_change_in.rb
- test/e2e/cmd_files_all_possible_locations.rb

commands:
- make build
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
.PHONY: build test

SECURITY_TOOLBOX_BRANCH ?= master
SECURITY_TOOLBOX_TMP_DIR ?= /tmp/security-toolbox

check.prepare:
rm -rf $(SECURITY_TOOLBOX_TMP_DIR)
git clone git@github.com:renderedtext/security-toolbox.git $(SECURITY_TOOLBOX_TMP_DIR) && (cd $(SECURITY_TOOLBOX_TMP_DIR) && git checkout $(SECURITY_TOOLBOX_BRANCH) && cd -)

check.static: check.prepare
docker run -it -v $$(pwd):/app \
-v $(SECURITY_TOOLBOX_TMP_DIR):$(SECURITY_TOOLBOX_TMP_DIR) \
registry.semaphoreci.com/ruby:2.7 \
bash -c 'cd /app && $(SECURITY_TOOLBOX_TMP_DIR)/code --language go -d'

check.deps: check.prepare
docker run -it -v $$(pwd):/app \
-v $(SECURITY_TOOLBOX_TMP_DIR):$(SECURITY_TOOLBOX_TMP_DIR) \
registry.semaphoreci.com/ruby:2.7 \
bash -c 'cd /app && $(SECURITY_TOOLBOX_TMP_DIR)/dependencies --language go -d'


lint:
revive -formatter friendly -config lint.toml ./...

48 changes: 38 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
module github.com/semaphoreci/spc

go 1.16
go 1.21

require (
github.com/Jeffail/gabs v1.4.0
github.com/Jeffail/gabs/v2 v2.6.0
github.com/a-h/generate v0.0.0-20190312091541-e59c34d33fb3 // indirect
github.com/bmatcuk/doublestar/v2 v2.0.4
github.com/42atomys/sprout v0.2.0
github.com/Jeffail/gabs/v2 v2.7.0
github.com/bmatcuk/doublestar/v4 v4.6.0
github.com/ghodss/yaml v1.0.0
github.com/iancoleman/strcase v0.1.2
github.com/spf13/cobra v1.1.1
github.com/stretchr/testify v1.3.0
github.com/tidwall/gjson v1.6.3
gotest.tools/gotestsum v0.6.0 // indirect
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.9.0
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/bitfield/gotestdox v0.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.11.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/gotestsum v1.11.0 // indirect
)
Loading