diff --git a/azure-cron.yml b/azure-cron.yml index 12312f1a59a..2e2e34b16c8 100644 --- a/azure-cron.yml +++ b/azure-cron.yml @@ -37,7 +37,12 @@ jobs: - checkout: self - bash: ci/dev-env-install.sh displayName: 'Build/Install the Developer Environment' - - bash: ci/cron/run.sh + - bash: | + set -euo pipefail + eval "$(dev-env/bin/dade assist)" + + bazel build //ci/cron:cron + ./bazel-bin/ci/cron/cron docs env: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) diff --git a/ci/cron/run.sh b/ci/cron/run.sh deleted file mode 100755 index 8d5c3b43ea3..00000000000 --- a/ci/cron/run.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -euo pipefail - -SHA=$(git log -n1 --format=%H) - -revert_sha () { - git checkout $SHA -} -trap revert_sha EXIT - -cd "$(dirname "$0")"/../.. - -eval "$(dev-env/bin/dade assist)" - -bazel build //ci/cron:cron - -./bazel-bin/ci/cron/cron diff --git a/ci/cron/src/Main.hs b/ci/cron/src/Main.hs index 93f5ae7151d..b1a2793f4f3 100644 --- a/ci/cron/src/Main.hs +++ b/ci/cron/src/Main.hs @@ -24,6 +24,7 @@ import qualified Network.HTTP.Client as HTTP import qualified Network.HTTP.Client.TLS as TLS import qualified Network.HTTP.Types.Status as Status import qualified System.Directory as Directory +import qualified System.Environment import qualified System.Exit as Exit import qualified System.IO.Extra as IO import qualified System.Process as System @@ -233,8 +234,8 @@ fetch_s3_versions = do Just s3_json -> return $ map (\s -> PreVersion prerelease (version s)) $ H.keys s3_json Nothing -> Exit.die "Failed to get versions from s3" -main :: IO () -main = do +docs :: IO () +docs = do Control.forM_ [IO.stdout, IO.stderr] $ \h -> IO.hSetBuffering h IO.LineBuffering putStrLn "Checking for new version..." @@ -257,3 +258,13 @@ main = do putStrLn "Updating versions.json & hidden.json" update_s3 temp_dir gh_versions reset_cloudfront + +check_signatures :: IO () +check_signatures = do + putStrLn "FIXME" + +main :: IO () +main = System.Environment.getArgs >>= parse + where parse ["docs"] = docs + parse ["check-signatures"] = check_signatures + parse _ = Exit.die "Arg required: docs, check-signatures"