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
4 changes: 2 additions & 2 deletions .semaphore/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ version: "v1.0"
name: Release
agent:
machine:
type: e1-standard-4
os_image: ubuntu2004
type: f1-standard-2
os_image: ubuntu2404
blocks:
- name: "Release"
task:
Expand Down
24 changes: 10 additions & 14 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ version: v1.0
name: Agent
agent:
machine:
type: e1-standard-2
os_image: ubuntu2004
type: f1-standard-2
os_image: ubuntu2404

execution_time_limit:
minutes: 15

fail_fast:
stop:
when: true
minutes: 10

blocks:
- name: "Lint"
Expand All @@ -22,7 +18,7 @@ blocks:

prologue:
commands:
- sem-version go 1.23.8
- sem-version go 1.24.11
- checkout

jobs:
Expand All @@ -41,7 +37,7 @@ blocks:
- checkout
- mv ~/.ssh/security-toolbox ~/.ssh/id_rsa
- sudo chmod 600 ~/.ssh/id_rsa
- sem-version go 1.23.8
- sem-version go 1.24.11
jobs:
- name: Check dependencies
commands:
Expand All @@ -67,7 +63,7 @@ blocks:

prologue:
commands:
- sem-version go 1.23.8
- sem-version go 1.24.11
- checkout
- go version
- go get
Expand Down Expand Up @@ -100,7 +96,7 @@ blocks:

prologue:
commands:
- sem-version go 1.23.8
- sem-version go 1.24.11
- checkout
- go version
- go get
Expand Down Expand Up @@ -167,7 +163,7 @@ blocks:

prologue:
commands:
- sem-version go 1.23.8
- sem-version go 1.24.11
- checkout
- go version
- go get
Expand Down Expand Up @@ -204,7 +200,7 @@ blocks:

prologue:
commands:
- sem-version go 1.23.8
- sem-version go 1.24.11
- checkout
- go version
- go get
Expand Down Expand Up @@ -245,7 +241,7 @@ blocks:

prologue:
commands:
- sem-version go 1.23.8
- sem-version go 1.24.11
- curl -sLO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && install minikube-linux-amd64 /tmp/
- /tmp/minikube-linux-amd64 config set WantUpdateNotification false
- /tmp/minikube-linux-amd64 start --driver=docker
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.self_hosted
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME && \
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME

RUN apt-get update -y && apt-get install -y --no-install-recommends ca-certificates curl
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates curl
RUN update-ca-certificates

# kubectl is required to be present in the container running the agent
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ RUN apt-get update && \
apt-get install curl -y && \
curl -sSL https://get.docker.com/ | sh && \
apt-get install -y ssh docker-compose-plugin && \
# Install standalone docker-compose for backward compatibility
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose && \
# pin pyyaml to 5.3.1 until https://github.com/yaml/pyyaml/issues/724 is fixed
pip install pyyaml==5.3.1 && \
pip install awscli
Expand All @@ -29,4 +32,4 @@ ADD build/agent /app/agent

WORKDIR /app

CMD service ssh restart && ./agent serve --port 30000
CMD ["sh", "-c", "service ssh restart && ./agent serve --port 30000"]
2 changes: 1 addition & 1 deletion pkg/api/job_request.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api
package agentapi

import (
"encoding/base64"
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/job_request_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api
package agentapi

import (
"encoding/base64"
Expand Down
2 changes: 1 addition & 1 deletion pkg/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"

versions "github.com/hashicorp/go-version"
"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
log "github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"regexp"
"strings"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/semaphoreci/agent/pkg/aws"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime"
"testing"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/eventlogger/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"time"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
)

const LoggerMethodPull = "pull"
Expand Down
2 changes: 1 addition & 1 deletion pkg/executors/shell_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ func Test__ShellExecutor__BrokenUnicode(t *testing.T) {

assert.Equal(t, simplifiedEvents, []string{
fmt.Sprintf("directive: %s", testsupport.EchoBrokenUnicode()),
"\x96\x96\x96\x96\x96",
"\u0096\u0096\u0096\u0096\u0096",
"Exit Code: 0",
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/jobs/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/semaphoreci/agent/pkg/config"
eventlogger "github.com/semaphoreci/agent/pkg/eventlogger"
testsupport "github.com/semaphoreci/agent/test/support"
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/ghodss/yaml"
"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/semaphoreci/agent/pkg/config"
"github.com/semaphoreci/agent/pkg/docker"
"github.com/semaphoreci/agent/pkg/retry"
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubernetes/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
assert "github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubernetes/image_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"regexp"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
)

type ImageValidator struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubernetes/image_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kubernetes
import (
"testing"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/listener/job_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"syscall"
"time"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/semaphoreci/agent/pkg/config"
jobs "github.com/semaphoreci/agent/pkg/jobs"
"github.com/semaphoreci/agent/pkg/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/listener/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"
"time"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/semaphoreci/agent/pkg/config"
"github.com/semaphoreci/agent/pkg/eventlogger"
"github.com/semaphoreci/agent/pkg/listener/selfhostedapi"
Expand Down
2 changes: 1 addition & 1 deletion pkg/listener/selfhostedapi/get_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io/ioutil"
"net/http"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
)

func (a *API) GetJobPath(jobID string) string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/golang-jwt/jwt/v4"
"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/shell/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sort"
"strings"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/semaphoreci/agent/pkg/config"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/shell/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"runtime"
"testing"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/semaphoreci/agent/pkg/config"
"github.com/stretchr/testify/assert"
)
Expand Down
6 changes: 3 additions & 3 deletions test/e2e_support/listener_mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class ListenerMode

def boot_up_agent
File.write("/tmp/agent/config.yaml", $AGENT_CONFIG.to_yaml)
system "docker-compose -f test/e2e_support/docker-compose-listen.yml stop"
system "docker-compose -f test/e2e_support/docker-compose-listen.yml build"
system "docker-compose -f test/e2e_support/docker-compose-listen.yml up -d"
system "docker compose -f test/e2e_support/docker-compose-listen.yml stop"
system "docker compose -f test/e2e_support/docker-compose-listen.yml build"
system "docker compose -f test/e2e_support/docker-compose-listen.yml up -d"

wait_for_agent_to_register_in_the_hub
end
Expand Down
2 changes: 1 addition & 1 deletion test/hub_reference/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7
FROM ruby:3.3

WORKDIR /app

Expand Down
4 changes: 3 additions & 1 deletion test/hub_reference/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
source 'https://rubygems.org'

gem 'sinatra'
gem 'sinatra', '>= 4.2.0'
gem 'thin'
gem 'rackup'
gem 'puma'
34 changes: 22 additions & 12 deletions test/hub_reference/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
GEM
remote: https://rubygems.org/
specs:
base64 (0.3.0)
daemons (1.4.1)
eventmachine (1.2.7)
mustermann (3.0.0)
logger (1.7.0)
mustermann (3.0.4)
ruby2_keywords (~> 0.0.1)
rack (2.2.20)
rack-protection (3.0.4)
rack
rack (3.2.4)
rack-protection (4.2.1)
base64 (>= 0.1.0)
logger (>= 1.6.0)
rack (>= 3.0.0, < 4)
rack-session (2.1.1)
base64 (>= 0.1.0)
rack (>= 3.0.0)
ruby2_keywords (0.0.5)
sinatra (3.0.4)
sinatra (4.2.1)
logger (>= 1.6.0)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.0.4)
rack (>= 3.0.0, < 4)
rack-protection (= 4.2.1)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
thin (1.8.1)
thin (2.0.1)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
tilt (2.0.11)
logger
rack (>= 1, < 4)
tilt (2.6.1)

PLATFORMS
ruby

DEPENDENCIES
sinatra
sinatra (>= 4.2.0)
thin

BUNDLED WITH
2.1.4
2.4.22
2 changes: 1 addition & 1 deletion test/support/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/semaphoreci/agent/pkg/api"
api "github.com/semaphoreci/agent/pkg/api"
"github.com/semaphoreci/agent/pkg/listener/selfhostedapi"
"github.com/semaphoreci/agent/pkg/retry"
)
Expand Down