mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
image: funcy/go-dind:latest
|
|
|
|
cache:
|
|
key: "$CI_COMMIT_REF_NAME"
|
|
untracked: true
|
|
|
|
stages:
|
|
# - deps
|
|
- build
|
|
- test
|
|
- deploy
|
|
|
|
before_script:
|
|
- mkdir -p "${GOPATH}/src/gitlab-odx.oracle.com/odx/"
|
|
- ln -s `pwd` "${GOPATH}/src/gitlab-odx.oracle.com/odx/"
|
|
- cd "${GOPATH}/src/gitlab-odx.oracle.com/odx/functions"
|
|
|
|
build_job:
|
|
stage: build
|
|
script:
|
|
- go build -o functions-alpine
|
|
|
|
build_job_fn:
|
|
stage: build
|
|
script:
|
|
- cd fn
|
|
- go build -o fn-alpine
|
|
|
|
formatting:
|
|
stage: build
|
|
script:
|
|
- ./go-fmt.sh
|
|
|
|
test_job:
|
|
stage: test
|
|
script:
|
|
- DOCKER_LOCATION=container_ip ./test.sh
|
|
|
|
integration_tests:
|
|
stage: test
|
|
script:
|
|
- DOCKER_LOCATION=container_ip make docker-test-run-with-sqlite3
|
|
|
|
deploy_job:
|
|
only:
|
|
- tags
|
|
- master
|
|
stage: deploy
|
|
script:
|
|
- ls
|
|
- docker build -t ${DOCKER_IMAGE}:latest .
|
|
- docker tag ${DOCKER_IMAGE}:latest ${DOCKER_IMAGE}:${CI_COMMIT_REF_NAME}
|
|
- docker login -p ${DOCKER_PASSWORD} -u ${DOCKER_USERNAME} ${DOCKER_REGISTRY}
|
|
- docker push ${DOCKER_IMAGE}:${CI_COMMIT_REF_NAME}
|
|
- docker push ${DOCKER_IMAGE}:latest
|
|
- curl -k -X POST -F token=${GITLAB_TRIGGER_TOKEN} -F ref=${BRANCH_TO_DEPLOY} ${GITLAB_TRIGGER_URL}
|