Skip to content

Commit

Permalink
Merge branch 'TykTechnologies:master' into add-sqs-pump-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
masoudhaghbin authored Nov 20, 2023
2 parents 4ea9014 + d7dfaa4 commit f67cae3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,18 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::754489498669:role/ecr_rw_tyk
role-session-name: cipush
aws-region: eu-central-1

- uses: aws-actions/amazon-ecr-login@v1
id: ecr
with:
mask-password: 'true'

- name: Run ci/tests
shell: bash
env:
Expand All @@ -296,7 +308,7 @@ jobs:
echo Attempting to test $d
if [ -d $d ] && [ -e $d/test.sh ]; then
cd $d
./test.sh ${{ needs.goreleaser.outputs.tag }}
./test.sh ${{ steps.ecr.outputs.registry }}/tyk-pump:sha-${{ github.sha }}
cd -
fi
done
Expand All @@ -305,7 +317,7 @@ jobs:
echo Attempting to test $d
if [ -d $d ] && [ -e $d/test.sh ]; then
cd $d
./test.sh ${{ needs.goreleaser.outputs.tag }}
./test.sh ${{ steps.ecr.outputs.registry }}/tyk-pump:sha-${{ github.sha }}
cd -
fi
done
Expand Down
2 changes: 1 addition & 1 deletion ci/tests/csvpump/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
timeout: 10s

pump:
image: tykio/tyk-pump-docker-pub:${tag}
image: ${pump_image}
volumes:
- ./confs/tyk-pump.conf:/conf/tyk-pump.conf
- /tmp/pump-data:/pump-data
Expand Down
2 changes: 1 addition & 1 deletion ci/tests/csvpump/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function warn {
DEFAULT_GW_TAG=v4.0.1

[[ -z $1 ]] && usage "$0"
export tag=$1
export pump_image=$1
export gwtag=$2

if [[ -z $2 ]]; then
Expand Down
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var log = logger.GetLogger()
var mainPrefix = "main"

var (
//lint:ignore U1000 Function is used when version flag is passed in command line
help = kingpin.CommandLine.HelpFlag.Short('h')
conf = kingpin.Flag("conf", "path to the config file").Short('c').Default("pump.conf").String()
demoMode = kingpin.Flag("demo", "pass orgID string to generate demo data").Default("").String()
Expand All @@ -45,7 +46,8 @@ var (
demoRecordsPerHour = kingpin.Flag("demo-records-per-hour", "flag that determines the number of records per hour for the analytics records").Default("0").Int()
demoFutureData = kingpin.Flag("demo-future-data", "flag that determines if the demo data should be in the future").Default("false").Bool()
debugMode = kingpin.Flag("debug", "enable debug mode").Bool()
version = kingpin.Version(pumps.VERSION)
//lint:ignore U1000 Function is used when version flag is passed in command line
version = kingpin.Version(pumps.Version)
)

func Init() {
Expand All @@ -69,7 +71,7 @@ func Init() {

log.WithFields(logrus.Fields{
"prefix": mainPrefix,
}).Info("## Tyk Pump, ", pumps.VERSION, " ##")
}).Info("## Tyk Pump, ", pumps.Version, " ##")

// If no environment variable is set, check the configuration file:
if os.Getenv("TYK_LOGLEVEL") == "" {
Expand Down Expand Up @@ -123,7 +125,12 @@ func storeVersion() {
versionStore.KeyPrefix = "version-check-"
versionStore.Config = versionConf
versionStore.Connect()
versionStore.SetKey("pump", pumps.VERSION, 0)
err := versionStore.SetKey("pump", pumps.Version, 0)
if err != nil {
log.WithFields(logrus.Fields{
"prefix": mainPrefix,
}).Error("Error storing version: ", err)
}
}

func initialisePumps() {
Expand Down
6 changes: 4 additions & 2 deletions pumps/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package pumps

var (
VERSION = "v1.8.0"
builtBy, Commit, buildDate string
Version = "v1.8.0"
BuiltBy string
Commit string
BuildDate string
)

0 comments on commit f67cae3

Please sign in to comment.