Skip to content

Commit

Permalink
Merge pull request #35 from ba-st/gs64-3.7.1
Browse files Browse the repository at this point in the history
Add support for GS64 3.7.1
  • Loading branch information
gcotelli authored Apr 16, 2024
2 parents 7a33c7a + 6cf9640 commit e46aa57
Show file tree
Hide file tree
Showing 23 changed files with 138 additions and 45 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
tags:
- 'v*.*.*'
pull_request:

jobs:
build_and_publish:
runs-on: ubuntu-latest
Expand All @@ -19,20 +18,20 @@ jobs:
fetch-depth: 2
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/stargate-consul-example
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Docker build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./
file: ./docker/pharo/Dockerfile
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/integration-tests-gs64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ on:
jobs:
integration-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "3.7.0"
- "3.7.1"
name: Integration Tests GS64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Configure keyfile
run: |
echo "$GS_KEYFILE" > ./api-tests/gs64/gemstone.key
echo "$GS_KEYFILE" > ./api-tests/gs64-${{ matrix.version }}/gemstone.key
env:
GS_KEYFILE: ${{ secrets.GS_KEYFILE }}
- name: Run GS64 tests using Docker
run: ./compose-test-gs64.sh
run: ./compose-test-gs64.sh ${{ matrix.version }}
- name: Remove keyfile
if: always()
run: rm -f ./api-tests/gs64/gemstone.key
20 changes: 18 additions & 2 deletions .github/workflows/loading-gs64-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,35 @@ on:
- pull_request
- workflow_dispatch
jobs:
component-loading:
component-loading-3_7_0:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
load-spec:
- Deployment
- Examples
name: GS64 + ${{ matrix.load-spec }}
name: GS64 v3.7.0 + ${{ matrix.load-spec }}
steps:
- uses: actions/checkout@v4
- name: Load component in image
uses: ba-st-actions/gs64-ci@v2
with:
project_name: 'Stargate-Consul'
load_spec: 'Stargate-Consul-${{ matrix.load-spec }}'
component-loading-3_7_1:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
load-spec:
- Deployment
- Examples
name: GS64 v3.7.1 + ${{ matrix.load-spec }}
steps:
- uses: actions/checkout@v4
- name: Load component in image
uses: ba-st-actions/gs64-ci@v3
with:
project_name: 'Stargate-Consul'
load_spec: 'Stargate-Consul-${{ matrix.load-spec }}'
14 changes: 12 additions & 2 deletions .github/workflows/unit-tests-gs64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ on:
- pull_request
- workflow_dispatch
jobs:
unit-tests:
unit-tests-3_7_0:
runs-on: ubuntu-latest
name: GS64 Unit Tests
name: GS64 v3.7.0 Unit Tests
steps:
- uses: actions/checkout@v4
- name: Load Image and Run Tests
uses: ba-st-actions/gs64-ci@v2
with:
project_name: 'Stargate-Consul'
run_tests: 'true'
unit-tests-3_7_1:
runs-on: ubuntu-latest
name: GS64 v3.7.1 Unit Tests
steps:
- uses: actions/checkout@v4
- name: Load Image and Run Tests
uses: ba-st-actions/gs64-ci@v3
with:
project_name: 'Stargate-Consul'
run_tests: 'true'
3 changes: 2 additions & 1 deletion .smalltalkci/.loading.deployment.ston
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ SmalltalkCISpec {
#baseline : 'StargateConsul',
#directory : '../source',
#load : [ 'Deployment' ],
#platforms : [ #pharo ]
#platforms : [ #pharo ],
#failOn : [ #Warning ]
}
],
#testing : {
Expand Down
3 changes: 2 additions & 1 deletion .smalltalkci/.loading.development.ston
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ SmalltalkCISpec {
#baseline : 'StargateConsul',
#directory : '../source',
#load : [ 'Development' ],
#platforms : [ #pharo ]
#platforms : [ #pharo ],
#failOn : [ #Warning ]
}
],
#testing : {
Expand Down
3 changes: 2 additions & 1 deletion .smalltalkci/.loading.examples.ston
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ SmalltalkCISpec {
#baseline : 'StargateConsul',
#directory : '../source',
#load : [ 'Examples' ],
#platforms : [ #pharo ]
#platforms : [ #pharo ],
#failOn : [ #Warning ]
}
],
#testing : {
Expand Down
3 changes: 2 additions & 1 deletion .smalltalkci/.loading.tools.ston
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ SmalltalkCISpec {
#baseline : 'StargateConsul',
#directory : '../source',
#load : [ 'Tools' ],
#platforms : [ #pharo ]
#platforms : [ #pharo ],
#failOn : [ #Warning ]
}
],
#testing : {
Expand Down
3 changes: 2 additions & 1 deletion .smalltalkci/.unit-tests.ston
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ SmalltalkCISpec {
#baseline : 'StargateConsul',
#directory : '../source',
#load : [ 'CI' ],
#platforms : [ #pharo ]
#platforms : [ #pharo ],
#failOn : [ #Warning ]
}
],
#testing : {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ plugin to interact with the [Consul](https://www.consul.io) HTTP API.
[![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://pharo.org)

[![GS64 3.7.0](https://img.shields.io/badge/GS64-3.7.0-informational)](https://gemtalksystems.com/products/gs64/)
[![GS64 3.7.1](https://img.shields.io/badge/GS64-3.7.1-informational)](https://gemtalksystems.com/products/gs64/)

Quick links

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
api:
build:
context: ../../
dockerfile: docker/gs64/Dockerfile
dockerfile: docker/gs64-3.7.0/Dockerfile
cap_add:
- CAP_SYS_RESOURCE
ports:
Expand Down
1 change: 1 addition & 0 deletions api-tests/gs64-3.7.0/gem.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEM_TEMPOBJ_CACHE_SIZE = 500MB;
1 change: 1 addition & 0 deletions api-tests/gs64-3.7.1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gemstone.key
42 changes: 42 additions & 0 deletions api-tests/gs64-3.7.1/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: '3'
services:
api:
build:
context: ../../
dockerfile: docker/gs64-3.7.1/Dockerfile
cap_add:
- CAP_SYS_RESOURCE
ports:
- "8080:8080"
environment:
STARGATE__PUBLIC_URL: http://api:8080
STARGATE__PORT: 8080
STARGATE__OPERATIONS_SECRET: API-tests
HEALTH_CHECK_TOKEN: eyJhbGciOiJIUzI1NiJ9.eyJwZXJtaXNzaW9ucyI6WyJleGVjdXRlOmhlYWx0aC1jaGVjayJdfQ.gLammIebJuNDYDz70T8ZYK9GV8jXWrt18mPnLPvoCjw
STARGATE__CONSUL_AGENT_LOCATION: http://consul-agent:8500
GS64_STONE_HOSTNAME: stone
TZ: America/Argentina/Buenos_Aires
volumes:
- ./gem.conf:/opt/gemstone/conf.gem.conf
depends_on:
- consul-agent
- stone
stone:
init: true
image: ghcr.io/ba-st/gs64-rowan:v3.7.1
cap_add:
- CAP_SYS_RESOURCE
environment:
TZ: America/Argentina/Buenos_Aires
volumes:
- ./gem.conf:/opt/gemstone/conf/gem.conf
- ./gemstone.key:/opt/gemstone/product/sys/gemstone.key:ro
- $PWD:/opt/gemstone/projects/Stargate-Consul
consul-agent:
image: consul:1.8
ports:
- "8500:8500"
- "8600:8600"
- "8300:8300"
environment:
CONSUL_BIND_INTERFACE: eth0
1 change: 1 addition & 0 deletions api-tests/gs64-3.7.1/gem.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEM_TEMPOBJ_CACHE_SIZE = 500MB;
1 change: 0 additions & 1 deletion api-tests/gs64/gem.conf

This file was deleted.

22 changes: 15 additions & 7 deletions compose-test-gs64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@

set -e

if [ $# -eq 0 ]; then
echo "Error: Missing GS64 version argument. Eg. 3.7.0"
exit 1
fi

readonly GS64_VERSION="$1"
readonly GS64_COMPOSE_FILE="api-tests/gs64-$GS64_VERSION/docker-compose.yml"

echo "Building API"
docker compose -f api-tests/gs64/docker-compose.yml build api
docker compose -f "$GS64_COMPOSE_FILE" build api
echo "Starting Stone"
docker compose -f api-tests/gs64/docker-compose.yml up -d stone
docker compose -f "$GS64_COMPOSE_FILE" up -d stone
echo "Starting Consul Agent"
docker compose -f api-tests/gs64/docker-compose.yml up -d consul-agent
docker compose -f "$GS64_COMPOSE_FILE" up -d consul-agent
sleep 2
echo "Installing support code"
docker exec -i -u gemstone gs64-stone-1 ./load-rowan-project.sh Stargate-Consul Stargate-Consul-Examples
docker exec -i -u gemstone "gs64-${GS64_VERSION//./}-stone-1" ./load-rowan-project.sh Stargate-Consul Stargate-Consul-Examples
echo "Starting API"
docker compose -f api-tests/gs64/docker-compose.yml up -d api
docker compose -f "$GS64_COMPOSE_FILE" up -d api
sleep 10
echo "Testing API"
curl --fail http://localhost:8080/echo/hello
Expand All @@ -22,7 +30,7 @@ HEALTH_STATUS=$(curl -s http://localhost:8500/v1/health/checks/echo | jq '.[0].S
echo "$HEALTH_STATUS"
if [ "$HEALTH_STATUS" != '"passing"' ]; then
echo "Error: Echo service is unhealthy" >&2
docker compose -f api-tests/gs64/docker-compose.yml down
docker compose -f "$GS64_COMPOSE_FILE" down
exit 1
fi
docker compose -f api-tests/gs64/docker-compose.yml down
docker compose -f "$GS64_COMPOSE_FILE" down
2 changes: 1 addition & 1 deletion docker/gs64/Dockerfile → docker/gs64-3.7.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM ghcr.io/ba-st/launchpad-gs64:v5
FROM ghcr.io/ba-st/launchpad-gs64-3.7.0:v5
CMD [ "launchpad", "start", "stargate-consul-example" ]
2 changes: 2 additions & 0 deletions docker/gs64-3.7.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM ghcr.io/ba-st/launchpad-gs64-3.7.1:v5
CMD [ "launchpad", "start", "stargate-consul-example" ]
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
Class {
#name : #StargateConsulEchoRESTfulControllerTest,
#superclass : #SingleResourceRESTfulControllerTest,
#category : #'Stargate-Consul-Examples-Tests'
#name : 'StargateConsulEchoRESTfulControllerTest',
#superclass : 'SingleResourceRESTfulControllerTest',
#category : 'Stargate-Consul-Examples-Tests',
#package : 'Stargate-Consul-Examples-Tests'
}

{ #category : #'private - support' }
{ #category : 'private - support' }
StargateConsulEchoRESTfulControllerTest >> baseUrl [

^ 'http://api.example.com' asUrl
]

{ #category : #running }
{ #category : 'running' }
StargateConsulEchoRESTfulControllerTest >> setUpResourceController [

resourceController := StargateConsulEchoRESTfulController new
]

{ #category : #tests }
{ #category : 'tests' }
StargateConsulEchoRESTfulControllerTest >> testMessageText [

| response |
Expand Down
Loading

0 comments on commit e46aa57

Please sign in to comment.