Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
96ce51e
Update go.yml
zachmann Oct 21, 2022
e1b5e3c
Merge branch 'master' into prerelease
zachmann Oct 21, 2022
d63ecb3
fix webinterface at scope selection indicator
zachmann Oct 19, 2022
12b2103
bump version
zachmann Oct 19, 2022
24f423b
allow host names in restrictions, not only ips
zachmann Oct 20, 2022
06395f8
bump dependencies;
zachmann Oct 20, 2022
271c9a9
fix modifying by-value receiver
zachmann Oct 20, 2022
f59510d
[webinterface] add mytoken client icon for useragent
zachmann Oct 20, 2022
4ca1af7
debug dns reverse lookup
zachmann Oct 20, 2022
9a2835e
fix dns reverse lookup
zachmann Oct 21, 2022
6841271
fix code issues
zachmann Oct 21, 2022
c64ccc9
update changelog
zachmann Oct 21, 2022
3915d0d
Bump github.com/gofiber/fiber/v2 from 2.38.1 to 2.39.0
dependabot[bot] Oct 24, 2022
f5808fd
adapt dev versioning
zachmann Oct 24, 2022
7429ae9
Bump github.com/gofiber/helmet/v2 from 2.2.17 to 2.2.18
dependabot[bot] Oct 25, 2022
d9ac026
Bump github.com/valyala/fasthttp from 1.40.0 to 1.41.0
dependabot[bot] Oct 26, 2022
1f16dba
adapt goreleaser to new ci plans
zachmann Oct 24, 2022
ef548b9
add gitlab ci
zachmann Oct 24, 2022
9f10229
add more ci actions
zachmann Oct 27, 2022
4f6e914
fix misuse of unbuffered os.Signal channel as argument to signal.Notify
zachmann Oct 27, 2022
2ebaa06
add caching
zachmann Oct 27, 2022
371025f
fix golint install
zachmann Oct 27, 2022
4ee27a1
fix golint issues
zachmann Oct 27, 2022
6cbbda3
[ci] add upload packages
zachmann Nov 2, 2022
5d3255b
[ci] improve release/prerelease
zachmann Nov 3, 2022
c2ca5ff
[ci] fix git dirty state because of .cache
zachmann Nov 3, 2022
5fa719b
[ci] fix upload script
zachmann Nov 3, 2022
cd92764
[ci] fix scp upload
zachmann Nov 3, 2022
33d6bda
[ci] fix go report
zachmann Nov 3, 2022
704f5e2
[ci] remove github actions, since they moved to gitlab ci
zachmann Nov 4, 2022
6164730
add warning message to tokeninfo to indicate users must copy mytoken;…
zachmann Nov 3, 2022
f51a4dd
changelog
zachmann Nov 3, 2022
23fe092
[ci] on normal release upload to prod and dont sign
zachmann Nov 4, 2022
c9a4567
set version
zachmann Nov 4, 2022
a10d5ee
fix typo
zachmann Nov 7, 2022
ec35830
[ci] only push to prerel repo
zachmann Nov 7, 2022
f2ac346
adapt new versioning procedure
zachmann Nov 10, 2022
85a0acc
[ci] adapt goreleaser
zachmann Nov 10, 2022
1722953
[lint] fix linting
zachmann Nov 10, 2022
4e2b5e9
[ci] fix set-prerel-version calling
zachmann Nov 10, 2022
dd0cc5f
[ci] fix set-prerel-version script
zachmann Nov 10, 2022
a38edf4
dummy prerel version
Nov 10, 2022
55fe64f
[ci] debug git depth
Nov 10, 2022
f0856db
[ci] debug git strategy
Nov 10, 2022
7ad4275
[ci] fix version file
Nov 10, 2022
c5ff0a6
[ci] debug git
Nov 11, 2022
ed2eb06
[ci] debug git
Nov 11, 2022
7611a21
[ci] fix git strategy
Nov 11, 2022
d752b34
[ci] dont create release on prerelease
Nov 11, 2022
198120e
[ci] fix usage of wrong goreleaser config
Nov 11, 2022
fcf9ac8
fix unsafe defer of os.Close differently
Nov 11, 2022
256a267
Bump golang.org/x/crypto from 0.1.0 to 0.2.0
dependabot[bot] Nov 10, 2022
b39fa28
remove manual string trimming
Nov 11, 2022
5516deb
Bump golang.org/x/mod from 0.6.0 to 0.7.0
dependabot[bot] Nov 10, 2022
b17bbd2
[ci] on release tag push to preprod instead of prerel
zachmann Nov 11, 2022
c79ea92
[doc] update changelog
zachmann Nov 11, 2022
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
42 changes: 0 additions & 42 deletions .github/workflows/go.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/release.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.idea/
/.cache/
/mytoken
/mytoken-setup
/mytoken-server
Expand All @@ -15,3 +16,4 @@ dist/
/docker/db.env
/docker/haproxy/haproxy.cfg
/docker/.env
/results/
19 changes: 19 additions & 0 deletions .gitlab-ci-scripts/goreleaser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
mkdir ../shared
first=$(grep '^## ' -nm1 CHANGELOG.md | cut -d':' -f1); \
second=$(grep '^## ' -nm2 CHANGELOG.md | tail -n1 | cut -d':' -f1); \
tail -n+$first CHANGELOG.md | head -n$(($second-$first)) > ../shared/release.md
GORELEASER_CONFIG=".goreleaser.yml"
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '-'; then
GORELEASER_CONFIG=".goreleaser-release.yml"
fi
BASEDIR=/go/src/github.com/oidc-mytoken/server
docker run --rm --privileged \
-v "$PWD":"$BASEDIR" \
-w "$BASEDIR" \
-v "${PWD}/../shared":/tmp/shared \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DOCKER_USERNAME -e DOCKER_PASSWORD \
-e GITHUB_TOKEN \
-e GORELEASER_CONFIG \
goreleaser/goreleaser release -f $GORELEASER_CONFIG --release-notes /tmp/shared/release.md
ls -l results
16 changes: 16 additions & 0 deletions .gitlab-ci-scripts/set-prerel-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

MASTER_BRANCH=refs/remotes/origin/master
VERSION_FILE=internal/model/version/VERSION

git config --global --add safe.directory "$PWD"
git config user.email "ci@repo.data.kit.edu"
git config user.name "cicd"

PREREL=$(git rev-list --count HEAD ^$MASTER_BRANCH)
VERSION=$(cat $VERSION_FILE)
FULL_VERSION="${VERSION}-pr${PREREL}"
echo "$FULL_VERSION" > $VERSION_FILE
git add $VERSION_FILE
git commit -m "dummy prerel version"
git tag "v${FULL_VERSION}"
41 changes: 41 additions & 0 deletions .gitlab-ci-scripts/upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

REPO_TARGET="/prerel"
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '-'; then
REPO_TARGET="/preprod"
fi

# ssh-key-script
[ -e /tmp/ssh-private-keys/${REPO_USER} ] && {
eval $(ssh-agent -s)
cat /tmp/ssh-private-keys/${REPO_USER} | tr -d '\r' | ssh-add -
test -d ~/.ssh || mkdir -p ~/.ssh
chmod 700 ~/.ssh
}
[ -e /tmp/ssh-private-keys/known_hosts ] && {
test -d ~/.ssh || mkdir -p ~/.ssh
cp /tmp/ssh-private-keys/known_hosts ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
}
ssh-add -l
ssh -o StrictHostKeyChecking=no "${REPO_USER}@${REPO_HOST}" "hostname -f"

# sign-repo function
sign_repos() {
ssh "${REPO_USER}@${REPO_HOST}" "~/ci-voodoo/ci-tools/sign-all-repos.sh -t ${REPO_TARGET}"
}

upload_files() {
UPLOAD_DIR=/tmp/package-upload
ssh "${REPO_USER}@${REPO_HOST}" "rm -rf $UPLOAD_DIR && mkdir -p $UPLOAD_DIR"
scp results/* "${REPO_USER}@${REPO_HOST}:${UPLOAD_DIR}"
}

distribute_files() {
ssh "${REPO_USER}@${REPO_HOST}" "~/ci-voodoo/ci-tools/distribute-local-packages.sh -t ${REPO_TARGET} -w mytoken"
}


# upload and sign
upload_files
distribute_files
sign_repos
79 changes: 79 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
image: golang:1.19
stages:
- build
- test
- lint
- release

default:
tags:
- linux
cache:
paths:
- .cache


before_script:
- mkdir -p .cache
- export GOPATH=${CI_PROJECT_DIR}/.cache

test:
stage: test
script:
- go test -v ./...

test_race:
stage: test
script:
- go test -race -v ./...

lint:
stage: lint
before_script:
- go install golang.org/x/lint/golint@latest
script:
- golint -set_exit_status ./...

vet:
stage: lint
script:
- go vet ./...

build_server:
stage: build
script:
- go build github.com/oidc-mytoken/server/cmd/mytoken-server

build_setup:
stage: build
script:
- go build github.com/oidc-mytoken/server/cmd/mytoken-server/mytoken-setup

build_migratedb:
stage: build
script:
- go build github.com/oidc-mytoken/server/cmd/mytoken-server/mytoken-migratedb

prerelease:
stage: release
image:
name: docker:stable
services:
- docker:dind
only:
refs:
- tags
- prerel
tags:
- linux
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
REPO_HOST: repo.data.kit.edu
REPO_USER: cicd
script:
- docker run --rm -v $PWD:/tmp/mytoken -w /tmp/mytoken bitnami/git .gitlab-ci-scripts/set-prerel-version
- .gitlab-ci-scripts/goreleaser.sh
- .gitlab-ci-scripts/upload.sh
after_script:
- docker run --rm curlimages/curl -d "repo=github.com/oidc-mytoken/server" https://goreportcard.com/checks
Loading