我通过安装了gitlab-runner sudo apt install gitlab-runner
,按照教程进行配置,效果很好。
现在我想更改 gitlab-runner 的用户。所以我停止服务并service gitlab-runner stop
尝试通过更改用户
sudo gitlab-runner install --user=my-user --working-directory=/home/my-user
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
致命:无法安装 gitlab-runner:Init 已存在:/etc/systemd/system/gitlab-runner.service
如何进行?
这是docker-compose.yml
文件:
version: '3'
services:
############################
# Setup database container #
############################
postgres_db:
image: postgres
restart: always
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- ./data:/var/lib/postgresql/data
networks:
- db_network
pgadmin:
image: dpage/pgadmin4:4.19
restart: always
ports:
- 8001:8080/tcp
environment:
- PGADMIN_LISTEN_ADDRESS=0.0.0.0
- PGADMIN_LISTEN_PORT=8080
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
networks:
- db_network
networks:
db_network:
driver: bridge
Run Code Online (Sandbox Code Playgroud)
.env
同一目录下有一个文件。
# The above refers to the name of the postgres container since using docker-compose
# This is because …
Run Code Online (Sandbox Code Playgroud) 我有以下推导:
interface IMyInterface
{
string myProperty {get;}
}
class abstract MyBaseClass : IMyInterface // Base class is defining myProperty as abstract
{
public abstract string myProperty {get;}
}
class Myclass : MyBaseClass // Base class is defining myProperty as abstract
{
public sealed override string myProperty
{
get { return "value"; }
}
}
Run Code Online (Sandbox Code Playgroud)
我希望能够检查一个类的成员是否被声明为密封.有点像:
PropertyInfo property = typeof(Myclass).GetProperty("myProperty")
bool isSealed = property.GetMethod.IsSealed; // IsSealed does not exist
Run Code Online (Sandbox Code Playgroud)
所有这一切的意义是能够运行测试,检查代码/项目的一致性.
以下测试失败:
PropertyInfo property = typeof(Myclass).GetProperty("myProperty")
Assert.IsFalse(property.GetMethod.IsVirtual);
Run Code Online (Sandbox Code Playgroud) c# ×1
docker ×1
gitlab ×1
gitlab-ci ×1
pgadmin ×1
pgadmin-4 ×1
postgresql ×1
reflection ×1
testing ×1
unit-testing ×1