Skip to content

Commit bc77bbc

Browse files
anoopcs9phlogistonjohn
authored andcommitted
Consume nightly built Samba RPMs
Signed-off-by: Anoop C S <[email protected]>
1 parent 0e8af2b commit bc77bbc

File tree

2 files changed

+71
-2
lines changed

2 files changed

+71
-2
lines changed

Makefile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,49 @@ SERVER_DIR:=images/server
1313
AD_SERVER_DIR:=images/ad-server
1414
CLIENT_DIR:=images/client
1515
SERVER_SRC_FILE:=$(SERVER_DIR)/Dockerfile.fedora
16+
NIGHTLY_SERVER_SRC_FILE:=$(SERVER_DIR)/Dockerfile.nightly
1617
SERVER_SOURCES:=$(SERVER_DIR)/smb.conf
1718
AD_SERVER_SRC_FILE:=$(AD_SERVER_DIR)/Containerfile
1819
AD_SERVER_SOURCES:=$(AD_SERVER_DIR)/populate.sh $(AD_SERVER_DIR)/provision.sh $(AD_SERVER_DIR)/run.sh
1920
CLIENT_SRC_FILE:=$(CLIENT_DIR)/Dockerfile
2021

2122
TAG?=latest
2223
SERVER_NAME:=samba-container:$(TAG)
24+
NIGHTLY_SERVER_NAME:=samba-container:nightly
2325
AD_SERVER_NAME:=samba-ad-container:$(TAG)
2426
CLIENT_NAME:=samba-client-container:$(TAG)
2527

2628
SERVER_REPO_NAME:=quay.io/samba.org/samba-server:$(TAG)
29+
NIGHTLY_SERVER_REPO_NAME:=quay.io/samba.org/samba-server:nightly
2730
AD_SERVER_REPO_NAME:=quay.io/samba.org/samba-ad-server:$(TAG)
2831
CLIENT_REPO_NAME:=quay.io/samba.org/samba-client:$(TAG)
2932

3033
BUILDFILE_SERVER:=.build.server
34+
BUILDFILE_NIGHTLY_SERVER:=.build.nightly-server
3135
BUILDFILE_AD_SERVER:=.build.ad-server
3236
BUILDFILE_CLIENT:=.build.client
3337

34-
build: build-server build-ad-server build-client
38+
build: build-server build-nightly-server build-ad-server build-client
3539
.PHONY: build
3640

3741
build-server: $(BUILDFILE_SERVER)
3842
$(BUILDFILE_SERVER): Makefile $(SERVER_SRC_FILE) $(SERVER_SOURCES)
3943
$(BUILD_CMD) --tag $(SERVER_NAME) --tag $(SERVER_REPO_NAME) -f $(SERVER_SRC_FILE) $(SERVER_DIR)
4044
$(CONTAINER_CMD) inspect -f '{{.Id}}' $(SERVER_NAME) > $(BUILDFILE_SERVER)
4145

46+
build-nightly-server: $(BUILDFILE_NIGHTLY_SERVER)
47+
$(BUILDFILE_NIGHTLY_SERVER): Makefile $(NIGHTLY_SERVER_SRC_FILE) $(SERVER_SOURCES)
48+
$(BUILD_CMD) --tag $(NIGHTLY_SERVER_NAME) --tag $(NIGHTLY_SERVER_REPO_NAME) -f $(NIGHTLY_SERVER_SRC_FILE) $(SERVER_DIR)
49+
$(CONTAINER_CMD) inspect -f '{{.Id}}' $(NIGHTLY_SERVER_NAME) > $(BUILDFILE_NIGHTLY_SERVER)
50+
4251
push-server: build-server
4352
$(PUSH_CMD) $(SERVER_REPO_NAME)
4453
.PHONY: push-server
4554

55+
push-nightly-server: build-nightly-server
56+
$(PUSH_CMD) $(NIGHTLY_SERVER_REPO_NAME)
57+
.PHONY: push-nightly-server
58+
4659
build-ad-server: $(BUILDFILE_AD_SERVER)
4760
$(BUILDFILE_AD_SERVER): Makefile $(AD_SERVER_SRC_FILE) $(AD_SERVER_SOURCES)
4861
$(BUILD_CMD) --tag $(AD_SERVER_NAME) --tag $(AD_SERVER_REPO_NAME) -f $(AD_SERVER_SRC_FILE) $(AD_SERVER_DIR)
@@ -61,9 +74,13 @@ push-client: build-client
6174
$(PUSH_CMD) $(CLIENT_REPO_NAME)
6275
.PHONY: push-client
6376

64-
test: test-server
77+
test: test-server test-nightly-server
6578
.PHONY: test
6679

6780
test-server: build-server
6881
CONTAINER_CMD=$(CONTAINER_CMD) LOCAL_TAG=$(SERVER_NAME) tests/test-samba-container.sh
6982
.PHONY: test-server
83+
84+
test-nightly-server: build-nightly-server
85+
CONTAINER_CMD=$(CONTAINER_CMD) LOCAL_TAG=$(NIGHTLY_SERVER_NAME) tests/test-samba-container.sh
86+
.PHONY: test-nightly-server

images/server/Dockerfile.nightly

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM quay.io/samba.org/sambacc:latest AS builder
2+
ARG SAMBACC_VER=f6480c5861a56ef9d1ebb965aebb14732ec2690c
3+
ARG SAMBACC_REPO=https://github.com/samba-in-kubernetes/sambacc
4+
5+
# the changeset hash on the next line ensures we get a specifc
6+
# version of sambacc. When sambacc actually gets tagged, it should
7+
# be changed to use the tag.
8+
RUN /usr/local/bin/build.sh ${SAMBACC_VER} ${SAMBACC_REPO}
9+
10+
FROM fedora
11+
12+
MAINTAINER John Mulligan <[email protected]>
13+
ENV SAMBACC_VERSION="0.1"
14+
15+
COPY smb.conf /etc/samba/smb.conf
16+
RUN curl http://artifacts.ci.centos.org/gluster/nightly-samba/master/fedora/samba-nightly-master.repo -o /etc/yum.repos.d/samba-nightly-master.repo
17+
RUN dnf install --setopt=install_weak_deps=False -y \
18+
findutils \
19+
python-pip \
20+
python3-jsonschema \
21+
python3-samba \
22+
samba \
23+
samba-client \
24+
samba-winbind \
25+
samba-winbind-clients \
26+
tdb-tools \
27+
ctdb \
28+
&& dnf clean all \
29+
&& cp --preserve=all /etc/ctdb/functions /usr/share/ctdb/functions \
30+
&& cp --preserve=all /etc/ctdb/notify.sh /usr/share/ctdb/notify.sh \
31+
&& true
32+
33+
COPY --from=builder \
34+
/var/tmp/build/sambacc/dist/sambacc-$SAMBACC_VERSION-py3-none-any.whl \
35+
/tmp/sambacc-$SAMBACC_VERSION-py3-none-any.whl
36+
RUN pip install /tmp/sambacc-$SAMBACC_VERSION-py3-none-any.whl \
37+
&& rm -f /tmp/sambacc-$SAMBACC_VERSION-py3-none-any.whl \
38+
&& ln -s /usr/local/share/sambacc/examples/minimal.json /etc/samba/container.json \
39+
&& true
40+
41+
42+
VOLUME ["/share"]
43+
44+
EXPOSE 445
45+
46+
ENV SAMBACC_CONFIG="/etc/samba/container.json:/etc/samba/users.json"
47+
ENV SAMBA_CONTAINER_ID="demo"
48+
ENV SAMBA_SPECIFICS="daemon_cli_debug_output"
49+
ENTRYPOINT ["samba-container"]
50+
CMD ["run", "smbd"]
51+
52+
# vim:set syntax=dockerfile:

0 commit comments

Comments
 (0)