stages:
  - build

build:
  stage: build
  image: maven:3.3.3-jdk-8
  script:
    - mvn package -q
    - ARTIFACT=$(find target -name "moneytracker-*.jar" | tr -d '[[:space:]]')
    - "export sha1=$(sha1sum artifact.tar.gz | awk '{print $1}')"
    - "export md5=$(md5sum artifact.tar.gz | awk '{print $1}')"
    - ARTIFACT_NAME=${ARTIFACT#"target/"}
    - curl -f --user $ARTIFACTORY_USER:$ARTIFACTORY_PASSWORD --data-binary "@$ARTIFACT" -X PUT "https://artifactory.stritzke.me/artifactory/money-tracker/$ARTIFACT_NAME" -H "X-Checksum-Sha1:$sha1" -H "X-Checksum-Md5:$md5"
stages:
  - build

build:
  stage: build
  image: maven:3.3.3-jdk-8
  script:
    - mvn package -q
    - ARTIFACT=$(find target -name "moneytracker-*.jar" | tr -d '[[:space:]]')
    - "export sha1=$(sha1sum $ARTIFACT | awk '{print $1}')"
    - "export md5=$(md5sum $ARTIFACT | awk '{print $1}')"
    - ARTIFACT_NAME=${ARTIFACT#"target/"}
    - curl -f --user $ARTIFACTORY_USER:$ARTIFACTORY_PASSWORD --data-binary "@$ARTIFACT" -X PUT "https://artifactory.stritzke.me/artifactory/money-tracker/$ARTIFACT_NAME" -H "X-Checksum-Sha1:$sha1" -H "X-Checksum-Md5:$md5"
Use ARTIFACT variable for checksum creation.
Use ARTIFACT variable for checksum creation.
