diff --git a/Dockerfile b/Dockerfile index f6852fba..c58d120e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,6 @@ RUN cd ./cmd/backport && make LDFLAGS="-linkmode=external" RUN cd ./cmd/gen_release_notes && make LDFLAGS="-linkmode=external" RUN cd ./cmd/gen_release_report && make LDFLAGS="-linkmode=external" RUN cd ./cmd/k3s_release && make LDFLAGS="-linkmode=external" -RUN cd ./cmd/standup && make ARG ETCD_VERSION=v3.5.7 ARG GH_VERSION=2.23.0 ARG YQ_VERSION=v4.30.8 @@ -58,7 +57,6 @@ COPY --from=builder /ecm-distro-tools/cmd/gen_release_notes/bin/gen_release_note COPY --from=builder /ecm-distro-tools/cmd/gen_release_report/bin/gen_release_report /usr/local/bin COPY --from=builder /ecm-distro-tools/cmd/k3s_release/bin/k3s_release /usr/local/bin COPY --from=builder /ecm-distro-tools/cmd/backport/bin/backport /usr/local/bin -COPY --from=builder /ecm-distro-tools/cmd/standup/bin/standup /usr/local/bin COPY --from=builder /ecm-distro-tools/cmd/test_coverage/bin/test_coverage /usr/local/bin COPY --from=builder /usr/local/bin/etcdctl /usr/local/bin COPY --from=builder /usr/local/bin/trivy /usr/local/bin diff --git a/Makefile b/Makefile index 5bb6a2ff..38786923 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,6 @@ rke2_release: backport: cd cmd/$@ && $(MAKE) -.PHONY: standup -standup: - cd cmd/$@ && $(MAKE) - .PHONY: test_coverage test_coverage: cd cmd/$@ && $(MAKE) diff --git a/cmd/standup/Makefile b/cmd/standup/Makefile deleted file mode 100644 index 64438eba..00000000 --- a/cmd/standup/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -VERSION := v0.1.0 -BINDIR := bin -BINARY := standup -override LDFLAGS += -override CFLAGS += -Dbin_name=$(BINARY) -Dstandup_version=$(VERSION) -Dgit_sha=$(shell git rev-parse HEAD) -O3 - -PREFIX = /usr/local - -UNAME_S = $(shell uname -s) - -MACOS_MANPAGE_LOC = /usr/share/man -LINUX_MAPPAGE_LOC = $(PREFIX)/man/man8 - -$(BINDIR)/$(BINARY): $(BINDIR) clean -ifeq ($(UNAME_S),FreeBSD) - $(CC) main.c $(CFLAGS) -o $@-freebsd-amd64 $(LDFLAGS) -I$(PREFIX)/include -L$(PREFIX)/lib -else ifeq ($(UNAME_S),Linux) - $(CC) main.c -static $(CFLAGS) -o $@-linux-amd64 $(LDFLAGS) -else - $(CC) main.c $(CFLAGS) -o $@ $(LDFLAGS) -endif - -$(BINDIR): - mkdir -p $@ - -$(DEPDIR): - mkdir -p $@ - -.PHONY: install -install: $(BINDIR)/$(BINARY) - mkdir -p $(PREFIX)/bin - cp $(BINDIR)/$(BINARY) $(PREFIX)/bin - -.PHONY: uninstall -uninstall: - rm -f $(PREFIX)/$(BINDIR)/$(BINARY) - -.PHONY: deps -deps: $(DEPDIR) - -.PHONY: clean -clean: - rm -f $(BINDIR)/* diff --git a/cmd/standup/main.c b/cmd/standup/main.c deleted file mode 100644 index a39d6b8e..00000000 --- a/cmd/standup/main.c +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include -#include -#include -#include - -#define STR1(x) #x -#define STR(x) STR1(x) - -// USAGE contains the application usage. -#define USAGE \ - "usage: %s [-vh] [-f]\n\ - -v version\n\ - -h help\n\ - -f create a new file. default name: yyyy-mm-dd\n" - -// STANDUP_TEMPLATE contains the base information to be filled out with -// today's and tomorrow's dates. This is then ready to be used to be -// further fleshed out. -#define STANDUP_TEMPLATE \ -"Yesterday:\n\ -* \n\n\ -Today:\n\ -* \n\n\ -PRs:\n\ -* \n\n" - -#define DATE_BUF_SZ 11 - -// date_format for getting the year, month, and day in yyyy-mm-dd format. -static const char* date_format = "%lu-%02lu-%02d"; - -int -main(int argc, char **argv) -{ - int file_output = 0; - FILE *out; - - int c; - if (argc > 1) { - while ((c = getopt(argc, argv, "hvf")) != -1) { - switch (c) { - case 'h': - printf(USAGE, STR(bin_name)); - return 0; - case 'v': - printf("%s %s - git: %s\n", - STR(bin_name), - STR(standup_version), - STR(git_sha)); - return 0; - case 'f': - file_output = 1; - break; - default: - printf(USAGE, STR(bin_name)); - return 1; - } - } - } - - time_t s = time(NULL); - struct tm *now = localtime(&s); - - int year = now->tm_year + 1900; - int month = now->tm_mon + 1; - - char today[DATE_BUF_SZ]; - sprintf(today, date_format, year, month, now->tm_mday); - - // check if the output needs to be written to a file. If so, set the output - // to the file descriptor derived from "today's" date, otherwise set it to - // STDOUT. - if (file_output) { - out = fopen(today, "w"); - } else { - out = stdout; - } - - fprintf(out, STANDUP_TEMPLATE); - fclose(out); - - return 0; -}