Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from uptrace:master #82

Merged
merged 19 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3acd6dd
fix: support embed with tag Unique
j2gg0s Nov 12, 2024
c6b302f
Merge pull request #1060 from j2gg0s/feat-embed-with-unique
j2gg0s Nov 18, 2024
5cc961d
fix: do not create new migrations if nothing to migrate
bevzzz Nov 19, 2024
ebdef1b
fix: pass correct 'transactional' parameter
bevzzz Nov 19, 2024
a0dff72
fix: trim surrounding '' in string literal in DEFAULT clause
bevzzz Nov 19, 2024
a426b12
test: add test cases for fixes
bevzzz Nov 19, 2024
89e21ea
fix: fix go.mod of oracledialect
mattn Nov 20, 2024
435510b
feat(ci): support release on osx
j2gg0s Nov 20, 2024
7591ff9
Merge pull request #1064 from mattn/fix-oracle-mod
j2gg0s Nov 20, 2024
8e991a5
Merge pull request #1066 from uptrace/feat-support-release-on-osx
j2gg0s Nov 20, 2024
bcd070f
fix: update oracledialect/version.go in release.sh
mattn Nov 20, 2024
73fd825
Merge pull request #1067 from mattn/fix-script
j2gg0s Nov 20, 2024
f3ba209
chore: release v1.2.6 (release.sh)
j2gg0s Nov 20, 2024
02d497c
Merge pull request #1065 from uptrace/release/v1.2.6
j2gg0s Nov 20, 2024
dbbc37d
ci: use find replace hardcode when modify func Version
j2gg0s Nov 21, 2024
9fe163e
ci: mssql use custom certificate to avoid negative serial number error
j2gg0s Nov 21, 2024
7325f3e
Merge pull request #1069 from j2gg0s/ci-use-find-replace-hardcode
j2gg0s Nov 21, 2024
815412b
Merge pull request #1071 from j2gg0s/feat-upgrade-mssql-for-dbtest
j2gg0s Nov 21, 2024
cb319f8
Merge pull request #1063 from uptrace/fix/automigrator-create-migrations
vmihailenco Nov 21, 2024
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
Prev Previous commit
Next Next commit
ci: mssql use custom certificate to avoid negative serial number error
  • Loading branch information
j2gg0s committed Nov 21, 2024
commit 9fe163eba055fb2af62614c121af7a23907c1905
4 changes: 2 additions & 2 deletions internal/dbtest/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ services:
interval: 10s
retries: 3
mssql:
image: mcmoe/mssqldocker:v2019.CU4.0
image: mssql-local
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=passWORD1
- MSSQL_SA_PASSWORD=passWORD1
- MSSQL_DB=test
- MSSQL_USER=sa
- MSSQL_PASSWORD=passWORD1
Expand Down
17 changes: 17 additions & 0 deletions internal/dbtest/mssql-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM mcr.microsoft.com/mssql/server:2019-CU29-ubuntu-20.04

RUN openssl req -x509 -nodes -newkey rsa:2048 -subj '/CN=mssql' -addext "subjectAltName = DNS:mssql" -keyout /etc/ssl/private/mssql.key -out /etc/ssl/certs/mssql.pem -days 7
RUN chmod 400 /etc/ssl/private/mssql.key
RUN chmod 400 /etc/ssl/certs/mssql.pem
RUN mkdir -p /var/opt/mssql
COPY mssql.conf /var/opt/mssql/mssql.conf


# Create a config directory
RUN mkdir -p /usr/config
WORKDIR /usr/config

# Bundle config source
COPY . /usr/config

ENTRYPOINT ["./entrypoint.sh"]
25 changes: 25 additions & 0 deletions internal/dbtest/mssql-docker/configure-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Wait 60 seconds for SQL Server to start up by ensuring that
# calling SQLCMD does not return an error code, which will ensure that sqlcmd is accessible
# and that system and user databases return "0" which means all databases are in an "online" state
# https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-databases-transact-sql?view=sql-server-2017

DBSTATUS=1
ERRCODE=1
i=0

while [[ $DBSTATUS -ne 0 ]] && [[ $i -lt 60 ]] && [[ $ERRCODE -ne 0 ]]; do
i=$i+1
DBSTATUS=$(/opt/mssql-tools/bin/sqlcmd -h -1 -t 1 -U sa -P $MYSQL_SA_PASSWORD -Q "SET NOCOUNT ON; Select SUM(state) from sys.databases")
ERRCODE=$?
sleep 1
done

if [ $DBSTATUS -ne 0 ] OR [ $ERRCODE -ne 0 ]; then
echo "SQL Server took more than 60 seconds to start up or one or more databases are not in an ONLINE state"
exit 1
fi

# Run the setup script to create the DB and the schema in the DB
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $MYSQL_SA_PASSWORD -d master -i setup.sql
7 changes: 7 additions & 0 deletions internal/dbtest/mssql-docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Start the script to create the DB and user
/usr/config/configure-db.sh &

# Start SQL Server
/opt/mssql/bin/sqlservr
5 changes: 5 additions & 0 deletions internal/dbtest/mssql-docker/mssql.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[network]
tlscert = /etc/ssl/certs/mssql.pem
tlskey = /etc/ssl/private/mssql.key
tlsprotocols = 1.2
forceencryption = 1
8 changes: 8 additions & 0 deletions internal/dbtest/mssql-docker/setup.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*

Enter custom T-SQL here that would run after SQL Server has started up.

*/

CREATE DATABASE $(MSSQL_DB);
GO
3 changes: 3 additions & 0 deletions internal/dbtest/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh -eux
cd mssql-docker
docker build -t mssql-local .
cd ..
trap 'docker-compose down -v' EXIT
docker-compose down -v
docker-compose up -d
Expand Down